content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
<gh_stars>0
ms = map(measures()) do m
m.name
end
@test "LogLoss" in ms
@test "RootMeanSquaredError" in ms
# test `M()` makes sense for all measure types `M` extracted from `name`,
@test all(Symbol.(ms)) do ex
try
eval(:($ex()))
true
catch
false
end
end
task(m) = AbstractVector... | [
27,
456,
62,
30783,
29,
15,
198,
907,
796,
3975,
7,
47336,
28955,
466,
285,
198,
220,
220,
220,
285,
13,
3672,
198,
437,
198,
31,
9288,
366,
11187,
43,
793,
1,
287,
13845,
198,
31,
9288,
366,
30016,
5308,
272,
22266,
1144,
12331,
... | 2.263158 | 323 |
function ueberpruefePixelkanten(X,Y)
if X == [-1.5 -0.5 0.5 1.5]
if Y == [-1.5 -0.5 0.5 1.5]
println("Ihr habt die Pixelkanten korrekt gewählt!")
else
println("Schaut euch noch einmal die Pixelkanten bei Y an.")
end
else
println("Überprüft noch einmal eure Eingaben.")
end
end | [
8818,
334,
68,
527,
1050,
518,
5036,
40809,
74,
415,
268,
7,
55,
11,
56,
8,
198,
361,
1395,
6624,
25915,
16,
13,
20,
532,
15,
13,
20,
657,
13,
20,
352,
13,
20,
60,
198,
220,
220,
220,
611,
575,
6624,
25915,
16,
13,
20,
532,
... | 1.974359 | 156 |
module Pixell
using WCS
using WCS_jll
import WCS: AbstractWCSTransform
using FITSIO
using FFTW
using Printf
import Unitful, UnitfulAngles
import Unitful: uconvert, ustrip
using StaticArrays
using DSP: unwrap, unwrap!
import FastTransforms: chebyshevjacobimoments1, clenshawcurtisweights
using Libsharp
import Libsharp: ... | [
21412,
21642,
695,
198,
198,
3500,
45410,
198,
3500,
45410,
62,
73,
297,
198,
11748,
45410,
25,
27741,
27353,
2257,
26084,
687,
198,
3500,
376,
29722,
9399,
198,
3500,
376,
9792,
54,
198,
3500,
12578,
69,
198,
11748,
11801,
913,
11,
1... | 2.780161 | 373 |
######## CONSTRAINTS ############
# Generic fallback functions
function get_startup_shutdown(
device,
::Type{<:VariableType},
::Type{<:AbstractDeviceFormulation},
) # -> Union{Nothing, NamedTuple{(:startup, :shutdown), Tuple{Float64, Float64}}}
nothing
end
function get_min_max_limits(
device,
... | [
7804,
7102,
2257,
3861,
1268,
4694,
1303,
7804,
21017,
198,
198,
2,
42044,
2121,
1891,
5499,
198,
8818,
651,
62,
9688,
929,
62,
49625,
2902,
7,
198,
220,
220,
220,
3335,
11,
198,
220,
220,
220,
7904,
6030,
90,
27,
25,
43015,
6030,
... | 2.430928 | 9,519 |
<gh_stars>0
module Datasets
using UCI
using MLDatasets
using DataDeps
using StatsBase
using DelimitedFiles
using Random
using CSV
using DataFrames
using Flux # for one-hot encoding
export load_data
include("tabular.jl")
include("img.jl")
include("basics.jl")
end | [
27,
456,
62,
30783,
29,
15,
198,
21412,
16092,
292,
1039,
198,
198,
3500,
14417,
40,
198,
3500,
10373,
27354,
292,
1039,
198,
3500,
6060,
12156,
82,
198,
3500,
20595,
14881,
198,
3500,
4216,
320,
863,
25876,
198,
3500,
14534,
198,
350... | 2.955556 | 90 |
# Doc from https://github.com/spglib/spglib/blob/d1cb3bd/src/spglib.h#L424-L439
"""
get_ir_reciprocal_mesh(cell::Cell, mesh, is_shift=falses(3); is_time_reversal=true, symprec=1e-5)
Return k-points mesh and k-point map to the irreducible k-points.
Irreducible reciprocal grid points are searched from uniform
mesh ... | [
2,
14432,
422,
3740,
1378,
12567,
13,
785,
14,
2777,
4743,
571,
14,
2777,
4743,
571,
14,
2436,
672,
14,
67,
16,
21101,
18,
17457,
14,
10677,
14,
2777,
4743,
571,
13,
71,
2,
43,
40090,
12,
43,
47106,
198,
37811,
198,
220,
220,
22... | 2.205128 | 1,911 |
using Pkg
for p in ("ArgParse", "Knet", "AutoGrad", "Gym")
if !haskey(Pkg.installed(),p)
Pkg.add(p)
if p == "Gym"
ENV["GYM_ENVS"] = "atari:algorithmic:box2d:classic_control"
Pkg.build("Gym")
end
end
end
"""
julia reinforce_continous.jl
This example implements t... | [
3500,
350,
10025,
198,
198,
1640,
279,
287,
5855,
28100,
10044,
325,
1600,
366,
42,
3262,
1600,
366,
27722,
42731,
1600,
366,
38,
4948,
4943,
198,
220,
220,
220,
611,
5145,
10134,
2539,
7,
47,
10025,
13,
37050,
22784,
79,
8,
198,
22... | 2.301199 | 2,085 |
rot(θ) = [cos(θ) -sin(θ); sin(θ) cos(θ)]
convert(::Type{Matrix}, dgm::PersistenceDiagram; skipinf=true) =
hcat(( [birth(i), death(i)] for i in dgm if !skipinf || !isinf(birthx(i)) )...)
"""
wasserstein(dgm1, dgm2)
Calculate Wasserstein distance between persistent diagrams `dgm1` and `dgm2`.
"""
function wass... | [
10599,
7,
138,
116,
8,
796,
685,
6966,
7,
138,
116,
8,
532,
31369,
7,
138,
116,
1776,
7813,
7,
138,
116,
8,
8615,
7,
138,
116,
15437,
198,
198,
1102,
1851,
7,
3712,
6030,
90,
46912,
5512,
288,
39870,
3712,
30946,
13274,
18683,
6... | 2.009245 | 649 |
# This file implements Tables interface and provide compatibility
# to the Queryverse ecosystem.
# -----------------------------------------------------------------------------
# Tables.jl implementation
Tables.istable(::Type{<:ResultSet}) = true
# AbstractColumns interface
Tables.columnaccess(::Type{<:ResultSet})... | [
2,
770,
2393,
23986,
33220,
7071,
290,
2148,
17764,
220,
198,
2,
284,
262,
43301,
4399,
13187,
13,
198,
198,
2,
16529,
32501,
220,
198,
2,
33220,
13,
20362,
7822,
198,
198,
51,
2977,
13,
396,
540,
7,
3712,
6030,
90,
27,
25,
23004,... | 3.64557 | 237 |
<gh_stars>1-10
### A Pluto.jl notebook ###
# v0.17.1
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)
qu... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1558,
13,
16,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
770,
32217,
20922,
3544,
2488,
21653,
... | 1.983802 | 50,685 |
<reponame>marcobonici/CosmoCentral.jl
abstract type IntegrationMethod end
struct NumericalIntegrationSimpson <: IntegrationMethod end
struct CustomSimpson <: IntegrationMethod end
struct BeyondLimber <: IntegrationMethod end
"""
ComputeCℓ!(Cℓ::AbstractCℓ, WeightFunctionA::AbstractWeightFunction,
WeightFunction... | [
27,
7856,
261,
480,
29,
3876,
66,
672,
9229,
72,
14,
36734,
5908,
30645,
13,
20362,
198,
397,
8709,
2099,
38410,
17410,
886,
198,
7249,
399,
6975,
605,
34500,
1358,
8890,
8430,
1279,
25,
38410,
17410,
886,
198,
7249,
8562,
8890,
8430,... | 2.389892 | 2,216 |
<filename>docs/make.jl<gh_stars>0
using Documenter, BHAPtfem
makedocs(
modules = [BHAPtfem],
format = Documenter.HTML(),
checkdocs = :exports,
sitename = "BHAPtfem.jl",
pages = Any["index.md"]
)
deploydocs(
repo = "github.com/BottomHoleAssemblyAnalysis/BHAPtfem.jl",
)
| [
27,
34345,
29,
31628,
14,
15883,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
16854,
263,
11,
347,
39,
2969,
27110,
368,
198,
198,
76,
4335,
420,
82,
7,
198,
220,
220,
220,
13103,
796,
685,
33,
39,
2969,
27110,
368,
4357,
1... | 2.269231 | 130 |
<reponame>andrewrosemberg/PowerSystems.jl
get_aggregation_topology_accessor(::Type{Area}) = get_area
get_aggregation_topology_accessor(::Type{LoadZone}) = get_load_zone
set_load_zone!(bus::Bus, load_zone::LoadZone) = bus.load_zone = load_zone
set_area!(bus::Bus, area::Area) = bus.area = area
"""
Remove the aggregati... | [
27,
7856,
261,
480,
29,
392,
1809,
13698,
47369,
14,
13434,
11964,
82,
13,
20362,
198,
198,
1136,
62,
9460,
43068,
62,
4852,
1435,
62,
15526,
273,
7,
3712,
6030,
90,
30547,
30072,
796,
651,
62,
20337,
198,
1136,
62,
9460,
43068,
62,... | 2.636364 | 649 |
using PyPlot
using PyCall
mpl = pyimport("tikzplotlib")
using JLD2
using NNFEM
using ADCME
global nntype="ae_scaled"
stress_scale = 100.0
include("../nnutil.jl")
for tid in [1,3]
@load "../Data/domain$tid.jld2" domain
@load "../Data/domain$(tid)_te.jld2" domain_te
close("all")
u1 = hcat(domain.hist... | [
3500,
9485,
43328,
198,
3500,
9485,
14134,
198,
76,
489,
796,
12972,
11748,
7203,
83,
1134,
89,
29487,
8019,
4943,
198,
3500,
449,
11163,
17,
198,
3500,
399,
21870,
3620,
198,
3500,
49169,
11682,
198,
198,
20541,
299,
429,
2981,
2625,
... | 1.966387 | 714 |
<filename>Voronoi/src/BeachLine.jl<gh_stars>0
module BeachLine
using ..Geometry
using ..EventQueue
using ..Diagram
@enum SIDE LEFT RIGHT
mutable struct Arc
region::Diagram.Region
disappearsAt::Union{EventQueue.CircleEvent, Nothing}
parent#::Union{Breakpoint, Nothing}
prev::Union{Arc, Nothing}
next... | [
27,
34345,
29,
53,
273,
261,
23013,
14,
10677,
14,
3856,
620,
13949,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
21412,
8511,
13949,
628,
198,
3500,
11485,
10082,
15748,
198,
3500,
11485,
9237,
34991,
198,
3500,
11485,
18683,
6713,
62... | 2.451751 | 2,798 |
module Buttons
Base.Experimental.@optlevel 1
using Redux
using CImGui
# actions
abstract type AbstractButtonAction <: AbstractSyncAction end
get_label(a::AbstractButtonAction) = a.label
"""
Rename(label, new_label)
Change button's label to `new_label`.
Note that renaming may also change the identifier, please ... | [
21412,
887,
27288,
198,
198,
14881,
13,
20468,
9134,
13,
31,
8738,
5715,
352,
198,
198,
3500,
30609,
198,
3500,
327,
3546,
8205,
72,
198,
198,
2,
4028,
198,
397,
8709,
2099,
27741,
21864,
12502,
1279,
25,
27741,
28985,
12502,
886,
198... | 2.745154 | 1,393 |
mutable struct IgHolding
symbol::String
shares::Float64
date::Date
purchase_price::Float64
end
mutable struct IgPortfolio
cash::Float64
holdings::Vector{IgHolding}
end
struct IgUserError
message::String
end
struct IgSystemError
message::String
end
abstract type AbstractPortfolioOutpu... | [
76,
18187,
2878,
28818,
26807,
278,
198,
220,
220,
220,
6194,
3712,
10100,
198,
220,
220,
220,
7303,
3712,
43879,
2414,
198,
220,
220,
220,
3128,
3712,
10430,
198,
220,
220,
220,
5001,
62,
20888,
3712,
43879,
2414,
198,
437,
198,
198,... | 3.188172 | 186 |
# ---
# title: 862. Shortest Subarray with Sum at Least K
# id: problem862
# author: Indigo
# date: 2021-02-17
# difficulty: Hard
# categories: Binary Search, Queue
# link: <https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/description/>
# hidden: true
# ---
#
# Return the **length** of the shortest,... | [
2,
11420,
198,
2,
3670,
25,
807,
5237,
13,
10073,
395,
3834,
18747,
351,
5060,
379,
1004,
459,
509,
198,
2,
4686,
25,
1917,
4521,
17,
198,
2,
1772,
25,
40673,
198,
2,
3128,
25,
33448,
12,
2999,
12,
1558,
198,
2,
8722,
25,
6912,
... | 1.955307 | 716 |
<gh_stars>1-10
"""
module Shapes
Definitions of various shapes.
All shapes have the signature: `shape(parameters::Tuple, x0, y0, θ=0)`, and some
have keyword argument `reference` which determines which point `(x0,y0)` is referring to.
The length of `parameters` depends on the shape. For example, `Circle` has jus... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
37811,
198,
220,
220,
220,
8265,
911,
7916,
198,
198,
7469,
50101,
286,
2972,
15268,
13,
198,
198,
3237,
15268,
423,
262,
9877,
25,
4600,
43358,
7,
17143,
7307,
3712,
51,
29291,
11,
2124,
... | 1.83594 | 11,380 |
<reponame>ahojukka5/LogisticRegression.jl<gh_stars>1-10
using Test, StaticArrays, Random
using LogisticRegression: optimize!
Random.seed!(0)
X = [rand(2) for _ in 1:10]
Y = [x[1] + x[2] > 1.0 ? 1.0 : 0.0 for x in X]
J = [0.0]
w = [1.0 -1.0]
b = [0.0]
optimize!(J, w, b, X, Y, num_iterations=50, learning_rate=3.0)
@test... | [
27,
7856,
261,
480,
29,
993,
13210,
2724,
4914,
20,
14,
11187,
2569,
8081,
2234,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
6208,
11,
36125,
3163,
20477,
11,
14534,
198,
3500,
5972,
2569,
8081,
2234,
25,
27183,
0,
... | 2.017778 | 225 |
<filename>test/plottest.jl<gh_stars>0
const defcolors = ["#1F77B4", "#FF7F0E", "#2CA02C", "#D62728", "#9467BD",
"#8C564B", "#E377C2", "#7F7F7F", "#BCBD22", "#17BECF"]
sv = IScatterSpectrum.ScatterVolume(230e6, 1e-6, 50000e-9, 0.0)
p = IScatterSpectrum.Plasma(1.5e11, 2000., 1000., sv)
f = 5.0:5:500... | [
27,
34345,
29,
9288,
14,
489,
24879,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
9979,
825,
4033,
669,
796,
14631,
2,
16,
37,
3324,
33,
19,
1600,
25113,
5777,
22,
37,
15,
36,
1600,
25113,
17,
8141,
2999,
34,
1600,
25113,
35,
498... | 1.74475 | 2,476 |
module OverflowContexts
__precompile__(false)
include("macros.jl")
include("base_ext.jl")
export @default_checked, @default_unchecked, @checked, @unchecked,
unchecked_neg, unchecked_add, unchecked_sub, unchecked_mul, unchecked_negsub, unchecked_pow, unchecked_abs,
checked_neg, checked_add, checked_sub, checke... | [
21412,
3827,
11125,
21947,
82,
198,
834,
3866,
5589,
576,
834,
7,
9562,
8,
198,
198,
17256,
7203,
20285,
4951,
13,
20362,
4943,
198,
17256,
7203,
8692,
62,
2302,
13,
20362,
4943,
198,
198,
39344,
2488,
12286,
62,
26752,
11,
2488,
1228... | 2.970588 | 136 |
<filename>test/runtests.jl
using ArrayInterface, Test
@test ArrayInterface.ismutable(rand(3))
using StaticArrays
ArrayInterface.ismutable(@SVector [1,2,3]) == false
ArrayInterface.ismutable(@MVector [1,2,3]) == true
| [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
3500,
15690,
39317,
11,
6208,
198,
198,
31,
9288,
15690,
39317,
13,
1042,
18187,
7,
25192,
7,
18,
4008,
198,
198,
3500,
36125,
3163,
20477,
198,
19182,
39317,
13,
1042,
18187,
... | 2.906667 | 75 |
zero_map(::Type{LinearMap}, M::Integer, N::Integer) =
LinearMap((y,x) -> (y .= false), M, N,
ismutating=true, issymmetric=true, ishermitian=true)
block_eltype(::Type{LinearMap{T}}) where T = T
block_spy_block(b::LinearMaps.WrappedMap{<:Any,<:AbstractMatrix}) =
block_spy_block(b.lmap)
isblockentr... | [
22570,
62,
8899,
7,
3712,
6030,
90,
14993,
451,
13912,
5512,
337,
3712,
46541,
11,
399,
3712,
46541,
8,
796,
198,
220,
220,
220,
44800,
13912,
19510,
88,
11,
87,
8,
4613,
357,
88,
764,
28,
3991,
828,
337,
11,
399,
11,
198,
220,
... | 2.264463 | 363 |
@testset "CPReward" begin
@testset "set_reward!(DecisionPhase)" begin
trailer = SeaPearl.Trailer()
model = SeaPearl.CPModel(trailer)
lh = SeaPearl.LearnedHeuristic{SeaPearl.DefaultStateRepresentation{SeaPearl.DefaultFeaturization, SeaPearl.DefaultTrajectoryState}, SeaPearl.CPReward, SeaPearl... | [
31,
9288,
2617,
366,
34,
4805,
413,
446,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
2617,
62,
260,
904,
0,
7,
10707,
1166,
35645,
16725,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
12268,
796,
6896,
46262,
75,
13,
15721... | 2.18241 | 921 |
module SeDuMi
using SparseArrays
using MATLAB
export sedumi
# The fields should be integer values but the type should be `Float64` to work
# with SeDuMi
mutable struct Cone
f::Float64 # number of free primal variables / linear dual equality constraints
l::Float64 # length of LP cone
q::Vector{Float64} # ... | [
21412,
1001,
35660,
41541,
198,
198,
3500,
1338,
17208,
3163,
20477,
198,
3500,
36775,
48780,
198,
198,
39344,
10081,
12994,
198,
198,
2,
383,
7032,
815,
307,
18253,
3815,
475,
262,
2099,
815,
307,
4600,
43879,
2414,
63,
284,
670,
198,
... | 2.381024 | 664 |
<filename>test/test_coverage_matrix.jl
using Test
using GatherShot
@testset "select_tests finds simplest" begin
@test GatherShot.select_tests(Bool[1]) == [1]
end
@testset "select_tests gets independent" begin
outcomes = Bool[
1 0 0;
0 1 0;
0 0 1
]
@test GatherShot.select_test... | [
27,
34345,
29,
9288,
14,
9288,
62,
1073,
1857,
62,
6759,
8609,
13,
20362,
198,
3500,
6208,
198,
3500,
402,
1032,
28512,
628,
198,
31,
9288,
2617,
366,
19738,
62,
41989,
7228,
24043,
1,
2221,
198,
220,
220,
220,
2488,
9288,
402,
1032... | 2.2125 | 240 |
using Test
using HMatrices
using LinearAlgebra
using Random
using StaticArrays
using HMatrices: RkMatrix
include(joinpath(HMatrices.PROJECT_ROOT,"test","testutils.jl"))
Random.seed!(1)
m = 2000
n = 2000
X = rand(SVector{3,Float64},m)
Y = [rand(SVector{3,Float64}) for _ in 1:n]
splitter = CardinalitySplitte... | [
3500,
6208,
198,
3500,
367,
19044,
45977,
198,
3500,
44800,
2348,
29230,
198,
3500,
14534,
198,
3500,
36125,
3163,
20477,
198,
198,
3500,
367,
19044,
45977,
25,
371,
74,
46912,
198,
198,
17256,
7,
22179,
6978,
7,
39,
19044,
45977,
13,
... | 1.998795 | 830 |
<filename>scratch/redisclusterprofile.jl
include("rediscommon.jl")
basedir = "/home/kfischer/cs262project/redis/utils/create-cluster/traces"
reads = Dict{Int,Vector{Any}}()
writes = Dict{Int,Vector{Any}}()
accepts = Dict{Int,Vector{Any}}()
closes = Dict{Int,Vector{Any}}()
timeline, modules = replay(joinpath(basedir,... | [
27,
34345,
29,
1416,
36722,
14,
445,
271,
565,
5819,
13317,
13,
20362,
198,
17256,
7203,
445,
271,
11321,
13,
20362,
4943,
198,
198,
3106,
343,
796,
12813,
11195,
14,
74,
69,
24645,
14,
6359,
29119,
16302,
14,
445,
271,
14,
26791,
1... | 2.472403 | 1,232 |
module Diff
using LinearAlgebra
using OffsetArrays
using PaddedViews
export diff_grids
using ..Render, ..Grids
index_overlap(A,B) = length(intersect(CartesianIndices(A),CartesianIndices(B)))
function diff_grids(A::ARCGrid, B::ARCGrid)
Asz1,Asz2 = size(A)
Bsz1,Bsz2 = size(B)
"""
Slide B over A
Ini... | [
21412,
10631,
198,
3500,
44800,
2348,
29230,
198,
3500,
3242,
2617,
3163,
20477,
198,
3500,
350,
29373,
7680,
82,
198,
39344,
814,
62,
2164,
2340,
198,
3500,
11485,
45819,
11,
11485,
8642,
2340,
628,
198,
9630,
62,
2502,
37796,
7,
32,
... | 2.285276 | 1,304 |
"""
ConditionalCrayon
Sets conditional formatting for printing to the terminal. Each `ConditionalCrayon`
specifies a function `bad(x)` that returns `true` if the argument `x` is not acceptable,
printing with color `cbad`, and a function `good(x)` that returns `true` if `x` is
acceptable, printing with color `cgo... | [
37811,
198,
220,
220,
220,
9724,
1859,
34,
2433,
261,
198,
198,
50,
1039,
26340,
33313,
329,
13570,
284,
262,
12094,
13,
5501,
4600,
25559,
1859,
34,
2433,
261,
63,
220,
198,
16684,
6945,
257,
2163,
4600,
14774,
7,
87,
8,
63,
326,
... | 2.985276 | 815 |
<gh_stars>1-10
@symbol_func function n_rho(cur_reactor::AbstractReactor, cur_rho::AbstractSymbol)
cur_n_bar = cur_reactor.n_bar
cur_nu_n = cur_reactor.nu_n
cur_n_rho = 1 - cur_rho ^ 2
cur_n_rho ^= cur_nu_n
cur_n_rho *= cur_n_bar
cur_n_rho *= 1 + cur_nu_n
cur_n_rho
end
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
31,
1837,
23650,
62,
20786,
2163,
299,
62,
81,
8873,
7,
22019,
62,
260,
11218,
3712,
23839,
3041,
11218,
11,
1090,
62,
81,
8873,
3712,
23839,
13940,
23650,
8,
198,
220,
1090,
62,
77,
62,
... | 1.993103 | 145 |
#!/usr/bin/env julia
#=
Utility functions
del2z <<EMAIL>>
=#
module Utils
using ..Ant: Polar, Model
export nothing
end # module
| [
2,
48443,
14629,
14,
8800,
14,
24330,
474,
43640,
198,
2,
28,
198,
18274,
879,
5499,
198,
12381,
17,
89,
9959,
27630,
4146,
4211,
198,
46249,
198,
21412,
7273,
4487,
198,
198,
3500,
11485,
13217,
25,
32909,
11,
9104,
198,
39344,
2147,... | 2.708333 | 48 |
<reponame>kool7d/Flux3D.jl
using Flux3D
using Documenter
using AbstractPlotting
makedocs(;
modules = [Flux3D],
doctest = false,
authors = "<NAME> <<EMAIL>>",
repo = "https://github.com/FluxML/Flux3D.jl/blob/{commit}{path}#L{line}",
sitename = "Flux3D.jl",
format = Documenter.HTML(;
pret... | [
27,
7856,
261,
480,
29,
74,
970,
22,
67,
14,
37,
22564,
18,
35,
13,
20362,
198,
3500,
1610,
2821,
18,
35,
198,
3500,
16854,
263,
198,
3500,
27741,
43328,
889,
198,
198,
76,
4335,
420,
82,
7,
26,
198,
220,
220,
220,
13103,
796,
... | 1.983673 | 735 |
<filename>src/SelectionFunctions.jl<gh_stars>0
"""
function selection_classic(fob::Function, trial::AbstractMatrix, population::AbstractMatrix)
"""
function selection_classic(fob::Function, trial::AbstractMatrix, population::AbstractMatrix)
#error checks
if size(trial) != size(population)
t... | [
27,
34345,
29,
10677,
14,
4653,
1564,
24629,
2733,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
220,
220,
220,
2163,
6356,
62,
49421,
7,
69,
672,
3712,
22203,
11,
4473,
3712,
23839,
46912,
11,
3265,
3712,
23839,
46912,
8,... | 2.753247 | 308 |
# ---------------------------------------------------------
# Simple harmonic oscillator without forcing term
# ---------------------------------------------------------
function harmonic_oscillator_free()
k = 2 ; m = .5 ; c = .1 ;
u0 = 1 ; v0 = 0 ;
M = m * ones(1, 1)
C = c * ones(1, 1)
K = k * ... | [
2,
20368,
22369,
12,
198,
2,
17427,
49239,
24969,
1352,
1231,
10833,
3381,
198,
2,
20368,
22369,
12,
198,
8818,
49239,
62,
17500,
359,
1352,
62,
5787,
3419,
198,
220,
220,
220,
479,
220,
796,
362,
2162,
285,
220,
796,
764,
20,
2162,... | 2.098428 | 2,672 |
module PoincareInvariant2ndTest
using PoincareInvariants
using GeometricIntegrators
using GeometricIntegrators.Utils
using SymPy
const nx = 100
const ny = 100
const Δt = 10.
const B₀ = 1.
const r₀ = 0.5
const z₀ = 0.0
const z₁ = 0.1
const u₀ = 5E-1
const u₁ = 5E-2
... | [
198,
21412,
7695,
1939,
533,
19904,
2743,
415,
17,
358,
14402,
628,
220,
220,
220,
1262,
7695,
1939,
533,
19904,
2743,
1187,
198,
220,
220,
220,
1262,
2269,
16996,
34500,
18942,
198,
220,
220,
220,
1262,
2269,
16996,
34500,
18942,
13,
... | 1.620424 | 2,076 |
<reponame>serenity4/GeometricAlgebra.jl
using GeometricAlgebra
using Test
using SafeTestsets
@testset "GeometricAlgebra.jl" begin
@safetestset "Implementation" begin include("implementations.jl") end
@safetestset "Identities in 𝓖₄" begin include("algebras/r4.jl") end
@safetestset "Identities in 𝓖₃,₁" beg... | [
27,
7856,
261,
480,
29,
325,
918,
414,
19,
14,
10082,
16996,
2348,
29230,
13,
20362,
198,
3500,
2269,
16996,
2348,
29230,
198,
3500,
6208,
198,
3500,
19978,
51,
3558,
1039,
198,
198,
31,
9288,
2617,
366,
10082,
16996,
2348,
29230,
13,... | 2.46798 | 203 |
<reponame>UnofficialJuliaMirrorSnapshots/StringAnalysis.jl-b66b7d2f-f536-51df-9f97-4dfb9d27c005
using BinaryProvider
# This is where all binaries will get installed
const prefix = Prefix(!isempty(ARGS) ? ARGS[1] : joinpath(@__DIR__,"usr"))
# Instantiate products here. Examples:
libstemmer = LibraryProduct(prefix, "lib... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
10100,
32750,
13,
20362,
12,
65,
2791,
65,
22,
67,
17,
69,
12,
69,
44468,
12,
4349,
7568,
12,
24,
69,
5607,
12,
19,
7568,
65,
24,
67,
1983,
66,
2254... | 2.377597 | 1,107 |
function matrix_free_apply2f!(
f::AbstractVector{T},
elementinfo::ElementFEAInfo{dim,T},
M,
vars,
problem::StiffnessTopOptProblem,
penalty,
xmin,
applyzero::Bool=false,
) where {dim,T}
@unpack Kes, black, white, varind, metadata = elementinfo
@unpack dof_cells, cell_dofs = metada... | [
8818,
17593,
62,
5787,
62,
39014,
17,
69,
0,
7,
198,
220,
220,
220,
277,
3712,
23839,
38469,
90,
51,
5512,
198,
220,
220,
220,
5002,
10951,
3712,
20180,
15112,
32,
12360,
90,
27740,
11,
51,
5512,
198,
220,
220,
220,
337,
11,
198,
... | 1.622294 | 1,247 |
<reponame>GHTaarn/QuickSystemBenchmarks.jl
module QuickSystemBenchmarks
export runbenchmarks
include("benchmarks.jl")
end # module
| [
27,
7856,
261,
480,
29,
38,
6535,
64,
1501,
14,
21063,
11964,
44199,
14306,
13,
20362,
198,
21412,
12029,
11964,
44199,
14306,
198,
198,
39344,
1057,
26968,
14306,
198,
198,
17256,
7203,
26968,
14306,
13,
20362,
4943,
198,
198,
437,
130... | 3.139535 | 43 |
easy_print(w::Ptr{Void}, y, x, str::ASCIIString) = TermWin.mvwprintw(w,y - 1,x - 1,"%s",str)
function print_cell(b::Board, w::Ptr{Void}, y, x)
b.matrix_rep[b.active,y,x,1] == 1 && (easy_print(w, y+1, x+1, "@"); return)
b.matrix_rep[b.active,y,x,2] == 1 && (easy_print(w, y+1, x+1, "+"); return)
b.matrix_rep... | [
38171,
62,
4798,
7,
86,
3712,
46745,
90,
53,
1868,
5512,
331,
11,
2124,
11,
965,
3712,
42643,
3978,
10100,
8,
796,
35118,
16643,
13,
76,
85,
86,
4798,
86,
7,
86,
11,
88,
532,
352,
11,
87,
532,
352,
553,
4,
82,
1600,
2536,
8,
... | 1.863475 | 564 |
"""
convert to AutomotiveDrivingModels.Scene
"""
function state2scene(mdp::CarMDP, s::CarMDPState, car_type::VehicleDef = mdp.car_type)
scene = Scene()
push!(scene, Vehicle(s.ego, mdp.ego_type, EGO_ID))
push!(scene, Vehicle(s.car, mdp.car_type, EGO_ID+1))
return scene
end
function animate_sta... | [
37811,
201,
198,
1102,
1851,
284,
17406,
19138,
20564,
1075,
5841,
1424,
13,
36542,
201,
198,
37811,
201,
198,
8818,
1181,
17,
29734,
7,
9132,
79,
3712,
9914,
44,
6322,
11,
264,
3712,
9914,
44,
6322,
9012,
11,
1097,
62,
4906,
3712,
... | 1.611954 | 1,121 |
<filename>test/runtests.jl
module MiniLoggersTest
using ReTest
include("test01_tokenizer.jl")
include("test02_loggerformat.jl")
end # module
MiniLoggersTest.runtests()
| [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
21412,
12558,
11187,
5355,
14402,
198,
198,
3500,
797,
14402,
198,
198,
17256,
7203,
9288,
486,
62,
30001,
7509,
13,
20362,
4943,
198,
17256,
7203,
9288,
2999,
62,
6404,
1362,
1... | 2.774194 | 62 |
<filename>src/PDIPS.jl
module PDIPS
using LinearAlgebra
using Printf
using SparseArrays
# LinearSolvers.jl
include("linalg/LinearSolvers.jl")
include("types.jl")
include("type_utils.jl")
include("algorithm_utils.jl")
include("algorithm.jl")
include("api.jl")
export
# types
AbstractProblem,
AbstractStan... | [
27,
34345,
29,
10677,
14,
5760,
47643,
13,
20362,
198,
21412,
14340,
47643,
198,
198,
3500,
44800,
2348,
29230,
198,
3500,
12578,
69,
198,
3500,
1338,
17208,
3163,
20477,
198,
198,
2,
44800,
36949,
690,
13,
20362,
198,
17256,
7203,
75,
... | 2.693252 | 163 |
using WizardsChess
using Test
@testset "WizardsChess.jl" begin
# Write your own tests here.
end
| [
3500,
21092,
7376,
824,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
54,
14124,
7376,
824,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
19430,
534,
898,
5254,
994,
13,
198,
437,
198
] | 2.885714 | 35 |
<gh_stars>1-10
function ω(xyz)
θϕ = xyz2θϕ(xyz)
θ,ϕ = θϕ
cos(θ)*cos(ϕ)^2
end
function ωθϕ(θϕ)
θ,ϕ = θϕ
cos(θ)*cos(ϕ)^2
end
# spherical surface gradient computed analytically
function gradω(xyz)
θϕr = xyz2θϕr(xyz)
θ,ϕ,r = θϕr
dθ = -sin(θ)*cos(ϕ)
dϕ = -2*cos(θ)*cos(ϕ)*sin(ϕ)
spherical_to_cartesian_m... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
8818,
18074,
231,
7,
5431,
89,
8,
198,
220,
7377,
116,
139,
243,
796,
2124,
45579,
17,
138,
116,
139,
243,
7,
5431,
89,
8,
198,
220,
7377,
116,
11,
139,
243,
796,
7377,
116,
139,
243,
... | 1.842837 | 719 |
using Test
using PETScX
@testset "mat tests" begin
for petsclib in PETScX.petsclibs
PETScX.Initialize(petsclib)
PetscScalar = PETScX.scalartype(petsclib)
PetscInt = PETScX.inttype(petsclib)
# Create a matrix
m = 10
n = m
nz = 3
A = PETScX.MatAIJ(pets... | [
3500,
6208,
198,
3500,
32043,
3351,
55,
198,
198,
31,
9288,
2617,
366,
6759,
5254,
1,
2221,
198,
220,
220,
220,
329,
17252,
565,
571,
287,
32043,
3351,
55,
13,
79,
1039,
565,
571,
82,
198,
220,
220,
220,
220,
220,
220,
220,
32043,... | 1.732673 | 1,010 |
<filename>test/test_doctest.jl
module TestDoctest
using Documenter
using Kaleido
using Test
@testset "doctest" begin
doctest(Kaleido; manual = true)
end
end # module
| [
27,
34345,
29,
9288,
14,
9288,
62,
4598,
310,
395,
13,
20362,
198,
21412,
6208,
5211,
310,
395,
198,
198,
3500,
16854,
263,
198,
3500,
509,
1000,
17305,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
4598,
310,
395,
1,
2221,
198,
... | 2.636364 | 66 |
<gh_stars>10-100
@testset "occupancy" begin
let
md = CuModuleFile(joinpath(@__DIR__, "ptx/dummy.ptx"))
dummy = CuFunction(md, "dummy")
active_blocks(dummy, 1)
active_blocks(dummy, 1; shmem=64)
occupancy(dummy, 1)
occupancy(dummy, 1; shmem=64)
launch_configuration(dummy)
launch_config... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
31,
9288,
2617,
366,
19596,
3883,
1,
2221,
198,
198,
1616,
198,
220,
220,
220,
45243,
796,
14496,
26796,
8979,
7,
22179,
6978,
7,
31,
834,
34720,
834,
11,
366,
457,
87,
14,
67,
13513,
... | 2.241379 | 232 |
<filename>test/runtests.jl
using IRDumps
using Test
@testset "IRDumps.jl" begin
# Write your tests here.
end
| [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
3500,
14826,
35,
8142,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
46833,
8142,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
19430,
534,
5254,
994,
13,
198,
437,
198
] | 2.651163 | 43 |
<gh_stars>0
"""
The sparsity pattern.
- `I`: Input index
- `J`: Ouput index
`(i, j)` means the `j`th element of the output depends on
the `i`th element of the input. Therefore `length(I) == length(J)`
"""
struct Sparsity
m::Int
n::Int
I::Vector{Int} # Input
J::Vector{Int} # Output
end
SparseArrays.sp... | [
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
464,
599,
45826,
3912,
13,
198,
198,
12,
4600,
40,
63,
25,
23412,
6376,
198,
12,
4600,
41,
63,
25,
440,
929,
315,
6376,
198,
198,
63,
7,
72,
11,
474,
8,
63,
1724,
262,
4600,
73,
6... | 1.921032 | 2,596 |
<reponame>schlichtanders/DataTypesBasic.jl
"""
Identity(:anything)
Identity is a simple wrapper, which works as a single-element container.
It can be used as the trivial Monad, and as such can be helpful in monadic
abstractions. For those who don't know about Monads, just think of it like
container-abstractions.
... | [
27,
7856,
261,
480,
29,
20601,
75,
30830,
45070,
14,
6601,
31431,
26416,
13,
20362,
198,
37811,
198,
220,
220,
220,
27207,
7,
25,
49459,
8,
198,
198,
7390,
26858,
318,
257,
2829,
29908,
11,
543,
2499,
355,
257,
2060,
12,
30854,
9290... | 2.868874 | 755 |
module SimplePosets
using SimpleGraphs, Primes
import Base.show, Base.isequal, Base.hash
import Base.inv, Base.intersect #, Base.zeta
import Base.adjoint, Base.*, Base.+, Base./ #, Base.\
import Base.==
import SimpleGraphs.add!, SimpleGraphs.has, SimpleGraphs.delete!
import SimpleGraphs.relabel
export SimplePoset, ... | [
21412,
17427,
21604,
1039,
198,
198,
3500,
17427,
37065,
82,
11,
1736,
999,
198,
198,
11748,
7308,
13,
12860,
11,
7308,
13,
786,
13255,
11,
7308,
13,
17831,
198,
11748,
7308,
13,
16340,
11,
7308,
13,
3849,
8831,
1303,
11,
7308,
13,
... | 2.207088 | 8,803 |
<reponame>JuliaBinaryWrappers/CUDA_full_jll.jl
# Autogenerated wrapper script for CUDA_full_jll for x86_64-w64-mingw32
JLLWrappers.@generate_wrapper_header("CUDA_full")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@generate_init_footer()
end # __init__()
| [
27,
7856,
261,
480,
29,
16980,
544,
33,
3219,
36918,
11799,
14,
43633,
5631,
62,
12853,
62,
73,
297,
13,
20362,
198,
2,
5231,
519,
877,
515,
29908,
4226,
329,
29369,
5631,
62,
12853,
62,
73,
297,
329,
2124,
4521,
62,
2414,
12,
86,... | 2.432203 | 118 |
<filename>test/test_hmc.jl
using MCMC
println(" Testing basic HMC constructors...")
HMC()
HMC(20)
HMC(0.75)
HMC(20, 0.75)
HMC(init=20)
HMC(scale=0.75)
HMC(init=20, scale=0.75)
mctuner = EmpMCTuner(0.85)
HMC(mctuner)
HMC(20, mctuner)
HMC(0.75, mctuner)
HMC(20, 0.75, mctuner)
HMC(init=20, tuner=mctuner)
HMC(scale=0.... | [
27,
34345,
29,
9288,
14,
9288,
62,
71,
23209,
13,
20362,
198,
3500,
13122,
9655,
198,
198,
35235,
7203,
220,
220,
220,
23983,
4096,
367,
9655,
5678,
669,
9313,
8,
198,
198,
39,
9655,
3419,
198,
39,
9655,
7,
1238,
8,
198,
39,
9655,... | 2.041534 | 313 |
<reponame>JuliaTeachingCTU/Scientific-Programming-in-Julia
# # Motivation
using InteractiveUtils # hide
using InteractiveUtils: subtypes # hide
# Before going into details about Julia type system, we will spend a few minutes motivating
# the two main roles of the type system, which are:
#
# 1. Structuring the code
... | [
27,
7856,
261,
480,
29,
16980,
544,
6767,
8103,
4177,
52,
14,
23010,
811,
12,
15167,
2229,
12,
259,
12,
16980,
544,
198,
2,
1303,
6543,
26939,
198,
198,
3500,
21365,
18274,
4487,
1303,
7808,
198,
3500,
21365,
18274,
4487,
25,
850,
1... | 3.563622 | 7,851 |
<reponame>xhub/JAMSDWriter.jl
using BinDeps
@BinDeps.setup
libjamsd = library_dependency("libjamsd", aliases=["jamsd"])
# Download binaries from hosted location
bin_prefix = "https://nullptr.fr/lib"
# TODO with latest Julia
if VERSION < v"0.7"
iswin = is_windows()
islinux = is_linux()
isapple = is_app... | [
27,
7856,
261,
480,
29,
87,
40140,
14,
41,
2390,
10305,
34379,
13,
20362,
198,
3500,
20828,
12156,
82,
198,
198,
31,
33,
259,
12156,
82,
13,
40406,
198,
198,
8019,
73,
4105,
67,
796,
5888,
62,
45841,
1387,
7203,
8019,
73,
4105,
67... | 2.196429 | 504 |
using DataDeps
register(DataDep(
"immigrant-salaries",
"http://www.stat.ufl.edu/~winner/data/immwork.txt",
"http://www.stat.ufl.edu/~winner/data/immwork.dat",
"d4e517a5725a613bf30b224b53a5b3b4509cf7a126f7813a12b3d2769de6e470",
post_fetch_method=(path -> begin
# IDs have spaces in them which is the delimi... | [
3500,
6060,
12156,
82,
198,
198,
30238,
7,
6601,
12156,
7,
198,
220,
366,
39835,
12,
21680,
3166,
1600,
198,
220,
366,
4023,
1378,
2503,
13,
14269,
13,
84,
2704,
13,
15532,
14,
93,
39791,
14,
7890,
14,
8608,
1818,
13,
14116,
1600,
... | 2.158088 | 272 |
<reponame>fabio-4/UnityGymWrapper.jl
include("helpers.jl")
include("../src/UnityGymWrapper.jl")
using .UnityGymWrapper
using Plots
using Flux
using Flux: Optimise.update!
function run!(model, opt, env;
epochs=30, steps=300, maxt=100, batchsize=128,
trainiters=100, ϵ=0.07, γ=99f-2, τ=1f-2)
rewards... | [
27,
7856,
261,
480,
29,
36434,
952,
12,
19,
14,
35955,
38,
4948,
36918,
2848,
13,
20362,
198,
17256,
7203,
16794,
364,
13,
20362,
4943,
198,
17256,
7203,
40720,
10677,
14,
35955,
38,
4948,
36918,
2848,
13,
20362,
4943,
198,
3500,
764,... | 1.894845 | 970 |
using DataFrames, Dates, SpecialFunctions
using Distributions, Extremes
using Test
using LinearAlgebra, Random
using Mamba
using Statistics
# Set the seed for reproductible test results
Random.seed!(12)
@testset "Extremes.jl" begin
include("data_test.jl")
include("parameterestimation_test.jl")
... | [
3500,
6060,
35439,
11,
44712,
11,
6093,
24629,
2733,
201,
198,
3500,
46567,
507,
11,
47871,
274,
201,
198,
3500,
6208,
201,
198,
3500,
44800,
2348,
29230,
11,
14534,
201,
198,
3500,
337,
31842,
201,
198,
3500,
14370,
201,
198,
201,
19... | 2.798817 | 169 |
<reponame>JuliaEditorSupport/LanguageServer.jl<filename>test/test_document.jl<gh_stars>100-1000
s1 = """
123456
abcde
ABCDEFG
"""
d1 = Document(TextDocument(uri"untitled:none", s1, 0), false)
@test get_text(d1) == s1
@test get_offset(d1, 0, 4) == 4
@test get_offset(d1, 1, 2) == 9
@test get_line_offsets(get_text_documen... | [
27,
7856,
261,
480,
29,
16980,
544,
17171,
15514,
14,
32065,
10697,
13,
20362,
27,
34345,
29,
9288,
14,
9288,
62,
22897,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
82,
16,
796,
37227,
198,
10163,
29228,
198,
39305,
293... | 2.421135 | 2,555 |
<gh_stars>0
# ------------------------------------------------------------------
# Licensed under the ISC License. See LICENCE in the project root.
# ------------------------------------------------------------------
function cut!(cutmask::AbstractArray{Bool,N},
simdev::AbstractArray{T,N}, TIdev::Abstrac... | [
27,
456,
62,
30783,
29,
15,
198,
2,
16529,
438,
198,
2,
49962,
739,
262,
3180,
34,
13789,
13,
4091,
38559,
18310,
287,
262,
1628,
6808,
13,
198,
2,
16529,
438,
198,
198,
8818,
2005,
0,
7,
8968,
27932,
3712,
23839,
19182,
90,
33,
... | 1.811665 | 2,469 |
<filename>main.jl
using ReferenceFree
using Serialization
filename = "../data/gargamell_small_human.bam"
# filename = "../data/MMS8_HGDP00521_French.paired.qualfilt.rmdup.entropy1.0.sort.bam"
# filename = "../data/AltaiNea.hg19_1000g.1.dq.bam"
max_reads = 1_000_000
name = join(split(basename(filename), ".")[1:end-1]... | [
27,
34345,
29,
12417,
13,
20362,
198,
3500,
20984,
11146,
198,
3500,
23283,
1634,
198,
198,
34345,
796,
366,
40720,
7890,
14,
70,
853,
480,
297,
62,
17470,
62,
10734,
13,
65,
321,
1,
198,
2,
29472,
796,
366,
40720,
7890,
14,
44,
5... | 2.490842 | 273 |
# This file is a part of ValueShapes.jl, licensed under the MIT License (MIT).
using ValueShapes
using Test
using Distributions
@testset "distributions" begin
@test @inferred(varshape(Normal())) == ScalarShape{Real}()
@test @inferred(varshape(MvNormal([2. 1.; 1. 3.]))) == ArrayShape{Real}(2)
@test @infe... | [
2,
770,
2393,
318,
257,
636,
286,
11052,
2484,
7916,
13,
20362,
11,
11971,
739,
262,
17168,
13789,
357,
36393,
737,
198,
198,
3500,
11052,
2484,
7916,
198,
3500,
6208,
198,
198,
3500,
46567,
507,
628,
198,
31,
9288,
2617,
366,
17080,
... | 2.593023 | 172 |
<reponame>UnofficialJuliaMirrorSnapshots/SeisNoise.jl-8cc7c3c0-6b5d-11e9-39fe-c9cd0236e08b<filename>src/Types/FFTData.jl
import Base:in, +, -, *, ==, convert, isempty, isequal, length, push!, sizeof, append!
import SeisIO: GeoLoc, PZResp
export FFTData
const fftfields = [:name, :loc, :fs, :gain, :freqmin, :freqmax, :c... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
4653,
271,
2949,
786,
13,
20362,
12,
23,
535,
22,
66,
18,
66,
15,
12,
21,
65,
20,
67,
12,
1157,
68,
24,
12,
2670,
5036,
12,
66,
24,
10210,
15,
249... | 1.849287 | 3,437 |
export dataLayer
type dataLayer<:Layer
bottom ::Array{Layer}
top ::Array{Layer}
topRange ::Vector
rₒ ::AFArray{Float32} #data
rᵢ ::AFArray{Float32} #objective
lock ::Bool
end
dataLayer(inDim::Int,outDim::Int)=
dataLayer(Layer[],Layer[],Vector{AFArray}(),rand(AFArray{Float32},outDim,batchs... | [
39344,
1366,
49925,
198,
198,
4906,
1366,
49925,
27,
25,
49925,
198,
220,
4220,
7904,
19182,
90,
49925,
92,
198,
220,
1353,
220,
220,
220,
7904,
19182,
90,
49925,
92,
198,
220,
1353,
17257,
7904,
38469,
628,
220,
374,
158,
224,
240,
... | 2.52381 | 147 |
### A Pluto.jl notebook ###
# v0.17.5
using Markdown
using InteractiveUtils
# ╔═╡ 5955f292-0ee4-4574-a184-0a1e12b68101
begin
using SymPy,LinearAlgebra
end
# ╔═╡ b78cb61c-c5bc-11ec-26a4-1bd5b2742132
md"# SymPy"
# ╔═╡ 79b66a3a-1dad-4308-a5cb-ff0fc82d40dd
begin
n=2
m=3
A=Array{Sym,2}(undef,m,n)
for i in 1:m
for... | [
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1558,
13,
20,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
2343,
243,
242,
28670,
22880,
94,
7863,
2816,
69,
32759,
12,
15,
1453,
19,
12,
... | 1.772154 | 6,737 |
<filename>backend/anime_data/snapshots_38329.jl
{"score_count": 34087, "score": 8.74, "timestamp": 1577784836.0}
{"score_count": 34087, "score": 8.74, "timestamp": 1577160560.0}
{"score_count": 19924, "score": 8.75, "timestamp": 1575328918.0}
{"score_count": 16228, "score": 8.73, "timestamp": 1575165243.0}
{"score_coun... | [
27,
34345,
29,
1891,
437,
14,
272,
524,
62,
7890,
14,
45380,
20910,
62,
34741,
1959,
13,
20362,
198,
4895,
26675,
62,
9127,
1298,
28560,
5774,
11,
366,
26675,
1298,
807,
13,
4524,
11,
366,
16514,
27823,
1298,
1315,
3324,
3695,
2780,
... | 2.371212 | 264 |
<gh_stars>1-10
using Test, Random, Statistics
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
6208,
11,
14534,
11,
14370,
198
] | 2.875 | 16 |
# ==========
# Arithmetic
# ==========
SUITE["Arithmetic-Vector"] = BenchmarkGroup()
SUITE["Arithmetic-Scalar"] = BenchmarkGroup()
# The examples are taken from <NAME>., <NAME>., & <NAME>. (2018).
# Implementation of Taylor models in CORA 2018. In Proc. of the 5th International Workshop on
# Applied Verification for... | [
2,
796,
2559,
28,
198,
2,
943,
29848,
198,
2,
796,
2559,
28,
198,
198,
12564,
12709,
14692,
3163,
29848,
12,
38469,
8973,
796,
25187,
4102,
13247,
3419,
198,
198,
12564,
12709,
14692,
3163,
29848,
12,
3351,
282,
283,
8973,
796,
25187,... | 2.491781 | 730 |
using Images, Luxor, BenchmarkTools
function calc(dims)
img = fill(RGB(0,0,0), (dims, dims))
a = 2.24; b = 0.43; c = -0.65; d = -2.43
x = y = z = .0
for _ in 1:dims^2
x, y, z = sin(a * y) - z * cos(b * x), z * sin(c * x) - cos(d * y), sin(x)
xx = trunc(Int, rescale(x, -2., 2., 0... | [
3500,
5382,
11,
17145,
273,
11,
25187,
4102,
33637,
201,
198,
201,
198,
8818,
42302,
7,
67,
12078,
8,
201,
198,
220,
220,
220,
33705,
796,
6070,
7,
36982,
7,
15,
11,
15,
11,
15,
828,
357,
67,
12078,
11,
5391,
82,
4008,
201,
198,... | 1.787097 | 310 |
<gh_stars>10-100
using DataFrames, CSV, StatsModels, LinearAlgebra, ForwardDiff, ForwardDiff, Optim, Distributions
using NLopt
using Metida
using SnoopCompile
using LineSearches
using BenchmarkTools
path = dirname(@__FILE__)
cd(path)
df0 = CSV.File(path*"/csv/df0.csv"; types = [String, String, String, String... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
3500,
6060,
35439,
11,
44189,
11,
20595,
5841,
1424,
11,
44800,
2348,
29230,
11,
19530,
28813,
11,
19530,
28813,
11,
30011,
11,
46567,
507,
198,
3500,
22879,
8738,
198,
3500,
3395,
3755,
198... | 2.138791 | 3,127 |
module LoopFieldCalc
using Elliptic, Printf, Contour
const μ₀ = 4π * 1e-7
include("geometry.jl")
Base.@kwdef struct CurrentLoop
radius::Float64
current::Float64
center::CartesianPoint
end
CurrentLoop(;radius, current, x, y, z) =
CurrentLoop(radius, current, CartesianPoint(x, y, z))
CurrentLoop(;radius, curren... | [
21412,
26304,
15878,
9771,
66,
198,
198,
3500,
7122,
10257,
291,
11,
12578,
69,
11,
2345,
454,
198,
198,
9979,
18919,
158,
224,
222,
796,
604,
46582,
1635,
352,
68,
12,
22,
198,
198,
17256,
7203,
469,
15748,
13,
20362,
4943,
198,
19... | 1.923041 | 4,288 |
#####################
# Generic evaluation
#####################
"Compute the evaluation matrix of the given dict on the given set of points."
function evaluation_matrix(Φ::Dictionary, pts, T = codomaintype(Φ))
A = Array{T}(undef, length(pts), length(Φ))
evaluation_matrix!(A, Φ, pts)
end
function evaluation_... | [
198,
14468,
4242,
2,
198,
2,
42044,
12660,
198,
14468,
4242,
2,
198,
198,
1,
7293,
1133,
262,
12660,
17593,
286,
262,
1813,
8633,
319,
262,
1813,
900,
286,
2173,
526,
198,
8818,
12660,
62,
6759,
8609,
7,
138,
99,
3712,
35,
14188,
... | 2.593197 | 735 |
"""
abstract type OliverProblem{T,N,M} end
Abstract type for constructing a boundary value problem from a recurrence
relation. The functions for coefficients and the right side dispatch.
`N` and `M` correspond to the total number of specified initial boundary conditions,
and the number specified on the end of th... | [
198,
37811,
198,
220,
220,
220,
12531,
2099,
15416,
40781,
90,
51,
11,
45,
11,
44,
92,
886,
198,
198,
23839,
2099,
329,
30580,
257,
18645,
1988,
1917,
422,
257,
664,
33928,
198,
49501,
13,
383,
5499,
329,
44036,
290,
262,
826,
1735,... | 2.240069 | 1,158 |
using LibGit2
using Serialization
unicode_url = "https://github.com/unicode-table/unicode-table-data.git"
local_path = joinpath(@__DIR__, "unicode-data")
serialized_file = joinpath(@__DIR__, "unicode-dict.serial")
# Check if local path already exists. If so, delete is
ispath(local_path) && rm(local_path, recursive = ... | [
3500,
7980,
38,
270,
17,
198,
3500,
23283,
1634,
198,
198,
46903,
1098,
62,
6371,
796,
366,
5450,
1378,
12567,
13,
785,
14,
46903,
1098,
12,
11487,
14,
46903,
1098,
12,
11487,
12,
7890,
13,
18300,
1,
198,
12001,
62,
6978,
796,
4654,... | 2.534451 | 537 |
# Generic Cholesky decomposition for fixed-size matrices, mostly unrolled
# Currently all sanity checks are disabled!
@generated function Base.chol(A::StaticMatrix)
if size(A) === (1, 1)
return :(_chol1(A))
elseif size(A) === (2, 2)
#ishermitian(A) || Base.LinAlg.non_hermitian_error("chol")
... | [
2,
42044,
609,
4316,
2584,
26969,
9150,
329,
5969,
12,
7857,
2603,
45977,
11,
4632,
555,
8375,
198,
198,
2,
16888,
477,
34182,
8794,
389,
10058,
0,
198,
31,
27568,
2163,
7308,
13,
354,
349,
7,
32,
3712,
45442,
46912,
8,
198,
220,
... | 1.974625 | 867 |
<gh_stars>0
module RTLSDR
using DSP: welch_pgram
import Base.open, Base.close
# I'm not sure I want this in here
using PyPlot
export RtlSdr, open, close, read_samples, get_strength, get_strength2
export get_rate, set_rate, get_freq, set_freq
include("c_interface.jl")
mutable struct RtlSdr
valid_ptr::Bool
dongle_... | [
27,
456,
62,
30783,
29,
15,
198,
21412,
11923,
6561,
7707,
198,
198,
3500,
360,
4303,
25,
5029,
354,
62,
79,
4546,
198,
11748,
7308,
13,
9654,
11,
7308,
13,
19836,
198,
198,
2,
314,
1101,
407,
1654,
314,
765,
428,
287,
994,
198,
... | 2.171317 | 1,541 |
<filename>test/runtests.jl
using MTIWrapper
using Test
using CSV
cwd = dirname(@__FILE__)
mti_dir = "$cwd/tmp"
MTIWrapper.install_web_api(mti_dir)
test_df = CSV.read("$cwd/test_df.txt")
@testset "Title and Abstract" begin
ti_abs_file = "$cwd/ti-abs.txt"
output_file = "$cwd/ti-abs-results.txt"
rm(ti_abs... | [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
3500,
19308,
40,
36918,
2848,
198,
3500,
6208,
198,
3500,
44189,
198,
198,
66,
16993,
796,
26672,
3672,
7,
31,
834,
25664,
834,
8,
628,
198,
16762,
72,
62,
15908,
796,
17971,
... | 2.191419 | 606 |
<filename>src/types.jl<gh_stars>0
using Graphs
abstract AbstractSpikingNeuron
abstract AbstractSpikingLayer
abstract AbstractConnection
abstract AbstractNet
type SimpleSpikingNeuron <: AbstractSpikingNeuron
lastSpike::Float64
didSpike::Bool
function SimpleSpikingNeuron()
new(-Inf,false)
end
end
type... | [
27,
34345,
29,
10677,
14,
19199,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
198,
3500,
29681,
82,
198,
198,
397,
8709,
27741,
4561,
14132,
8199,
44372,
198,
397,
8709,
27741,
4561,
14132,
49925,
198,
397,
8709,
27741,
32048,
198,
397... | 2.984318 | 829 |
hello = "Hello, World!"
println(hello)
| [
31373,
796,
366,
15496,
11,
2159,
2474,
198,
35235,
7,
31373,
8,
198
] | 3 | 13 |
<reponame>bicycle1885/GGPlot.jl<gh_stars>0
type GeomLine <: AbstractGeom
data::DataFrame
aes::Aesthetic
function GeomLine()
return new()
end
end
function geom_line()
return GeomLine()
end
x_minimum(geom::GeomLine) = minimum(geom.data[geom.aes.x])
x_maximum(geom::GeomLine) = maximum(geom.d... | [
27,
7856,
261,
480,
29,
65,
35298,
1507,
5332,
14,
11190,
43328,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
4906,
2269,
296,
13949,
1279,
25,
27741,
10082,
296,
198,
220,
220,
220,
1366,
3712,
6601,
19778,
198,
220,
220,
220,
257,
... | 2.141914 | 303 |
<filename>src/linearoperators/LMatrixOp.jl<gh_stars>10-100
export LMatrixOp
"""
`LMatrixOp(domainType=Float64::Type, dim_in::Tuple, b::Union{AbstractVector,AbstractMatrix})`
`LMatrixOp(b::AbstractVector, number_of_rows::Int)`
Creates a `LinearOperator` which, when multiplied with a matrix `X::AbstractMatrix`, retur... | [
27,
34345,
29,
10677,
14,
29127,
3575,
2024,
14,
43,
46912,
18257,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
39344,
406,
46912,
18257,
628,
198,
37811,
198,
63,
43,
46912,
18257,
7,
27830,
6030,
28,
43879,
2414,
3712,
6... | 2.201542 | 908 |
<gh_stars>1-10
# Dispatch types to call different problem builders
abstract type AbstractExperiment end
abstract type AbstractDynamicExperiment <: AbstractExperiment end
abstract type AbstractStochasticExperiment <: AbstractExperiment end
abstract type AbstractSteadyStateExperiment <: AbstractExperiment end
struct Dyna... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
35934,
3858,
284,
869,
1180,
1917,
31606,
198,
397,
8709,
2099,
27741,
20468,
3681,
886,
198,
397,
8709,
2099,
27741,
44090,
20468,
3681,
1279,
25,
27741,
20468,
3681,
886,
198,
397,
8709,
... | 2.694466 | 1,319 |
<gh_stars>1-10
# utilities for Mesh2D
function opposing_face(mesh::Mesh2D, elem, local_face)
@assert 0 < elem ≤ mesh.nelems
@assert 0 < local_face ≤ 4
neighbors = mesh.face_neighbors
face = mesh.elem_faces[elem, local_face]
if neighbors[face, 1] == elem && neighbors[face, 2] == local_face
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
20081,
329,
47529,
17,
35,
198,
8818,
12330,
62,
2550,
7,
76,
5069,
3712,
37031,
17,
35,
11,
9766,
76,
11,
1957,
62,
2550,
8,
198,
220,
220,
220,
2488,
30493,
657,
1279,
9766,
76,
4... | 2.355385 | 1,950 |
# This file contains the tests for the `Both` module
module TestBoth
using PDFHighlights
using Test
# Print the header
println("\e[1;32mRUNNING\e[0m: TestBoth.jl")
const pdf = joinpath(@__DIR__, "..", "pdf", "TestPDF.pdf")
@testset "get_authors" begin
dir = joinpath(@__DIR__, "..")
@test get_authors(dir)... | [
2,
770,
2393,
4909,
262,
5254,
329,
262,
4600,
10265,
63,
8265,
198,
198,
21412,
6208,
10265,
198,
198,
3500,
12960,
11922,
8091,
198,
3500,
6208,
198,
198,
2,
12578,
262,
13639,
198,
35235,
7203,
59,
68,
58,
16,
26,
2624,
76,
49,
... | 2.165846 | 1,218 |
using TMLEEpistasis
include(joinpath(pkgdir(TMLEEpistasis), "test", "runtests.jl")) | [
3500,
21232,
2538,
13807,
396,
17765,
198,
198,
17256,
7,
22179,
6978,
7,
35339,
15908,
7,
15972,
2538,
13807,
396,
17765,
828,
366,
9288,
1600,
366,
81,
2797,
3558,
13,
20362,
48774
] | 2.625 | 32 |
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: connectparticipant
using AWS.Compat
using AWS.UUIDs
"""
CreateParticipantConnection()
Creates the participant's connection. Note that ParticipantToken is used for invoking this API instead of ConnectionToken. The participant token is... | [
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,
2018,
48013,
415,
198,
198,
3500,
30865,
13,
40073,
198,
3500,
30865,
13,
52,
27586,
82,
198,
... | 3.260721 | 2,052 |
<reponame>Julia-BEAST-utils/BEASTXMLConstructor.jl
mutable struct FactorProportionStatistic <: MyXMLElement
el::XMLOrNothing
factor_model::IntegratedFactorsXMLElement
trait_model::TraitLikelihoodXMLElement
id::String
function FactorProportionStatistic(factor_model::IntegratedFactorsXMLElement,
... | [
27,
7856,
261,
480,
29,
16980,
544,
12,
12473,
11262,
12,
26791,
14,
12473,
11262,
55,
5805,
42316,
273,
13,
20362,
198,
76,
18187,
2878,
27929,
2964,
16864,
17126,
2569,
1279,
25,
2011,
37643,
2538,
1732,
198,
220,
220,
220,
1288,
37... | 2.320611 | 393 |
include("Include.jl")
# extra:
using Flux
using Flux: @epochs
using BSON: @load
# load training set -
full_training_data_frame = load_training_data()
# filter -
has_TM_flag = 0
experimental_data_table = filter([:visitid, :TM] => (x, y) -> ((x == 2 || x == 3) && y == has_TM_flag), full_training_data_frame)
# what is... | [
17256,
7203,
818,
9152,
13,
20362,
4943,
198,
198,
2,
3131,
25,
198,
3500,
1610,
2821,
198,
3500,
1610,
2821,
25,
2488,
538,
5374,
82,
198,
3500,
347,
11782,
25,
2488,
2220,
198,
198,
2,
3440,
3047,
900,
532,
198,
12853,
62,
34409,
... | 2.398917 | 554 |
using RocksDB
using Test
# write your own tests here
db = RocksDB.open_db("/tmp/test.db", true)
a = Array{Int32}(1000)
for i in 1:1000
a[i] = rand(Int32)
RocksDB.db_put(db, string(i), a[i])
end
# Check if values are correct
for i in 1:1000
val = RocksDB.db_get(db, string(i))
@test val == a[i]
end
| [
3500,
34243,
11012,
198,
3500,
6208,
198,
198,
2,
3551,
534,
898,
5254,
994,
198,
9945,
796,
34243,
11012,
13,
9654,
62,
9945,
7203,
14,
22065,
14,
9288,
13,
9945,
1600,
2081,
8,
198,
64,
796,
15690,
90,
5317,
2624,
92,
7,
12825,
... | 2.306569 | 137 |
<filename>doc/examples/demo_LDA_Gaussian1DGaussian1D.jl
#=
demo_LDA_Gaussian1DGaussian1D
A demo for LDA with Gaussian1DGaussian1D Bayesian components.
28/07/2015
<NAME>, <EMAIL>
=#
using BNP
srand(123)
## --- synthesizing the data --- ##
true_KK = 5
vv = 0.01
ss = 1
true_atoms = [Gaussian1D(ss*kk, vv) for... | [
27,
34345,
29,
15390,
14,
1069,
12629,
14,
9536,
78,
62,
43,
5631,
62,
35389,
31562,
16,
35,
35389,
31562,
16,
35,
13,
20362,
198,
2,
28,
198,
9536,
78,
62,
43,
5631,
62,
35389,
31562,
16,
35,
35389,
31562,
16,
35,
198,
198,
32,... | 2.200803 | 747 |
######################## Simulation Definations #######################
function create_uc_template()
service = Dict(
:ReserveUp =>
PSI.ServiceModel(PSY.VariableReserve{PSY.ReserveUp}, PSI.RangeReserve),
:ReserveDown =>
PSI.ServiceModel(PSY.VariableReserve{PSY.ReserveDown}, P... | [
14468,
7804,
41798,
2896,
7352,
1303,
14468,
4242,
2235,
198,
8818,
2251,
62,
1229,
62,
28243,
3419,
198,
220,
220,
220,
2139,
796,
360,
713,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4965,
3760,
4933,
5218,
198,
220,
220,
22... | 2.173735 | 6,366 |
import Base: GenericIOBuffer
function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
precompile(Tokenize.Tokens.iskeyword, (Tokenize.Tokens.Kind,))
precompile(Tokenize.Tokens.isliteral, (Tokenize.Tokens.Kind,))
precompile(Tokenize.Tokens.isoperator, (Tokenize.Tokens.Kind,)... | [
11748,
7308,
25,
42044,
9399,
28632,
198,
198,
8818,
4808,
3866,
5589,
576,
62,
3419,
198,
220,
220,
220,
269,
13345,
7,
25,
20362,
62,
8612,
803,
62,
22915,
11,
327,
600,
11,
32865,
6624,
352,
8614,
1441,
2147,
198,
220,
220,
220,
... | 2.473593 | 2,310 |
replicated = replicate(data, w1)
coll = collapse(replicated'; order=4, standardize=true)
recombined = recombine(coll, w1)
@test all(repl .== replicated)
@test length(recombined) == length(w1)
@test all(recombined .== recombine(collapse(repl'; order=4, standardize=true), w1))
@test_throws DimensionMismatch replicate(d... | [
35666,
3474,
796,
24340,
7,
7890,
11,
266,
16,
8,
198,
26000,
796,
9807,
7,
35666,
3474,
17020,
1502,
28,
19,
11,
3210,
1096,
28,
7942,
8,
198,
260,
24011,
1389,
796,
44759,
500,
7,
26000,
11,
266,
16,
8,
198,
198,
31,
9288,
477... | 2.869565 | 115 |
<reponame>Humans-of-Julia/Challenges
### A Pluto.jl notebook ###
# v0.12.4
using Markdown
using InteractiveUtils
# ╔═╡ 81915028-18e7-11eb-0aed-57a75839d4a7
begin
using CSV
using DataFrames
using Plots
using StatsPlots
using Pipe: @pipe
using GLM
using StatsBase
using Statistics
using Dates
end
# ╔═╡ 02eb9d3... | [
27,
7856,
261,
480,
29,
32661,
504,
12,
1659,
12,
16980,
544,
14,
41812,
34120,
198,
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1065,
13,
19,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,... | 2.374931 | 5,433 |
# meant to be a faster version of column reader
path = "C:/git/parquet-data-collection/dsd50p.parquet"
filemetadata = metadata(path)
io = open(path)
seek(io, 4)
read_thrift(io, PAR2.PageHeader)
using Snappy
compressed_page = read(io, 2461)
uncompressed_page = Snappy.uncompress(compressed_page)
dict = rein... | [
2,
4001,
284,
307,
257,
5443,
2196,
286,
5721,
9173,
198,
6978,
796,
366,
34,
14079,
18300,
14,
1845,
21108,
12,
7890,
12,
43681,
14,
9310,
67,
1120,
79,
13,
1845,
21108,
1,
198,
198,
7753,
38993,
796,
20150,
7,
6978,
8,
198,
198,... | 2.492509 | 534 |
@testset "788.rotated-digits.jl" begin
@test rotated_digits(6) == 3
@test rotated_digits(10) == 4
@test rotated_digits(10000) == 2320
end | [
31,
9288,
2617,
366,
22,
3459,
13,
10599,
515,
12,
12894,
896,
13,
20362,
1,
2221,
198,
220,
220,
220,
2488,
9288,
38375,
62,
12894,
896,
7,
21,
8,
6624,
513,
198,
220,
220,
220,
2488,
9288,
38375,
62,
12894,
896,
7,
940,
8,
662... | 2.328125 | 64 |
<gh_stars>1-10
using Turing
import Turing.translate!
ex = quote
x = 1
y = rand()
y ~ Normal(0,1)
end
res = translate!(:(y~Normal(1,1)))
Base.@assert res.head == :macrocall
Base.@assert res.args[1] == Symbol("@~")
Base.@assert res.args[3] == :y
Base.@assert res.args[4] == :(Normal(1, 1))
res2 = translate!(ex)... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
39141,
198,
11748,
39141,
13,
7645,
17660,
0,
198,
198,
1069,
796,
9577,
198,
220,
2124,
796,
352,
198,
220,
331,
796,
43720,
3419,
198,
220,
331,
5299,
14435,
7,
15,
11,
16,
8,
19... | 2.343891 | 221 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.