content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
<reponame>mmikhasenko/pwa_from_scratch
## definitions
push!(LOAD_PATH,"src")
using DalitzPlotAnalysis
using amplitudes_compass
using Cuba
using Plots
m3π = collect(0.5:0.5:2.5)
Φ(s, m1sq, m2sq) = (s > (sqrt(m1sq)+sqrt(m2sq))^2) ? sqrt(λ(s, m1sq, m2sq))/(8 * π * s) : 0
function everything(i::Int64, folder = "output")... | [
27,
7856,
261,
480,
29,
3020,
1134,
10134,
32720,
14,
79,
10247,
62,
6738,
62,
1416,
36722,
198,
2235,
17336,
198,
14689,
0,
7,
35613,
62,
34219,
553,
10677,
4943,
198,
3500,
12348,
4224,
43328,
32750,
198,
3500,
12306,
10455,
62,
558... | 1.800156 | 1,286 |
<gh_stars>0
# code for testing our package
using PSVrelief, Test
@testset "steam" begin
# test case steam
# From API 520, Part I, 2000 (section 3.7.2)
# W = 69615 kg/h
# P = 11032*1.1 + 101.3 = 12236 kPa
# saturated
# API gets 1100 mm2, and this is with a Napier factor of 51.5, we are using 51.... | [
27,
456,
62,
30783,
29,
15,
198,
2,
2438,
329,
4856,
674,
5301,
198,
3500,
6599,
53,
2411,
2086,
11,
6208,
198,
198,
31,
9288,
2617,
366,
21465,
1,
2221,
198,
220,
220,
220,
1303,
1332,
1339,
13324,
198,
220,
220,
220,
1303,
3574,... | 2.224049 | 973 |
# -----------------------------------------------
# Minimal Distributions routines
# -----------------------------------------------
# TEST:
# using Rmath
#=
macro QD2(A, B) quote
esc(:(sum((A - B).^2)))
end
=#
abstract type AbstractDistributionType end
# ######### NORMAL DISTRIBUTION #########
abstract ty... | [
2,
20368,
24305,
198,
2,
1855,
4402,
46567,
507,
31878,
198,
2,
20368,
24305,
198,
198,
2,
43001,
25,
198,
2,
1262,
371,
11018,
198,
198,
2,
28,
198,
20285,
305,
1195,
35,
17,
7,
32,
11,
347,
8,
9577,
198,
220,
220,
220,
3671,
... | 2.202879 | 1,459 |
function DiffusionDefinition.diffusion_message(::Val{:Lorenz})
println("* * * * * * *")
println("Lorenz system")
println("* * * * * * *")
println("Description")
println("------------")
println("A three-dimensional elliptic diffusion")
println("dXₜ = θ₁(Yₜ-Xₜ)dt + σdW¹ₜ,")
println("dYₜ = ... | [
8818,
10631,
4241,
36621,
13,
26069,
4241,
62,
20500,
7,
3712,
7762,
90,
25,
43,
382,
27305,
30072,
198,
220,
220,
220,
44872,
7203,
9,
1635,
1635,
1635,
1635,
1635,
1635,
4943,
198,
220,
220,
220,
44872,
7203,
43,
382,
27305,
1080,
... | 1.941964 | 672 |
using Pkg.TOML, StaticArrays, LinearAlgebra
@testset "MagneticMoments.jl" begin
params = TOML.parsefile("MagneticMoments.toml")
magneticMoment = MPISimulations.initialize(MPISimulations.Langevin,"Langevin",params,Float64)
for T in [Float64,Float32,]
magneticMomentT = MPISimulations.Langevin(elementType=T)
@te... | [
3500,
350,
10025,
13,
51,
2662,
43,
11,
36125,
3163,
20477,
11,
44800,
2348,
29230,
198,
198,
31,
9288,
2617,
366,
13436,
9833,
29252,
658,
13,
20362,
1,
2221,
198,
197,
37266,
796,
41526,
43,
13,
29572,
7753,
7203,
13436,
9833,
29252... | 2.264325 | 541 |
<gh_stars>1-10
@reexport module _Series
include("binarysplitting.jl")
include("reciprocal.jl")
include("sqrt.jl")
include("arctan.jl")
include("pi.jl")
include("euler.jl")
include("ln2.jl")
end
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
31,
631,
87,
634,
8265,
4808,
27996,
198,
198,
17256,
7203,
39491,
22018,
2535,
13,
20362,
4943,
198,
198,
17256,
7203,
8344,
541,
43270,
13,
20362,
4943,
198,
17256,
7203,
31166,
17034,
13,
... | 2.4625 | 80 |
# #########################################################################
# ############################## GaN ###################################
# #########################################################################
# mutable struct GaN <: MixedPotential
# lj_Ga_Ga::LennardJones
# lj_N_N::LennardJo... | [
2,
1303,
29113,
29113,
7804,
198,
2,
1303,
14468,
7804,
4242,
2,
220,
220,
12822,
45,
220,
1303,
29113,
2235,
198,
2,
1303,
29113,
29113,
7804,
198,
198,
2,
4517,
540,
2878,
12822,
45,
1279,
25,
35250,
25396,
1843,
198,
2,
220,
220,... | 2.698667 | 375 |
function load_documenter_docs(pkg)
docs = docsdir(pkg)
isempty(docs) && return []
getfiles(docs)
end
function getfiles(path, files = Tuple{String, String}[])
isdir(path) || return files
for f in readdir(path)
f = joinpath(path, f)
if isfile(f) && split(f, '.')[end] == "md"
push!(files, (f, rea... | [
8818,
3440,
62,
22897,
263,
62,
31628,
7,
35339,
8,
198,
220,
34165,
796,
34165,
15908,
7,
35339,
8,
198,
220,
318,
28920,
7,
31628,
8,
11405,
1441,
17635,
628,
220,
651,
16624,
7,
31628,
8,
198,
437,
198,
198,
8818,
651,
16624,
7... | 2.526178 | 382 |
<reponame>asafasban/AAVideoIO
# Julia wrapper for header: /usr/local/include/libavcodec/dv_profile.h
# Automatically generated using Clang.jl wrap_c, version 0.0.0
export
av_dv_frame_profile,
av_dv_codec_profile,
av_dv_codec_profile2
function av_dv_frame_profile(sys,frame,buf_size::Integer)
ccall((:... | [
27,
7856,
261,
480,
29,
292,
1878,
292,
3820,
14,
3838,
10798,
9399,
198,
2,
22300,
29908,
329,
13639,
25,
1220,
14629,
14,
12001,
14,
17256,
14,
8019,
615,
19815,
721,
14,
67,
85,
62,
13317,
13,
71,
198,
2,
17406,
4142,
7560,
126... | 2.346774 | 372 |
# ---
# title: 485. Max Consecutive Ones
# id: problem485
# author: Indigo
# date: 2021-02-03
# difficulty: Easy
# categories: Array
# link: <https://leetcode.com/problems/max-consecutive-ones/description/>
# hidden: true
# ---
#
# Given a binary array, find the maximum number of consecutive 1s in this array.
#
# **E... | [
2,
11420,
198,
2,
3670,
25,
4764,
20,
13,
5436,
1482,
4552,
425,
32606,
198,
2,
4686,
25,
1917,
32642,
198,
2,
1772,
25,
40673,
198,
2,
3128,
25,
33448,
12,
2999,
12,
3070,
198,
2,
8722,
25,
16789,
198,
2,
9376,
25,
15690,
198,
... | 2.464752 | 383 |
mutable struct Figure{B<:Backend}
# NOTE: couldn't use @kw_args here, clashed with the format of the base constructor.
g ::B # description buffer
id::String # id of the figure
# ---
axes ::Vector{Axes{B}} # subplots
size ::T2F # (width, heigth)
textstyle::TextSty... | [
76,
18187,
2878,
11291,
90,
33,
27,
25,
7282,
437,
92,
198,
220,
220,
220,
1303,
24550,
25,
3521,
470,
779,
2488,
46265,
62,
22046,
994,
11,
37003,
351,
262,
5794,
286,
262,
2779,
23772,
13,
198,
220,
220,
220,
308,
7904,
33,
220,... | 2.150644 | 1,009 |
toradians(degree::Float64) = degree * π / 180.0
todegrees(radian::Float64) = radian * 180.0 / π
convertunits(units::Symbol = :kilometers) = 3960.0*(units == :miles) + 6373.0*(units == :kilometers) + 57.2957795*(units == :degrees) + (units == :radians)
function distance(point1::Vector{Float64}, point2::Vector{Float64},... | [
13165,
324,
1547,
7,
16863,
3712,
43879,
2414,
8,
796,
4922,
1635,
18074,
222,
1220,
11546,
13,
15,
198,
83,
1098,
70,
6037,
7,
6335,
666,
3712,
43879,
2414,
8,
796,
2511,
666,
1635,
11546,
13,
15,
1220,
18074,
222,
198,
1102,
1851,... | 2.354032 | 4,638 |
<filename>script/function_map_mtk/function_map_mtk.jl
using ModelingToolkit
using DifferentialEquations
using Distributions
using Tables
using DataFrames
using StatsPlots
using BenchmarkTools
@inline function rate_to_proportion(r,t)
1-exp(-r*t)
end;
@parameters β=0.05 c=10.0 γ=0.25 N=1000.0 δt=0.1
@variables... | [
27,
34345,
29,
12048,
14,
8818,
62,
8899,
62,
16762,
74,
14,
8818,
62,
8899,
62,
16762,
74,
13,
20362,
198,
198,
3500,
9104,
278,
25391,
15813,
198,
3500,
20615,
498,
23588,
602,
198,
3500,
46567,
507,
198,
3500,
33220,
198,
3500,
6... | 1.934174 | 714 |
<reponame>tkf/Dictionaries.jl<gh_stars>0
function Base.foreach(f, d::AbstractDictionary, d2::AbstractDictionary, ds::AbstractDictionary...)
if sharetokens(d, d2, ds...)
@inbounds for t in tokens(d)
f(gettokenvalue(d, t), gettokenvalue(d2, t), map(x -> @inbounds(gettokenvalue(x, t)), ds)...)
... | [
27,
7856,
261,
480,
29,
30488,
69,
14,
35,
2867,
3166,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
8818,
7308,
13,
754,
620,
7,
69,
11,
288,
3712,
23839,
35,
14188,
11,
288,
17,
3712,
23839,
35,
14188,
11,
288,
82,
3712,
23839,
... | 2.051502 | 466 |
<filename>src/disjoint_set.jl
struct DisjointSet
p::Vector{Int}
rank::Vector{Int}
function DisjointSet(n::Int)
p = [i for i in 1:n]
rank = zeros(Int, n)
new(p, rank)
end
end
function find_set(i::Int, ds::DisjointSet)::Int
while i != ds.p[i]
i = ds.p[i]
end
r... | [
27,
34345,
29,
10677,
14,
6381,
73,
1563,
62,
2617,
13,
20362,
198,
7249,
3167,
73,
1563,
7248,
198,
220,
220,
220,
279,
3712,
38469,
90,
5317,
92,
198,
220,
220,
220,
4279,
3712,
38469,
90,
5317,
92,
198,
220,
220,
220,
2163,
316... | 1.715493 | 355 |
<gh_stars>0
using VrpAnt
using Test
@testset "VrpAnt.jl" begin
m = Map(12)
@testset "Creation of the Map" begin
@test length(m.cities) == 12
@testset "Solution" begin
@test m.solution.length == Inf
@test m.solution.path == Vector{City}[]
@test m.solution.st... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
569,
81,
79,
13217,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
53,
81,
79,
13217,
13,
20362,
1,
2221,
198,
220,
220,
220,
285,
796,
9347,
7,
1065,
8,
628,
220,
220,
220,
2488,
9288,
... | 2.06414 | 343 |
<filename>events/2020/day-14/docking-data_v2.jl
## PARTE 2
cd(@__DIR__())
using DataStructures: Queue, enqueue!, nil, cons, list, Cons
maskrx = r"mask = (.*)"
memrx = r"mem\[([0-9]+)\] = ([0-9]+)"
function parse_mask_v2(address::T, s::AbstractString) where {T<:Unsigned}
b1 = one(T)
n = length(s)
address′ = ... | [
27,
34345,
29,
31534,
14,
42334,
14,
820,
12,
1415,
14,
67,
8629,
12,
7890,
62,
85,
17,
13,
20362,
198,
2235,
16652,
36,
362,
198,
10210,
7,
31,
834,
34720,
834,
28955,
198,
3500,
6060,
44909,
942,
25,
4670,
518,
11,
551,
36560,
... | 1.995946 | 740 |
using LinearAlgebra
using CompScienceMeshes
using SauterSchwab3D
const pI = point(1,5,3)
const pII = point(2,5,3)
const pIII = point(7,1,0)
const qI = point(10,11,12)
const qII = point(10,11,13)
const qIII = point(11,11,12)
const P = simplex(pI,pII,pIII)
const Q = simplex(qI,qII,qIII)
const sing = SauterSchwa... | [
3500,
44800,
2348,
29230,
198,
3500,
3082,
26959,
44,
274,
956,
198,
3500,
311,
2306,
263,
14874,
86,
397,
18,
35,
198,
198,
9979,
279,
40,
220,
220,
796,
966,
7,
16,
11,
20,
11,
18,
8,
198,
9979,
279,
3978,
220,
796,
966,
7,
... | 2.082717 | 1,487 |
using DReal
using Base.Test
"""
(set-logic QF_NRA)
(declare-fun x () Int)
(declare-fun y () Real)
(assert (<= 10 x))
(assert (<= x 20))
(assert (<= 30 y))
(assert (<= y 66))
(assert (<= (- (sin x) y) 0.3))
(check-sat)
(exit)
"""
# x = Var(Int, "x", 10,20)
# y = Var(Float64, "y", 30.0, 66.)
# add!(sin(x) - y <= 0.3)
#... | [
3500,
10560,
2287,
198,
3500,
7308,
13,
14402,
198,
198,
37811,
198,
7,
2617,
12,
6404,
291,
1195,
37,
62,
45,
3861,
8,
198,
7,
32446,
533,
12,
12543,
2124,
7499,
2558,
8,
198,
7,
32446,
533,
12,
12543,
331,
7499,
6416,
8,
198,
... | 2.007407 | 270 |
<filename>src/Lithium.jl
module Lithium
using DataFrames
using LaTeXStrings
using Missings
using MLJ
using Distributions
using Plots
include("analysis.jl") # Experimental designs
include("cb.jl") # Causal bootstrapping
include("criticism.jl") # Performance evaluation functions
include("dataio.jl") # Data... | [
27,
34345,
29,
10677,
14,
43,
342,
1505,
13,
20362,
198,
21412,
19730,
1505,
198,
198,
3500,
6060,
35439,
198,
3500,
4689,
49568,
13290,
654,
220,
198,
3500,
4544,
654,
198,
3500,
10373,
41,
198,
3500,
46567,
507,
198,
3500,
1345,
174... | 3.312169 | 567 |
<reponame>Jollywatt/TaylorSeries.jl<filename>src/intervals.jl
using .IntervalArithmetic
# Method used for Taylor1{Interval{T}}^n
function ^(a::Taylor1{T}, n::Integer) where {T<:Interval}
n == 0 && return one(a)
n == 1 && return copy(a)
n == 2 && return square(a)
n < 0 && return a^float(n)
return po... | [
27,
7856,
261,
480,
29,
41,
5098,
86,
1078,
14,
29907,
27996,
13,
20362,
27,
34345,
29,
10677,
14,
3849,
12786,
13,
20362,
198,
3500,
764,
9492,
2100,
3163,
29848,
198,
198,
2,
11789,
973,
329,
8121,
16,
90,
9492,
2100,
90,
51,
11... | 2.103662 | 1,939 |
# This file is a part of Julia. License is MIT: https://julialang.org/license
module RangesTest
import Dates
using Test
using ExtendedDates
using InteractiveUtils: subtypes
let
YD = YearDate
SD = SemesterDate
QD = QuarterDate
MD = MonthDate
WD = WeekDate
DD = DayDate
UD = UndatedDate
... | [
2,
770,
2393,
318,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
198,
21412,
371,
6231,
14402,
198,
198,
11748,
44712,
198,
3500,
6208,
198,
3500,
24204,
35,
689,
198,
198,... | 1.811242 | 7,952 |
using .Networks
using JuMP
using Dates
using DataStructures
using Printf
using Parameters
"""
REF_SCHEDULE_TYPE_IN_TSO : Indicates which schedule to use as reference for pilotables state/levels needed
for sequencing constraints and TSO objective function.
"""
@with_kw mutable struct TSOBile... | [
3500,
764,
7934,
5225,
198,
198,
3500,
12585,
7378,
198,
3500,
44712,
198,
3500,
6060,
44909,
942,
198,
3500,
12578,
69,
198,
3500,
40117,
198,
37811,
198,
31688,
62,
50,
3398,
1961,
24212,
62,
25216,
62,
1268,
62,
4694,
46,
1058,
142... | 2.103456 | 22,164 |
<gh_stars>1-10
macro _threads(ex)
return quote
if (Threads.nthreads() > 1) && (length(st) > 4096)
$(Expr(:macrocall, Expr(:(.), :Threads, QuoteNode(Symbol("@threads"))), __source__, ex))
else
$ex
end
end |> esc
end
for N in [8, 16, 32, 64, 128]
T = Symbol(:In... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
20285,
305,
4808,
16663,
82,
7,
1069,
8,
198,
220,
220,
220,
1441,
9577,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
16818,
82,
13,
77,
16663,
82,
3419,
1875,
352,
8,
11405,
357,
... | 1.83166 | 11,156 |
<filename>src/unresolved/220.contains-duplicate-iii.jl
# ---
# title: 220. Contains Duplicate III
# id: problem220
# author: <NAME>
# date: 2020-10-31
# difficulty: Medium
# categories: Sort, Ordered Map
# link: <https://leetcode.com/problems/contains-duplicate-iii/description/>
# hidden: true
# ---
#
# Given an array... | [
27,
34345,
29,
10677,
14,
403,
411,
5634,
14,
17572,
13,
3642,
1299,
12,
646,
489,
5344,
12,
15479,
13,
20362,
198,
2,
11420,
198,
2,
3670,
25,
15629,
13,
49850,
49821,
5344,
6711,
198,
2,
4686,
25,
1917,
17572,
198,
2,
1772,
25,
... | 2.154286 | 525 |
"""
# LoggingTestSets
`LoggingTestSet` is an [`AbstractTestSet`](https://docs.julialang.org/en/v1/stdlib/Test/#Creating-Custom-AbstractTestSet-Types)
that logs test results using `@info` and `@error` from the
[Logging][https://docs.julialang.org/en/v1/stdlib/Logging/] module.
```julia
julia> using LoggingTestSets
jul... | [
37811,
198,
2,
5972,
2667,
14402,
50,
1039,
198,
198,
63,
11187,
2667,
14402,
7248,
63,
318,
281,
685,
63,
23839,
14402,
7248,
63,
16151,
5450,
1378,
31628,
13,
73,
377,
498,
648,
13,
2398,
14,
268,
14,
85,
16,
14,
19282,
8019,
14... | 2.314286 | 1,925 |
<reponame>rleegates/FEASTSolver.jl
using FEASTSolver
using LinearAlgebra
using Profile
using NonlinearEigenproblems: PEP, compute_Mder, contour_block_SS, polyeig, compute_Mlincomb, compute_MM
function info(Λ, X, residuals, c, r)
inside(x) = in_contour(x, c, r)
in_eig = Λ[inside.(Λ)]
in_res = residuals[insi... | [
27,
7856,
261,
480,
29,
81,
293,
1533,
689,
14,
15112,
1921,
4694,
14375,
13,
20362,
198,
3500,
18630,
1921,
4694,
14375,
198,
3500,
44800,
2348,
29230,
198,
3500,
13118,
198,
3500,
8504,
29127,
36,
9324,
1676,
22143,
25,
350,
8905,
1... | 1.753833 | 2,348 |
<gh_stars>1-10
using Colors
using Plots
"Enumerate possible states of a single cell"
@enum InfectionStatus uninfected infected dead recovered
"Data structure containing the infection status of a cell"
mutable struct Cell
status::InfectionStatus
infection_time::Int8
end
"Create a 2D array of cells with 1 infe... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
29792,
198,
3500,
1345,
1747,
198,
198,
1,
4834,
6975,
378,
1744,
2585,
286,
257,
2060,
2685,
1,
198,
31,
44709,
26065,
295,
19580,
26329,
2309,
276,
14112,
2636,
11911,
198,
198,
1,
... | 2.381717 | 1,619 |
# This file was generated, do not modify it. # hide
mach.model.min_samples_split = 10
fit!(mach, rows=train_rows) # re-train with new hyper-parameter | [
2,
770,
2393,
373,
7560,
11,
466,
407,
13096,
340,
13,
1303,
7808,
198,
76,
620,
13,
19849,
13,
1084,
62,
82,
12629,
62,
35312,
220,
796,
838,
198,
11147,
0,
7,
76,
620,
11,
15274,
28,
27432,
62,
8516,
8,
1303,
302,
12,
27432,
... | 2.941176 | 51 |
module RunTests
using Test
@testset "IndexSets" begin include("IndexSetsTests.jl") end
@testset "SparseUtils" begin include("SparseUtilsTests.jl") end
@testset "Sequential" begin include("sequential/runtests.jl") end
@testset "MPI" begin include("mpi/runtests.jl") end
end # module
| [
21412,
5660,
51,
3558,
198,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
15732,
50,
1039,
1,
2221,
2291,
7203,
15732,
50,
1039,
51,
3558,
13,
20362,
4943,
886,
198,
198,
31,
9288,
2617,
366,
50,
29572,
18274,
4487,
1,
2221,
2291,... | 2.778846 | 104 |
mutable struct Study <: AbstractStudy
parameter_list::Vector{AbstractFloat}
parameter::Symbol
default::Real
sensitivity::Real
num_points::Int
deck::Union{Void, Symbol}
kink_reactors::Vector{Reactor}
wall_reactors::Vector{Reactor}
cost_reactors::Vector{Reactor}
W_M_reactors::Vector{Reactor}
end
... | [
76,
18187,
2878,
12481,
1279,
25,
27741,
39841,
198,
220,
11507,
62,
4868,
3712,
38469,
90,
23839,
43879,
92,
628,
220,
11507,
3712,
13940,
23650,
628,
220,
4277,
3712,
15633,
198,
220,
14233,
3712,
15633,
198,
220,
997,
62,
13033,
3712... | 2.403315 | 3,439 |
<gh_stars>1-10
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------
"""
EmpiricalVariogram(partition, var₁, var₂=var₁; [parameters])
Compute the empirical (cross-... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
16529,
438,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
38559,
24290,
287,
262,
1628,
6808,
13,
198,
2,
16529,
438,
198,
198,
37811,
198,
220,
220,
220,
2295,
4063,
605,
23907,
218... | 2.819868 | 755 |
@doc """
boundary_coef_mat(F::BoundaryFilter) -> Matrix
The boundary coefficients collected in a matrix where the `i`'th row
contains the coefficients of the `i`'th boundary scaling function.
"""->
function boundary_coef_mat(F::BoundaryFilter)
vm = van_moment(F)
coef_mat = zeros(Float64, vm, vm)
for row in 1:vm
... | [
31,
15390,
37227,
198,
197,
7784,
560,
62,
1073,
891,
62,
6759,
7,
37,
3712,
49646,
560,
22417,
8,
4613,
24936,
198,
198,
464,
18645,
44036,
7723,
287,
257,
17593,
810,
262,
4600,
72,
63,
6,
400,
5752,
198,
3642,
1299,
262,
44036,
... | 2.387791 | 1,720 |
<filename>test/runtests.jl<gh_stars>0
using mna
using Test
@testset "SYMBOLIC: Butterworth Low Pass Filter (cuttoff = 200MHz)" begin
Z₀ = 50;
Vₛ = 1;
testbench = Dict([ "Vs" => (:V, 1, 0, Vₛ)
, "Rs" => (:R, 1, 2, Z₀)
, "Rl" => (:R, 3, 0, Z₀)
]... | [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
285,
2616,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
23060,
10744,
3535,
2149,
25,
18971,
9268,
7754,
6251,
25853,
357,
8968,
1462,
487... | 1.580989 | 1,315 |
@syms a b c
@testset "Equality" begin
@eqtest a == a
@eqtest a != b
@eqtest a*b == a*b
@eqtest a*b != a
@eqtest a != a*b
end
@testset "Literal Matcher" begin
r = @rule 1 => 4
@test r(1) === 4
@test r(1.0) === 4
@test r(2) === nothing
end
@testset "Slot matcher" begin
@test @ru... | [
31,
1837,
907,
257,
275,
269,
198,
198,
31,
9288,
2617,
366,
36,
13237,
1,
2221,
198,
220,
220,
220,
2488,
27363,
9288,
257,
6624,
257,
198,
220,
220,
220,
2488,
27363,
9288,
257,
14512,
275,
198,
220,
220,
220,
2488,
27363,
9288,
... | 1.843188 | 778 |
#Ost - "E6" - восток, Nord - "N8" - север, West - "W4" - запад, Sud - "S2" - юг
function main_function11!(::Robot)
A=[]
B=[]
help_main_2(r,Ost)
help_main_1(r, Nord)
help_main_1(r, West)
help_main_2(r, Sud)
end
function obhod(::Robot,side1::HorizonSide,side2::HorizonSide,A,B)
whil... | [
2,
46,
301,
532,
366,
36,
21,
1,
532,
12466,
110,
15166,
21727,
20375,
25443,
118,
11,
18687,
532,
366,
45,
23,
1,
532,
220,
21727,
16843,
38857,
16843,
21169,
11,
2688,
532,
366,
54,
19,
1,
532,
12466,
115,
16142,
140,
123,
16142... | 1.691241 | 1,370 |
using MeasureTheory
using ConcreteStructs
import MeasureTheory: logdensity
@concrete terse struct Chain <: AbstractMeasure
κ
μ
end
evolve(mc::MarkovChain, μ) = μ ⋅ mc.κ
evolve(mc::MarkovChain, ::Nothing) = mc.μ
function dyniterate(mc::MarkovChain, u::Sample)
xnew = rand(u.rng, evolve(mc, Dirac(u.x)))... | [
3500,
24291,
464,
652,
198,
3500,
1482,
38669,
44909,
82,
198,
198,
11748,
24291,
464,
652,
25,
2604,
43337,
198,
198,
31,
1102,
38669,
1059,
325,
2878,
21853,
1279,
25,
27741,
47384,
198,
220,
220,
220,
7377,
118,
198,
220,
220,
220,... | 2.153094 | 1,228 |
<reponame>joshday/PlotlyLight.jl
download("https://cdn.plot.ly/plotly-latest.min.js", joinpath(@__DIR__, "plotly-latest.min.js")) | [
27,
7856,
261,
480,
29,
73,
3768,
820,
14,
43328,
306,
15047,
13,
20362,
198,
15002,
7203,
5450,
1378,
32341,
13,
29487,
13,
306,
14,
29487,
306,
12,
42861,
13,
1084,
13,
8457,
1600,
4654,
6978,
7,
31,
834,
34720,
834,
11,
366,
29... | 2.480769 | 52 |
StrikePrices = [13:0.25:19]
SensitivityMatrix = zeros(Float64, length(StrikePrices), 7)
SensitivityMatrix[:,1] = StrikePrices
SensitivityMatrix[:,2] = 0.25
for i in 1:length(StrikePrices) SensitivityMatrix[i,3] = Black76("c", 11, StrikePrices[i], 1/12, 0.05, SensitivityMatrix[i,2]) end
for i in 1:length(St... | [
628,
628,
198,
198,
31584,
6836,
1063,
796,
685,
1485,
25,
15,
13,
1495,
25,
1129,
60,
628,
198,
198,
50,
40545,
46912,
796,
1976,
27498,
7,
43879,
2414,
11,
4129,
7,
31584,
6836,
1063,
828,
767,
8,
628,
198,
198,
50,
40545,
46912... | 2.463466 | 479 |
@doc doc"""
Sphere{N} <: Manifold
The unit sphere manifold $\mathbb S^n$ represented by $n+1$-Tuples, i.e. in by
vectors in $\mathbb R^{n+1}$ of unit length
# Constructor
Sphere(n)
generates the $\mathbb S^{n}\subset \mathbb R^{n+1}$
"""
struct Sphere{N} <: Manifold end
Sphere(n::Int) = Sphere{n}()
functio... | [
31,
15390,
2205,
37811,
198,
220,
220,
220,
31798,
90,
45,
92,
1279,
25,
1869,
361,
727,
198,
198,
464,
4326,
16558,
48048,
39280,
11018,
11848,
311,
61,
77,
3,
7997,
416,
720,
77,
10,
16,
3,
12,
47247,
2374,
11,
1312,
13,
68,
1... | 2.256253 | 1,959 |
<gh_stars>10-100
# A disjoint set implementation adapted from
# https://github.com/JuliaCollections/DataStructures.jl/blob/f57330a3b46f779b261e6c07f199c88936f28839/src/disjoint_set.jl
# under the MIT license: https://github.com/JuliaCollections/DataStructures.jl/blob/master/License.md
# imports
import ._TOP_MOD:
l... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
317,
595,
73,
1563,
900,
7822,
16573,
422,
198,
2,
3740,
1378,
12567,
13,
785,
14,
16980,
544,
5216,
26448,
14,
6601,
44909,
942,
13,
20362,
14,
2436,
672,
14,
69,
3553,
26073,
64,
... | 2.529025 | 1,671 |
<reponame>rschroeder70/XLSXReader.jl<filename>test/runtests.jl
using XLSXReader, RDatasets
using Base.Test
#Test reference datasets and options
@test readxlsx("datasets/mtcars.xlsx") == dataset("datasets", "mtcars")
@test readxlsx("datasets/mtcars.xlsx") == readxlsx("datasets/mtcars.xlsx", 1)
@test readxlsx("datasets/... | [
27,
7856,
261,
480,
29,
3808,
354,
305,
5702,
2154,
14,
55,
6561,
55,
33634,
13,
20362,
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
3500,
1395,
6561,
55,
33634,
11,
371,
27354,
292,
1039,
198,
3500,
7308,
13,
14402,
1... | 2.170877 | 673 |
<reponame>sapal6/FastAI.jl
using FastAI
using Documenter
makedocs(;
modules=[FastAI],
authors="<NAME>, Julia Community",
repo="https://github.com/FluxML/FastAI.jl/blob/{commit}{path}#L{line}",
sitename="FastAI.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
... | [
27,
7856,
261,
480,
29,
82,
499,
282,
21,
14,
22968,
20185,
13,
20362,
198,
3500,
12549,
20185,
198,
3500,
16854,
263,
198,
198,
76,
4335,
420,
82,
7,
26,
198,
220,
220,
220,
13103,
41888,
22968,
20185,
4357,
198,
220,
220,
220,
7... | 2.039627 | 429 |
export
dense,
flatten,
ae,
ae_num,
ae_init,
fc,
fc_num,
fc_init,
fc_to_code,
ae_to_code,
fcx,
bn,
sparse_softmax_cross_entropy_with_logits,
Resnet1D
#----------------------------------------------------
# activation functions
_string2fn = Dict(
"relu" => relu,
"tanh" => tanh,
"sigmoid" => sigmoid,
"l... | [
39344,
220,
198,
67,
1072,
11,
198,
2704,
41769,
11,
198,
3609,
11,
198,
3609,
62,
22510,
11,
198,
3609,
62,
15003,
11,
198,
16072,
11,
198,
16072,
62,
22510,
11,
198,
16072,
62,
15003,
11,
198,
16072,
62,
1462,
62,
8189,
11,
198,... | 2.307408 | 10,826 |
#
# CART-related types and functions
#
struct Cart <: Wrapper
pyo::PyObject
function Cart(x::DataSet, y::Vector; threshold = nothing, threshold_type = ">",
include = nothing, exclude = nothing, kwargs...)
pandasDF = pandas_dataframe(x; include = include, exclude = exclude)
... | [
2,
198,
2,
327,
7227,
12,
5363,
3858,
290,
5499,
198,
2,
198,
198,
7249,
13690,
1279,
25,
27323,
2848,
198,
220,
220,
220,
279,
8226,
3712,
20519,
10267,
628,
220,
220,
220,
2163,
13690,
7,
87,
3712,
6601,
7248,
11,
331,
3712,
384... | 2.458797 | 449 |
<filename>examples/classification/script.jl<gh_stars>10-100
# # Classification of penguin species
#
# ## Packages
using AlgebraOfGraphics
using CairoMakie
using CalibrationErrors
using DataFrames
using Distributions
using MLJ
using MLJNaiveBayesInterface
using PalmerPenguins
using Random
## Plotting settings
set_aog... | [
27,
34345,
29,
1069,
12629,
14,
4871,
2649,
14,
12048,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
1303,
40984,
286,
38373,
259,
4693,
198,
2,
198,
2,
22492,
6400,
1095,
198,
198,
3500,
978,
29230,
5189,
18172,
198,
... | 2.891636 | 3,276 |
# Tests for atoms.jl
@testset "Atoms" begin
@test inferelement("CA") == "C"
@test inferelement("NC") == "C"
@test inferelement("NH") == "N"
@test inferelement("X") == "-"
atom_one = Atom("CA", "ALA", 'A', 20, [0.0, 0.0, 0.0], "C")
atom_two = Atom("CA", "XXX", 'A', 20, [0.0, 0.0, 0.0], "C")
... | [
2,
30307,
329,
23235,
13,
20362,
628,
198,
31,
9288,
2617,
366,
2953,
3150,
1,
2221,
198,
220,
220,
220,
2488,
9288,
1167,
567,
1732,
7203,
8141,
4943,
6624,
366,
34,
1,
198,
220,
220,
220,
2488,
9288,
1167,
567,
1732,
7203,
7792,
... | 1.86001 | 1,993 |
# file = "clusterIds_temporal-(perc_50%,1980-2015).tif"
# x = GeoArrays.read(file);
function gdal_polygonize(raster_file, band = 1, out_file = "out.shp";
fieldname = "grid", nodata = NaN)
layername = "out"
ds_raster = GDAL.gdalopen(raster_file, GDAL.GA_ReadOnly)
band = GDAL.gdalgetrasterband(ds_raster... | [
2,
2393,
796,
366,
565,
5819,
7390,
82,
62,
11498,
35738,
30420,
525,
66,
62,
1120,
7441,
23664,
12,
4626,
737,
49929,
1,
198,
2,
2124,
796,
32960,
3163,
20477,
13,
961,
7,
7753,
1776,
198,
8818,
308,
31748,
62,
35428,
14520,
1096,
... | 2.103093 | 582 |
<filename>src/mpi.jl<gh_stars>100-1000
import .MPI
function timestamp()
x = now()
lpad("$(Hour(x).value)", 2) * ':' * lpad("$(Minute(x).value)", 2)
end
# Modified from the examples in the MPI.jl docs
# https://juliaparallel.github.io/MPI.jl/latest/examples/05-job_schedule/
"""
mpi_queue(function, data::Ve... | [
27,
34345,
29,
10677,
14,
3149,
72,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
11748,
764,
7378,
40,
198,
198,
8818,
41033,
3419,
198,
220,
220,
220,
2124,
796,
783,
3419,
198,
220,
220,
220,
300,
15636,
7203,
3,
7,
... | 1.929881 | 2,781 |
function equals(obj::SimplexTableau, arg0::Object)
return jcall(obj, "equals", jboolean, (Object,), arg0)
end
function hash_code(obj::SimplexTableau)
return jcall(obj, "hashCode", jint, ())
end
function normalize_constraints(obj::SimplexTableau, arg0::Collection)
return jcall(obj, "normalizeConstraints", ... | [
8818,
21767,
7,
26801,
3712,
8890,
11141,
10962,
559,
11,
1822,
15,
3712,
10267,
8,
198,
220,
220,
220,
1441,
474,
13345,
7,
26801,
11,
366,
4853,
874,
1600,
474,
2127,
21052,
11,
357,
10267,
11,
828,
1822,
15,
8,
198,
437,
198,
1... | 2.771654 | 127 |
"""
References:
https://dl.acm.org/doi/10.1145/3178126.3178133
"""
struct XFZ18{N, ST} <: AbstractContinuousPost
#
end
numtype(::XFZ18{N}) where {N} = N
| [
37811,
198,
19927,
25,
198,
198,
5450,
1378,
25404,
13,
330,
76,
13,
2398,
14,
34023,
14,
940,
13,
1157,
2231,
14,
18,
23188,
19420,
13,
18,
23188,
16945,
198,
37811,
198,
7249,
1395,
37,
57,
1507,
90,
45,
11,
3563,
92,
1279,
25,
... | 2.152778 | 72 |
<reponame>porterjamesj/julia<filename>test/git.jl
import Base.Git
include("gitutils.jl")
dir = string("tmp.",randstring())
@test !ispath(dir)
mkdir(dir)
@test isdir(dir)
try cd(dir) do
run(`git init -q`)
run(`git commit -q --allow-empty -m "initial empty commit"`)
git_verify(Dict(), Dict(), Dict())
#... | [
27,
7856,
261,
480,
29,
26634,
73,
1047,
73,
14,
73,
43640,
27,
34345,
29,
9288,
14,
18300,
13,
20362,
198,
11748,
7308,
13,
38,
270,
198,
17256,
7203,
18300,
26791,
13,
20362,
4943,
198,
198,
15908,
796,
4731,
7203,
22065,
33283,
2... | 2.437923 | 443 |
# This file was generated, do not modify it. # hide
tree = machine(DecisionTreeRegressor(), X, y)
e = evaluate!(tree, resampling=Holdout(fraction_train=0.8),
measure=[rms, rmslp1])
e |> pprint # use PrettyPrinting | [
2,
770,
2393,
373,
7560,
11,
466,
407,
13096,
340,
13,
1303,
7808,
198,
21048,
796,
4572,
7,
10707,
1166,
27660,
8081,
44292,
22784,
1395,
11,
331,
8,
198,
68,
796,
13446,
0,
7,
21048,
11,
581,
321,
11347,
28,
26807,
448,
7,
69,
... | 2.609195 | 87 |
using Test
using QBase
@testset "./src/evolve.jl" begin
@testset "*(unitary, ket)" begin
ket = Ket([1.,0], atol=1e-6)
evo_ket = σx*ket
@test evo_ket isa Ket{Float64}
@test evo_ket == [0,1]
@test evo_ket.atol == 1e-6
evo_ket2 = σz*σy*Ket([1,0])
@test evo_ket2 isa Ket{Complex{Int64}}
@t... | [
3500,
6208,
198,
3500,
1195,
14881,
198,
198,
31,
9288,
2617,
366,
19571,
10677,
14,
1990,
6442,
13,
20362,
1,
2221,
198,
198,
31,
9288,
2617,
366,
9,
7,
403,
9331,
11,
22354,
16725,
2221,
198,
220,
220,
220,
22354,
796,
43092,
2693... | 1.85221 | 724 |
export Mixture, sample_mixture, log_pdf_mixture
struct Mixture
"Number of Gaussian kernels"
Nψ::Int64
"Dimension of the state"
Nx::Int64
"Array of Nψ dimensions"
dist::Array{MvNormal,1}
"Vector of weights for each mode"
w::Array{Float64,1}
end
function Mixture(Nx::Int64)
@as... | [
198,
39344,
337,
9602,
11,
6291,
62,
76,
9602,
11,
2604,
62,
12315,
62,
76,
9602,
628,
198,
7249,
337,
9602,
198,
220,
220,
220,
366,
15057,
286,
12822,
31562,
50207,
1,
198,
220,
220,
220,
399,
139,
230,
3712,
5317,
2414,
628,
22... | 2.091052 | 637 |
<reponame>JuliaPlots/GRMakie.jl<filename>src/utils.jl
function project_position(scene, point, model)
p4d = to_ndim(Vec4f0, to_ndim(Vec3f0, point, 0f0), 1f0)
clip = scene.camera.projectionview[] * model * p4d
p = (clip / clip[4])[Vec(1, 2)]
p = collect((p .+ 1) ./ 2)
w, h = scene.camera.resolution[]
... | [
27,
7856,
261,
480,
29,
16980,
544,
3646,
1747,
14,
10761,
44,
461,
494,
13,
20362,
27,
34345,
29,
10677,
14,
26791,
13,
20362,
198,
8818,
1628,
62,
9150,
7,
29734,
11,
966,
11,
2746,
8,
198,
220,
220,
220,
279,
19,
67,
796,
284... | 2.226115 | 1,884 |
<reponame>hanbo1735/Multigrid.jl
export solveMG,solveGMRES_MG,solveBiCGSTAB_MG,solveCG_MG,getAfun
function solveMG(param::MGparam,b::ArrayTypes,x::ArrayTypes,verbose::Bool)
param = adjustMemoryForNumRHS(param,eltype(b),size(b,2));
tol = param.relativeTol;
numCores = param.numCores;
const oneType = one(eltype(b));
cons... | [
27,
7856,
261,
480,
29,
7637,
2127,
1558,
2327,
14,
15205,
3692,
312,
13,
20362,
198,
39344,
8494,
20474,
11,
82,
6442,
38,
13599,
1546,
62,
20474,
11,
82,
6442,
23286,
39816,
2257,
6242,
62,
20474,
11,
82,
6442,
39816,
62,
20474,
1... | 2.415268 | 2,384 |
<filename>src/TurbulenceClosures/turbulence_closure_implementations/CATKEVerticalDiffusivities/turbulent_kinetic_energy_equation.jl
#####
##### Terms in the turbulent kinetic energy equation, all at cell centers
#####
@inline ϕ²(i, j, k, grid, ϕ) = ϕ(i, j, k, grid)^2
@inline function shear_production(i, j, k, grid, c... | [
27,
34345,
29,
10677,
14,
51,
5945,
32401,
2601,
16091,
14,
83,
5945,
32401,
62,
17966,
62,
320,
26908,
602,
14,
34,
1404,
7336,
42369,
605,
28813,
385,
28720,
14,
83,
5945,
15288,
62,
5116,
5139,
62,
22554,
62,
4853,
341,
13,
20362... | 1.930626 | 591 |
<reponame>JuliaGaussianProcesses/Stheno.jl<gh_stars>10-100
# # Time-Varying Bayesian Linear Regression
using AbstractGPs
using ColorTypes
using FixedPointNumbers
using Plots
using Random
using Stheno
# ## Define and inspect our model
#=
g1 and g2 are time-varying basis functions. In a real application, these might b... | [
27,
7856,
261,
480,
29,
16980,
544,
35389,
31562,
18709,
274,
14,
1273,
831,
78,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
1303,
3862,
12,
53,
560,
278,
4696,
35610,
44800,
3310,
2234,
198,
198,
3500,
27741,
38,
12... | 2.212838 | 1,184 |
# Individual
const Individual = Union{AbstractArray, Function, Nothing}
# Optimizer
"""
Abstract evolutionary optimizer algorithm
"""
abstract type AbstractOptimizer end
function print_header(method::AbstractOptimizer)
println("Iter Function value")
end
population_size(method::AbstractOptimizer) = error("`po... | [
2,
18629,
198,
9979,
18629,
796,
4479,
90,
23839,
19182,
11,
15553,
11,
10528,
92,
628,
198,
2,
30011,
7509,
198,
37811,
198,
23839,
16673,
6436,
7509,
11862,
198,
37811,
198,
397,
8709,
2099,
27741,
27871,
320,
7509,
886,
198,
198,
8... | 2.995966 | 2,231 |
<gh_stars>0
module GameZero
using Colors
using Random
export Actor, Game, game, draw, schduler, schedule_once, schedule_interval, schedule_unique, unschedule,
collide, angle, distance, play_music, play_sound, line, clear, rungame
export Keys, MouseButtons, KeyMods
export Line, Rect, Circle
using SimpleDirectM... | [
27,
456,
62,
30783,
29,
15,
198,
21412,
3776,
28667,
198,
3500,
29792,
198,
3500,
14534,
198,
198,
39344,
27274,
11,
3776,
11,
983,
11,
3197,
11,
5513,
67,
18173,
11,
7269,
62,
27078,
11,
7269,
62,
3849,
2100,
11,
7269,
62,
34642,
... | 2.268634 | 3,931 |
# script for arbitrary computation of EE value
"""
computevalue(session::EESession, value::EE.AbstractEEObject)
Fuction to request data from any arbitrary EarthEngine computation and return as
the appropriate Julia object.
See https://developers.google.com/earth-engine/reference/rest/v1beta/projects.value/compute... | [
2,
4226,
329,
14977,
29964,
286,
27254,
1988,
198,
198,
37811,
198,
220,
220,
220,
24061,
8367,
7,
29891,
3712,
36,
1546,
2521,
11,
1988,
3712,
6500,
13,
23839,
36,
4720,
65,
752,
8,
198,
198,
37,
8110,
284,
2581,
1366,
422,
597,
... | 3.333333 | 192 |
<reponame>andrewrosemberg/PowerSystems.jl
#=
This file is auto-generated. Do not edit.
=#
"""
mutable struct StaticReserveNonSpinning <: ReserveNonSpinning
name::String
available::Bool
time_frame::Float64
requirement::Float64
ext::Dict{String, Any}
operation_cost::Uni... | [
27,
7856,
261,
480,
29,
392,
1809,
13698,
47369,
14,
13434,
11964,
82,
13,
20362,
198,
2,
28,
198,
1212,
2393,
318,
8295,
12,
27568,
13,
2141,
407,
4370,
13,
198,
46249,
198,
37811,
198,
220,
220,
220,
4517,
540,
2878,
36125,
4965,
... | 2.998476 | 1,312 |
<gh_stars>1-10
#####
##### Dipole kernel
#####
"""
dipole_kernel(sz, vsz; kwargs...) =
dipole_kernel(Float64, sz, vsz; kwargs...)
dipole_kernel(
::Type{T<:AbstractFloat},
sz::NTuple{3, Integer},
vsz::NTuple{3, Real};
bdir::NTuple{3, Real} = (0, 0, 1),
method::Sy... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
4242,
2,
198,
4242,
2,
43945,
2305,
9720,
198,
4242,
2,
198,
198,
37811,
198,
220,
220,
220,
19550,
2305,
62,
33885,
7,
82,
89,
11,
3691,
89,
26,
479,
86,
22046,
23029,
796,
198,
220,
... | 1.897729 | 8,497 |
using Test
using MPI
using ClimateMachine
using ClimateMachine.MPIStateArrays
using ClimateMachine.Mesh.BrickMesh
using Pkg
using KernelAbstractions
ClimateMachine.init()
const ArrayType = ClimateMachine.array_type()
const comm = MPI.COMM_WORLD
function main()
crank = MPI.Comm_rank(comm)
csize = MPI.Comm_si... | [
3500,
6208,
198,
3500,
4904,
40,
198,
3500,
13963,
37573,
198,
3500,
13963,
37573,
13,
7378,
40,
9012,
3163,
20477,
198,
3500,
13963,
37573,
13,
37031,
13,
33,
5557,
37031,
198,
3500,
350,
10025,
198,
3500,
32169,
23839,
507,
198,
198,
... | 1.742135 | 1,939 |
<reponame>mikiec84/SemanticModels.jl
module Dubstep
using Cassette
using LinearAlgebra
export construct, TracedRun, trace, TraceCtx, LPCtx, replacenorm,
GraftCtx, replacefunc
function construct(T::Type, args...)
@info "constructing a model $T"
return T(args...)
end
Cassette.@context TraceCtx
""" Trac... | [
27,
7856,
261,
480,
29,
76,
1134,
494,
66,
5705,
14,
13900,
5109,
5841,
1424,
13,
20362,
198,
21412,
10322,
9662,
198,
198,
3500,
14154,
5857,
198,
3500,
44800,
2348,
29230,
198,
39344,
5678,
11,
833,
2286,
10987,
11,
12854,
11,
34912... | 2.559359 | 2,746 |
for N in [Float64, Rational{Int}, Float32]
# π/2 trigonometric rotation
b = BallInf(N[1, 2], N(1))
M = N[0 -1 ; 1 0]
# Test Construction
lm1 = LinearMap(M, b)
@test lm1.M == M
@test lm1.X == b
# Test Dimension
@test dim(lm1) == 2
# Test Support Vector
d = N[1, 1]
@test σ(... | [
1640,
399,
287,
685,
43879,
2414,
11,
46863,
90,
5317,
5512,
48436,
2624,
60,
198,
220,
220,
220,
1303,
18074,
222,
14,
17,
5192,
261,
16996,
13179,
198,
220,
220,
220,
275,
796,
6932,
18943,
7,
45,
58,
16,
11,
362,
4357,
399,
7,
... | 1.865067 | 2,001 |
module HydraulicFracturing
include("extra_file.jl")
end
| [
21412,
31613,
28575,
37,
974,
870,
198,
198,
17256,
7203,
26086,
62,
7753,
13,
20362,
4943,
198,
198,
437,
198
] | 2.9 | 20 |
<filename>lecture_notebooks/week2/seam_carving_live.jl<gh_stars>0
function find_energy(img)
energy_x = imfilter(brightness.(img), Kernel.sobel()[2])
energy_y = imfilter(brightness.(img), Kernel.sobel()[1])
return sqrt.(energy_x.^2 + energy_y.^2)
end
function find_energy_map(energy)
sz = size(energy)... | [
27,
34345,
29,
801,
495,
62,
11295,
12106,
14,
10464,
17,
14,
325,
321,
62,
7718,
1075,
62,
12583,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
8818,
1064,
62,
22554,
7,
9600,
8,
628,
220,
220,
220,
2568,
62,
87,
796,
545,
24455,... | 2.199382 | 647 |
<filename>src/decks/pulsed.jl
function Pulsed(; kwargs...)
cur_dict = Dict{Symbol, AbstractFloat}(
:N_G => 0.85,
:kappa => 1.8,
:epsilon => 0.25,
:beta_N => 0.026,
:Q => 26,
:f_D => 0.85,
:tau_P => 1.5,
:sigma_max => 650e6,
:B_max => 23,
:sigma_max_hat => 500e6,
:B_max_hat ... | [
27,
34345,
29,
10677,
14,
12501,
591,
14,
79,
5753,
276,
13,
20362,
198,
8818,
350,
5753,
276,
7,
26,
479,
86,
22046,
23029,
198,
220,
1090,
62,
11600,
796,
360,
713,
90,
13940,
23650,
11,
27741,
43879,
92,
7,
198,
220,
220,
220,
... | 1.758007 | 281 |
# ------------------------------------------------------------------
# Licensed under the ISC License. See LICENSE in the project root.
# ------------------------------------------------------------------
"""
EmpiricalVariogram(X, z₁, z₂=z₁; [optional parameters])
Computes the empirical (a.k.a. experimental) omni... | [
2,
16529,
438,
198,
2,
49962,
739,
262,
3180,
34,
13789,
13,
4091,
38559,
24290,
287,
262,
1628,
6808,
13,
198,
2,
16529,
438,
198,
198,
37811,
198,
220,
220,
220,
2295,
4063,
605,
23907,
21857,
7,
55,
11,
1976,
158,
224,
223,
11,... | 2.290309 | 2,456 |
<filename>test/ece.jl
@testset "ece.jl" begin
@testset "Trivial tests" begin
ece = ECE(UniformBinning(10))
# categorical distributions
for predictions in ([[0, 1], [1, 0]], ColVecs([0 1; 1 0]), RowVecs([0 1; 1 0]))
@test iszero(@inferred(ece(predictions, [2, 1])))
end
... | [
27,
34345,
29,
9288,
14,
68,
344,
13,
20362,
198,
31,
9288,
2617,
366,
68,
344,
13,
20362,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
14824,
85,
498,
5254,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
304,
344,
796,... | 1.940691 | 1,332 |
#=move.jl - Updates the game file with a move, accepts 1 command line argument,<filename> => database
=#
include("square.jl")
include("dParse.jl")
module move_cheat
using ST
using dParse
using SQLite
#=----Parses the database and determines where pieces are on the board----=#
#= ---- Opens the Database f... | [
2,
28,
21084,
13,
20362,
532,
28090,
262,
983,
2393,
351,
257,
1445,
11,
18178,
352,
3141,
1627,
4578,
11,
27,
34345,
29,
5218,
6831,
198,
46249,
198,
17256,
7203,
23415,
13,
20362,
4943,
198,
220,
2291,
7203,
67,
10044,
325,
13,
20... | 2.750601 | 1,247 |
mutable struct six_axis_force_torque_array_t <: LCMType
utime::Int64
num_sensors::Int32
names::Vector{String}
sensors::Vector{six_axis_force_torque_t}
end
@lcmtypesetup(six_axis_force_torque_array_t,
names => (num_sensors,),
sensors => (num_sensors,)
)
| [
76,
18187,
2878,
2237,
62,
22704,
62,
3174,
62,
13165,
4188,
62,
18747,
62,
83,
1279,
25,
22228,
44,
6030,
198,
220,
220,
220,
3384,
524,
3712,
5317,
2414,
198,
220,
220,
220,
997,
62,
82,
641,
669,
3712,
5317,
2624,
198,
220,
220... | 2.241935 | 124 |
<reponame>charlyalizadeh/OPFdecgen
using LightGraphs
using Test
include("../../src/utils/maximalcliques.jl")
@testset "utils/maximalcliques" begin
@testset "refine/refine_set" begin
settest = [1, 2, 3, 4]
@test refine(settest, 1) == [[1], [2, 3, 4]]
@test refine(settest, 4) == [[4], [1, 2,... | [
27,
7856,
261,
480,
29,
10641,
306,
282,
528,
671,
71,
14,
3185,
37,
12501,
5235,
198,
3500,
4401,
37065,
82,
198,
3500,
6208,
198,
198,
17256,
7203,
40720,
40720,
10677,
14,
26791,
14,
9806,
4402,
565,
6368,
13,
20362,
4943,
198,
1... | 1.958245 | 1,892 |
<reponame>mfherbst/JAC.jl
"""
`module JAC.PhotoIonizationAutoion`
... a submodel of JAC that contains all methods for computing photo-excitation-autoionization cross sections and rates.
"""
module PhotoIonizationAutoion
using ..AutoIonization, ..Basics, ..ManyElectron, ..Radial, ..PhotoEmission, ..TableSt... | [
27,
7856,
261,
480,
29,
76,
69,
372,
65,
301,
14,
41,
2246,
13,
20362,
198,
198,
37811,
198,
63,
21412,
220,
449,
2246,
13,
6191,
40,
261,
1634,
27722,
295,
63,
220,
220,
198,
220,
220,
220,
2644,
257,
850,
19849,
286,
449,
2246... | 2.326245 | 3,292 |
<filename>src/group/tables.jl
struct Data{T}
table::T
end
struct Style
args::Tuple
kwargs::NamedTuple
Style(args...; kwargs...) = new(args, values(kwargs))
end
to_style(s::Style) = s
to_style(x) = Style(x)
Base.merge(s1::Style, s2::Style) = Style(s1.args..., s2.args...; merge(s1.kwargs, s2.kwargs)...... | [
27,
34345,
29,
10677,
14,
8094,
14,
83,
2977,
13,
20362,
198,
7249,
6060,
90,
51,
92,
198,
220,
220,
220,
3084,
3712,
51,
198,
437,
198,
198,
7249,
17738,
198,
220,
220,
220,
26498,
3712,
51,
29291,
198,
220,
220,
220,
479,
86,
... | 2.306751 | 2,533 |
<reponame>SuReLI/RL-STDP
# %% imports
include("create_mat.jl")
include("clusterize_mat.jl")
include("hclustrecipe.jl")
# %% code to classify and visualize the clusters
# Load the data
dic = load("Julia/MatrixCluster/mc.jld")
mc = dic["mc"]
# run a param research select most appropriate one manually
# (best compromi... | [
27,
7856,
261,
480,
29,
5606,
3041,
31271,
14,
7836,
12,
2257,
6322,
198,
2,
43313,
17944,
198,
198,
17256,
7203,
17953,
62,
6759,
13,
20362,
4943,
198,
17256,
7203,
565,
5819,
1096,
62,
6759,
13,
20362,
4943,
198,
17256,
7203,
71,
... | 2.498812 | 421 |
using ESWA_Project
using Test
@testset "ESWA_Project.jl" begin
end
| [
3500,
13380,
15543,
62,
16775,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
1546,
15543,
62,
16775,
13,
20362,
1,
2221,
198,
437,
198
] | 2.72 | 25 |
import FastTransforms
import QuadratureRules: chebyshev_points, shift_nodes
@testset "$(rpad("Gauß-Chebyshev",80))" begin
for s in 2:10
@test GaussChebyshevQuadrature(s) == ChebyshevQuadrature(s, 1)
@test GaussChebyshevQuadrature(s) == ChebyshevQuadrature(Float64, s, Val(1))
@test... | [
11748,
12549,
8291,
23914,
198,
11748,
20648,
81,
1300,
37766,
25,
1125,
48209,
258,
85,
62,
13033,
11,
6482,
62,
77,
4147,
198,
198,
31,
9288,
2617,
17971,
7,
81,
15636,
7203,
38,
559,
39683,
12,
7376,
48209,
258,
85,
1600,
1795,
4... | 2.137324 | 284 |
@compile reference_dummy """
__global__ void reference_dummy()
{
}
"""
@target ptx function kernel_dummy()
return nothing
end
| [
31,
5589,
576,
4941,
62,
67,
13513,
37227,
198,
834,
20541,
834,
7951,
4941,
62,
67,
13513,
3419,
198,
90,
198,
92,
198,
37811,
198,
198,
31,
16793,
279,
17602,
2163,
9720,
62,
67,
13513,
3419,
198,
220,
220,
220,
1441,
2147,
198,
... | 2.911111 | 45 |
module Issue722
using Test
using Gridap
using Gridap.Fields
using Gridap.CellData
model = simplexify(CartesianDiscreteModel((0,1,0,1),(2,2)))
Ω=Triangulation(model)
Ωo=Gridap.Geometry.TriangulationView(Ω,[1,2,3])
glue = get_glue(Ωo,Val(2))
@test glue.tface_to_mface == [1, 2, 3]
@test glue.mface_to_tface == [1, 2, 3, ... | [
21412,
18232,
22,
1828,
198,
198,
3500,
6208,
198,
3500,
24846,
499,
198,
3500,
24846,
499,
13,
15878,
82,
198,
3500,
24846,
499,
13,
28780,
6601,
198,
198,
19849,
796,
2829,
87,
1958,
7,
43476,
35610,
15642,
8374,
17633,
19510,
15,
1... | 2.139738 | 229 |
<reponame>JuliaPackageMirrors/NullableArrays.jl
Base.isnull(X::NullableArray, I::Int...) = X.isnull[I...]
Base.values(X::NullableArray, I::Int...) = X.values[I...]
@doc """
`size(X::NullableArray, [d::Real])`
Return a tuple containing the lengths of each dimension of `X`, or if `d` is
specific, the length of `X` alon... | [
27,
7856,
261,
480,
29,
16980,
544,
27813,
27453,
5965,
14,
35067,
540,
3163,
20477,
13,
20362,
198,
14881,
13,
271,
8423,
7,
55,
3712,
35067,
540,
19182,
11,
314,
3712,
5317,
23029,
796,
1395,
13,
271,
8423,
58,
40,
22345,
198,
148... | 2.416218 | 3,897 |
<reponame>lucasondel/MarkovModels.jl
# SPDX-License-Identifier: MIT
"""
struct ProbabilitySemifield{T<:AbstractFloat} <: Semfield
val::T
end
Log-semifield is defined as :
* ``x \\oplus y \\triangleq x + y``
* ``x \\otimes y \\triangleq x \\cdot y``
* ``x \\oslash y \\triangleq \\frac{x}{y}``
``\... | [
27,
7856,
261,
480,
29,
75,
1229,
292,
623,
417,
14,
9704,
709,
5841,
1424,
13,
20362,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
37811,
198,
220,
220,
220,
2878,
30873,
1799,
13900,
361,
1164,
90,
51,
27,... | 2.321063 | 489 |
<reponame>anupam-mitra/ITensors.jl<gh_stars>100-1000
using ITensors, Test
@testset "diagITensor (DiagBlockSparse)" begin
@testset "diagITensor get and set elements" begin
i = Index(QN(0) => 2, QN(1) => 3; tags="i")
D = diagITensor(QN(), i, dag(i'))
for b in eachnzblock(D)
@test flux(D, b) == QN()... | [
27,
7856,
261,
480,
29,
272,
929,
321,
12,
2781,
430,
14,
2043,
641,
669,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
3500,
7283,
641,
669,
11,
6208,
198,
198,
31,
9288,
2617,
366,
10989,
363,
2043,
22854,
357,
18683,... | 1.929791 | 1,581 |
<filename>test/factor_nodes/test_transition_mixture.jl<gh_stars>100-1000
module TransitionMixtureTest
using Test
using ForneyLab
using ForneyLab: outboundType, isApplicable
using ForneyLab: SPTransitionMixtureOutNCCPX, SPTransitionMixtureIn1CNCPX, SPTransitionMixtureZCCNPX, SVBTransitionMixtureOutNCCDX, SVBTransitionM... | [
27,
34345,
29,
9288,
14,
31412,
62,
77,
4147,
14,
9288,
62,
7645,
653,
62,
76,
9602,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
21412,
40658,
44,
9602,
14402,
198,
198,
3500,
6208,
198,
3500,
1114,
1681,
17822,
198,
... | 2.644324 | 2,775 |
module AVFormat
include(joinpath(dirname(@__FILE__),"..","..","..","init.jl"))
w(f) = joinpath(avformat_dir, f)
using ..AVUtil
using ..AVCodecs
include(w("LIBAVFORMAT.jl"))
end
| [
21412,
14661,
26227,
198,
220,
2291,
7,
22179,
6978,
7,
15908,
3672,
7,
31,
834,
25664,
834,
27267,
492,
2430,
492,
2430,
492,
2430,
15003,
13,
20362,
48774,
198,
220,
266,
7,
69,
8,
796,
4654,
6978,
7,
615,
18982,
62,
15908,
11,
... | 2.454545 | 77 |
#-------------------------------------------------------------------
#* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
#*
#* This LIBRARY is free software; you can distribute it and/or modify
#* it under the therms of the ALSOC FREE LICENSE as available at
#* http://www.enq.ufrgs.br/alsoc.
#*
#* EMSO Copyrig... | [
2,
10097,
6329,
198,
2,
9,
41363,
46,
9104,
10074,
357,
3620,
43,
8,
15069,
357,
34,
8,
5472,
532,
4343,
27249,
4503,
13,
198,
2,
9,
198,
2,
9,
770,
45651,
49,
13153,
318,
1479,
3788,
26,
345,
460,
14983,
340,
290,
14,
273,
13... | 2.3032 | 1,781 |
const OBJTYPE_TO_SIZENAME = Dict(
MJCore.mjOBJ_BODY => :nbody,
MJCore.mjOBJ_JOINT => :njnt,
MJCore.mjOBJ_GEOM => :ngeom,
MJCore.mjOBJ_SITE => :nsite,
MJCore.mjOBJ_CAMERA => :ncam,
MJCore.mjOBJ_LIGHT => :nlight,
MJCore.mjOBJ_MESH => :nmesh,
MJCore.mjOBJ_SKIN => :nskin,
MJCore.mjOBJ_HF... | [
9979,
25334,
41,
25216,
62,
10468,
62,
11584,
57,
1677,
10067,
796,
360,
713,
7,
198,
220,
220,
220,
33974,
14055,
13,
76,
73,
9864,
41,
62,
33,
33076,
5218,
1058,
77,
2618,
11,
198,
220,
220,
220,
33974,
14055,
13,
76,
73,
9864,
... | 2.004131 | 4,115 |
# Convert a string to a decimal, e.g. "0.01" -> Decimal(0, 1, -2)
function decimal(str::AbstractString)
if 'e' in str
return decimal(scinote(str))
end
c, q = parameters(('.' in str) ? split(str, '.') : str)
norm(Decimal((str[1] == '-') ? 1 : 0, c, q))
end
# Convert a number to a decimal
decimal... | [
2,
38240,
257,
4731,
284,
257,
32465,
11,
304,
13,
70,
13,
366,
15,
13,
486,
1,
4613,
4280,
4402,
7,
15,
11,
352,
11,
532,
17,
8,
198,
8818,
32465,
7,
2536,
3712,
23839,
10100,
8,
198,
220,
220,
220,
611,
705,
68,
6,
287,
96... | 2.244618 | 1,022 |
<reponame>JuliaTagBot/InplaceArrays.jl<filename>bench/runbenchs.jl
module Benchs
include("ArraysBenchs/runbenchs.jl")
include("FieldsBenchs/runbenchs.jl")
include("PolynomialsBenchs/runbenchs.jl")
end # module
| [
27,
7856,
261,
480,
29,
16980,
544,
24835,
20630,
14,
818,
5372,
3163,
20477,
13,
20362,
27,
34345,
29,
26968,
14,
5143,
26968,
82,
13,
20362,
198,
21412,
25187,
82,
198,
198,
17256,
7203,
3163,
20477,
44199,
82,
14,
5143,
26968,
82,
... | 2.609756 | 82 |
<gh_stars>1-10
x = 3
x = x+1
println("hi") | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
87,
796,
513,
198,
87,
796,
2124,
10,
16,
198,
35235,
7203,
5303,
4943
] | 1.826087 | 23 |
using Gadfly
n = 10
plot(x=rand(n), y=rand(n), color=sqrt(rand(n)), Scale.color_sqrt)
| [
3500,
20925,
12254,
198,
198,
77,
796,
838,
198,
29487,
7,
87,
28,
25192,
7,
77,
828,
331,
28,
25192,
7,
77,
828,
3124,
28,
31166,
17034,
7,
25192,
7,
77,
36911,
21589,
13,
8043,
62,
31166,
17034,
8,
198
] | 2.175 | 40 |
import MNIST
using Colors
using Images
using ImageView
"""
mnist_img(row)
Obtain the row of the MNIST data matrix as image.
"""
function mnist_img(row)
img = Images.grayim(convert( Images.Image{Gray}, reshape(row, (28,28)) ))
img["spatialorder"] = ["y", "x"]
return img
end
"""
mnist_vi... | [
11748,
29060,
8808,
198,
198,
3500,
29792,
198,
3500,
5382,
198,
3500,
7412,
7680,
628,
198,
37811,
198,
220,
220,
220,
285,
77,
396,
62,
9600,
7,
808,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1835,
3153,
262,
5752,
286,
26... | 1.830415 | 1,085 |
struct AType
other_obj::SType
end
| [
7249,
5161,
2981,
198,
220,
584,
62,
26801,
3712,
2257,
2981,
198,
437,
198
] | 2.571429 | 14 |
module DotEnv
# I have an issue with original DotEnv, so this have to be used instead.
import Base: getindex, get, isempty
struct EnvProxyDict
dict::Dict{String, String}
end
getindex(ed::EnvProxyDict, key) = get(ed.dict, key, ENV[key])
get(ed::EnvProxyDict, key, default) = get(ed.dict, key, get(ENV, key, defaul... | [
21412,
22875,
4834,
85,
198,
198,
2,
314,
423,
281,
2071,
351,
2656,
22875,
4834,
85,
11,
523,
428,
423,
284,
307,
973,
2427,
13,
198,
198,
11748,
7308,
25,
651,
9630,
11,
651,
11,
318,
28920,
198,
198,
7249,
2039,
85,
44148,
35,
... | 2.314154 | 869 |
<filename>src/visualization/visualize.jl
###################################################
## visualize.jl
## visualize network (made to be extended)
###################################################
"""
`NetworkVisualizer` : abstract type that represents visualization in a network
has to implement ands in... | [
27,
34345,
29,
10677,
14,
41464,
1634,
14,
41464,
1096,
13,
20362,
198,
29113,
14468,
21017,
198,
2235,
38350,
13,
20362,
198,
2235,
38350,
3127,
357,
9727,
284,
307,
7083,
8,
198,
29113,
14468,
21017,
198,
198,
37811,
198,
220,
220,
... | 2.288082 | 3,138 |
# =========================================================================== #
# =========================================================================== #
#Implementing an x0 viable solution huristic with a gluton method
#receiving an array of lenght()=m , a matrix of size m*n and thoose size
#returing a Bool ... | [
198,
2,
38093,
2559,
855,
1303,
198,
198,
2,
38093,
2559,
855,
1303,
628,
198,
2,
3546,
26908,
278,
281,
2124,
15,
13971,
4610,
6990,
2569,
351,
257,
25276,
261,
2446,
198,
2,
260,
344,
1412,
281,
7177,
286,
18896,
456,
83,
3419,
... | 2.195316 | 2,391 |
# implementation of the StandardLinearSolver
# This is the interface algorithms should use for doing linear solves
"""
Calculates the preconditioner for the linear solver. Thsi preconditioner
will be used for all linear solves until this function is called again.
For direct solvers, this function calculates th... | [
2,
7822,
286,
262,
8997,
14993,
451,
50,
14375,
198,
2,
770,
318,
262,
7071,
16113,
815,
779,
329,
1804,
14174,
39107,
198,
198,
37811,
198,
220,
27131,
689,
262,
3718,
623,
653,
263,
329,
262,
14174,
1540,
332,
13,
220,
536,
13396,... | 2.52658 | 5,587 |
# Test Linear System Optimizaiton
using SwitchTimeOpt
using MathOptInterface
const MOI = MathOptInterface
using Ipopt
# Define test options
objtol = 1e-04
primaltol = 1e-03
# Define Solver options
maxiter = 50
maxtime = 100.0
verbose = 0
tolerance = 1e-06
#Define solver
solver = Ipopt.Optimizer()
MOI.set(solver, MOI... | [
2,
6208,
44800,
4482,
30011,
528,
4548,
261,
198,
3500,
14645,
7575,
27871,
198,
3500,
16320,
27871,
39317,
198,
9979,
13070,
40,
796,
16320,
27871,
39317,
198,
3500,
314,
79,
8738,
198,
198,
2,
2896,
500,
1332,
3689,
198,
26801,
83,
... | 2.023364 | 1,070 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.