content stringlengths 5 1.03M | input_ids listlengths 4 823k | ratio_char_token float64 0.4 12.5 | token_count int64 4 823k |
|---|---|---|---|
# To run this script, `cd` to the `./test/fixtures` directory and then, from the Julia terminal, `include("./runner.jl")`.
import JSON
function gen( x, name )
y = Array( Any, length( x ) );
for i in eachindex(x)
y[i] = bits( convert( UInt8, x[i] ) );
end
data = Dict([
("x", x),
("expected", y)
]);
outfi... | [
2,
1675,
1057,
428,
4226,
11,
4600,
10210,
63,
284,
262,
4600,
19571,
9288,
14,
69,
25506,
63,
8619,
290,
788,
11,
422,
262,
22300,
12094,
11,
4600,
17256,
7,
1911,
14,
16737,
13,
20362,
4943,
44646,
198,
198,
11748,
19449,
198,
198... | 2.47644 | 191 |
using QuantumLab
using Test
using Dates
using LinearAlgebra
INFO(str) = @info "$(Dates.format(now(),dateformat"Y/m/d HH:MM:SS,sss")) $str"
if (!@isdefined(indent))
indent = ""
end
INFO("$(indent)READING: h2o.xyz -> h2o::Geometry ")
h2o = readGeometryXYZ("h2o.xyz")
INFO("$(indent)OBTAINING: BasisSetExchange -... | [
3500,
29082,
17822,
198,
3500,
6208,
198,
3500,
44712,
198,
3500,
44800,
2348,
29230,
198,
198,
10778,
7,
2536,
8,
796,
2488,
10951,
17971,
7,
35,
689,
13,
18982,
7,
2197,
22784,
4475,
18982,
1,
56,
14,
76,
14,
67,
47138,
25,
12038,... | 2.469274 | 716 |
using DiscgolfRecord
using Test
@testset "DiscgolfRecord.jl" begin
# Write your tests here.
# Make sure we can preview courses
@test_nowarn preview_course(COURSES["kit_carson"])
@test_nowarn preview_course(COURSES["mast_park"])
# Test the round reader
sample_round_file = "20210719_mastpark.c... | [
3500,
8444,
70,
4024,
23739,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
15642,
70,
4024,
23739,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
19430,
534,
5254,
994,
13,
628,
220,
220,
220,
1303,
6889,
1654,
356,
460,
12714,
109... | 2.635762 | 151 |
@doc doc"""
latexraw(arg)
Generate LaTeX equations from `arg`.
Parses expressions, ParameterizedFunctions, SymEngine.Base and arrays thereof.
Returns a string formatted for LaTeX.
# Examples
## using expressions
```jldoctest
expr = :(x/(y+x))
latexraw(expr)
# output
"\\frac{x}{y + x}"
```
```jldoctest
expr =... | [
31,
15390,
2205,
37811,
198,
220,
220,
220,
47038,
1831,
7,
853,
8,
198,
198,
8645,
378,
4689,
49568,
27490,
422,
4600,
853,
44646,
198,
198,
47,
945,
274,
14700,
11,
25139,
2357,
1143,
24629,
2733,
11,
15845,
13798,
13,
14881,
290,
... | 2.355277 | 1,838 |
push!(LOAD_PATH,"../source/0.6/src/")
# include package
info("Include all...")
try
include("../source/0.6/src/App.jl")
include("../source/0.6/src/ThreadManager.jl")
catch e # do not exit this run!
warn(e)
end
info("Include done.")
info("Create Docs...")
using Documenter, App
makedocs(
build = joinpath(@_... | [
14689,
0,
7,
35613,
62,
34219,
553,
40720,
10459,
14,
15,
13,
21,
14,
10677,
14,
4943,
198,
198,
2,
2291,
5301,
198,
10951,
7203,
818,
9152,
477,
9313,
8,
198,
28311,
198,
220,
2291,
7203,
40720,
10459,
14,
15,
13,
21,
14,
10677,
... | 2.09682 | 1,415 |
int_rules_6_1_10 = @theory begin
#= ::Subsection::Closed:: =#
#= 6.1.10*(c+d*x)^m*(a+b*sinh)^n =#
@apply_utils Antiderivative((~u) ^ ~(m') * (~(a') + ~(b') * sinh(~v)) ^ ~(n'), ~x) => Antiderivative(ExpandToSum(~u, ~x) ^ ~m * (~a + ~b * sinh(ExpandToSum(~v, ~x))) ^ ~n, ~x) <-- FreeQ([~a, ~b, ~m, ~n], ~x) &... | [
600,
62,
38785,
62,
21,
62,
16,
62,
940,
796,
2488,
1169,
652,
2221,
628,
220,
220,
220,
1303,
28,
7904,
7004,
5458,
3712,
2601,
1335,
3712,
796,
2,
198,
220,
220,
220,
1303,
28,
718,
13,
16,
13,
940,
9,
7,
66,
10,
67,
9,
87... | 1.840782 | 358 |
module HWunconstrained
# imports: which packages are we going to use in this module?
using Distributions, Optim, Plots, DataFrames
using Random
using Statistics
using LinearAlgebra
export maximize_like_grad, makeData
# methods/functions
# -----------------
# data creator
# should/could return a dict... | [
21412,
44884,
403,
1102,
2536,
1328,
628,
197,
2,
17944,
25,
543,
10392,
389,
356,
1016,
284,
779,
287,
428,
8265,
30,
198,
197,
3500,
46567,
507,
11,
30011,
11,
1345,
1747,
11,
6060,
35439,
198,
197,
3500,
14534,
198,
197,
3500,
14... | 1.27634 | 5,410 |
## mapreduce implementation that skips NA
function skipna_init(f, op, na::BitArray, data::Array, ifirst::Int, ilast::Int)
# Get first non-NA element
ifirst = Base.findnextnot(na, ifirst)
@inbounds d1 = data[ifirst]
# Get next non-NA element
ifirst = Base.findnextnot(na, ifirst+1)
@inbounds d2 ... | [
2235,
3975,
445,
7234,
7822,
326,
1341,
2419,
11746,
198,
198,
8818,
14267,
2616,
62,
15003,
7,
69,
11,
1034,
11,
12385,
3712,
13128,
19182,
11,
1366,
3712,
19182,
11,
611,
667,
3712,
5317,
11,
4229,
459,
3712,
5317,
8,
198,
220,
22... | 2.173627 | 3,496 |
using ModelingToolkit, OrdinaryDiffEq, Test
@parameters t α β γ δ
@variables x(t) y(t)
D = Differential(t)
eqs = [D(x) ~ α*x - β*x*y,
D(y) ~ -δ*y + γ*x*y]
sys = ODESystem(eqs)
u0 = [x => 1.0,
y => 1.0]
p = [α => 1.5,
β => 1.0,
δ => 3.0,
γ => 1.0]
tspan = (0.0,10.0)
prob = ODEProble... | [
3500,
9104,
278,
25391,
15813,
11,
14230,
3219,
28813,
36,
80,
11,
6208,
198,
198,
31,
17143,
7307,
256,
26367,
27169,
7377,
111,
7377,
112,
198,
31,
25641,
2977,
2124,
7,
83,
8,
331,
7,
83,
8,
198,
35,
796,
20615,
498,
7,
83,
8... | 1.728916 | 332 |
using Base.Test
using QuantumOptics
@testset "spin" begin
D(op1::Operator, op2::Operator) = abs(tracedistance_nh(full(op1), full(op2)))
# Test creation
@test_throws AssertionError SpinBasis(1//3)
@test_throws AssertionError SpinBasis(-1//2)
@test_throws AssertionError SpinBasis(0)
for spinnumber=[1//2, 1, 3//2, 4/... | [
3500,
7308,
13,
14402,
198,
3500,
29082,
27871,
873,
198,
198,
31,
9288,
2617,
366,
39706,
1,
2221,
198,
198,
35,
7,
404,
16,
3712,
18843,
1352,
11,
1034,
17,
3712,
18843,
1352,
8,
796,
2352,
7,
2213,
2286,
9311,
62,
77,
71,
7,
... | 2.012295 | 1,708 |
# Use baremodule to shave off a few KB from the serialized `.ji` file
baremodule Xorg_xcb_util_wm_jll
using Base
using Base: UUID
import JLLWrappers
JLLWrappers.@generate_main_file_header("Xorg_xcb_util_wm")
JLLWrappers.@generate_main_file("Xorg_xcb_util_wm", UUID("c22f9ab0-d5fe-5066-847c-f4bb1cd4e361"))
end # module... | [
2,
5765,
6247,
21412,
284,
34494,
572,
257,
1178,
14204,
422,
262,
11389,
1143,
4600,
13,
7285,
63,
2393,
198,
49382,
21412,
1395,
2398,
62,
87,
21101,
62,
22602,
62,
26377,
62,
73,
297,
198,
3500,
7308,
198,
3500,
7308,
25,
471,
27... | 2.310811 | 148 |
##### Beginning of file
@info("Importing the RemoveLFS module...")
import RemoveLFS
import TimeZones
@info("Reading config files...")
include(joinpath("config","preferences","branches.jl",))
include(joinpath("config","preferences","git-hosts.jl",))
include(joinpath("config","preferences","git-user.jl",))
include(j... | [
4242,
2,
25976,
286,
2393,
198,
198,
31,
10951,
7203,
20939,
278,
262,
17220,
43,
10652,
8265,
9313,
8,
198,
198,
11748,
17220,
43,
10652,
198,
198,
11748,
3862,
57,
1952,
198,
198,
31,
10951,
7203,
36120,
4566,
3696,
9313,
8,
198,
... | 2.178683 | 638 |
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: comprehendmedical
using AWS.Compat
using AWS.UUIDs
"""
DescribeEntitiesDetectionV2Job()
Gets the properties associated with a medical entities detection job. Use this operation to get the status of a detection job.
# Required Parame... | [
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,
24772,
41693,
198,
3500,
30865,
13,
40073,
198,
3500,
30865,
13,
52,
27586,
82,
198,
198,
3781... | 3.376741 | 6,389 |
### A Pluto.jl notebook ###
# v0.16.1
using Markdown
using InteractiveUtils
# ╔═╡ bc0083ae-2c24-11ec-27d1-d3151362feba
using VegaLite, DataFrames, CSV, RDatasets
# ╔═╡ af8af33a-f75c-4ac1-9c3e-7afa932fd4c1
md"## Plotting with VegaLite
Vegalite is a modern grammar-of-graphics programming language. See information and ... | [
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1433,
13,
16,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
2343,
243,
242,
28670,
22880,
94,
47125,
405,
5999,
3609,
12,
17,
66,
1731,
12,
... | 1.87301 | 10,804 |
"""
unitRandom3Cartesian(rng = MersenneTwister())
Returns a unit vector pointing in a random direction in Cartesian coordinates.
"""
function unitRandom3Cartesian(rng = MersenneTwister())
θ = π*rand(rng)
ϕ = 2.0*π*rand(rng)
return Vector([
cos(ϕ)*sin(θ),
sin(ϕ)*sin(θ),
cos(θ)
... | [
37811,
198,
220,
220,
220,
4326,
29531,
18,
43476,
35610,
7,
81,
782,
796,
337,
364,
29727,
5080,
1694,
28955,
198,
198,
35561,
257,
4326,
15879,
10609,
287,
257,
4738,
4571,
287,
13690,
35610,
22715,
13,
198,
37811,
198,
8818,
4326,
... | 2.134448 | 1,495 |
println("Loading packages...")
@time begin
using Cytof5
using Random, Distributions
# TODO: Get rid of this dep
using RCall
using BSON
using ArgParse
import Cytof5.Model.logger
include("util.jl")
end
println("Done loading packages.")
# TODO: review
# ARG PARSING
# Define behavior for vector numerical... | [
35235,
7203,
19031,
10392,
9313,
8,
198,
31,
2435,
2221,
198,
220,
1262,
5934,
1462,
69,
20,
198,
220,
1262,
14534,
11,
46567,
507,
198,
220,
1303,
16926,
46,
25,
3497,
5755,
286,
428,
1207,
198,
220,
1262,
13987,
439,
198,
220,
126... | 1.941131 | 2,616 |
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENCE in the project root.
# ------------------------------------------------------------------
"""
Process
A geological process of evolution.
"""
abstract type Process end
"""
evolve!(state, proc, Δt... | [
2,
16529,
438,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
38559,
18310,
287,
262,
1628,
6808,
13,
198,
2,
16529,
438,
198,
198,
37811,
198,
220,
220,
220,
10854,
198,
198,
32,
41917,
1429,
286,
6954,
13,
198,
37811,
198,
397,
... | 3.246544 | 434 |
module ConstrainedFESpacesTests
using Test
using Gridap
using Gridap.ConstrainedFESpaces: VectorOfTwoParts
D = 2
dom = fill(4,D)
model = CartesianDiscreteModel(partition=tuple(dom...))
order = 1
diritag = "boundary"
_fespace = CLagrangianFESpace(Float64,model,order,diritag)
fixeddofs = [2,5]
fespace = ConstrainedFE... | [
21412,
1482,
2536,
1328,
37,
1546,
43076,
51,
3558,
198,
198,
3500,
6208,
198,
3500,
24846,
499,
198,
3500,
24846,
499,
13,
3103,
2536,
1328,
37,
1546,
43076,
25,
20650,
5189,
7571,
42670,
198,
198,
35,
796,
362,
198,
3438,
796,
6070,... | 2.152597 | 616 |
module FESpacesTests1
using Test
@testset "ConformingFESpaces" begin include("ConformingFESpacesTests.jl") end
@testset "FESpacesInterfaces" begin include("FESpacesInterfacesTests.jl") end
@testset "SingleFieldFESpaces" begin include("SingleFieldFESpacesTests.jl") end
@testset "TrialFESpaces" begin include("TrialF... | [
21412,
376,
1546,
43076,
51,
3558,
16,
198,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
3103,
15464,
37,
1546,
43076,
1,
2221,
2291,
7203,
3103,
15464,
37,
1546,
43076,
51,
3558,
13,
20362,
4943,
886,
198,
198,
31,
9288,
2617,
3... | 2.890411 | 365 |
@testset "Testing IndexZero" begin
IndexZero = CounterTools.IndexZero
x = CounterTools.IndexZero(0)
@test CounterTools.value(x) == 0
# `Integers` should have 1 subtracted from them.
# `IndexZero`s should just pass through
y = CounterTools.indexzero(1)
z = CounterTools.indexzero(x)
@test... | [
31,
9288,
2617,
366,
44154,
12901,
28667,
1,
2221,
198,
220,
220,
220,
12901,
28667,
796,
15034,
33637,
13,
15732,
28667,
198,
220,
220,
220,
2124,
796,
15034,
33637,
13,
15732,
28667,
7,
15,
8,
198,
220,
220,
220,
2488,
9288,
15034,
... | 2.345794 | 214 |
abstract type AbstractHydroFormulation <: AbstractDeviceFormulation end
abstract type AbstractHydroDispatchFormulation <: AbstractHydroFormulation end
abstract type AbstractHydroUnitCommitment <: AbstractHydroFormulation end
struct HydroFixed <: AbstractHydroFormulation end
struct HydroDispatchRunOfRiver <: Abstrac... | [
397,
8709,
2099,
27741,
40436,
305,
8479,
1741,
1279,
25,
27741,
24728,
8479,
1741,
886,
198,
198,
397,
8709,
2099,
27741,
40436,
305,
49354,
8479,
1741,
1279,
25,
27741,
40436,
305,
8479,
1741,
886,
198,
198,
397,
8709,
2099,
27741,
40... | 1.990093 | 8,580 |
module Histogram
# simple histogram functions copied from Julia v0.4.7 to avoid having to
# pull in all of Statistics.jl
export hist, hist!
function histrange(v::AbstractArray{T}, n::Integer) where {T<:AbstractFloat}
nv = length(v)
if nv == 0 && n < 0
throw(ArgumentError("number of bins must be ≥ 0 f... | [
21412,
5590,
21857,
198,
198,
2,
2829,
1554,
21857,
5499,
18984,
422,
22300,
410,
15,
13,
19,
13,
22,
284,
3368,
1719,
284,
198,
2,
2834,
287,
477,
286,
14370,
13,
20362,
198,
198,
39344,
1554,
11,
1554,
0,
198,
198,
8818,
1554,
9... | 2.071371 | 1,233 |
using Catlab.CategoricalAlgebra, Catlab.Graphs, Catlab.Present, Catlab.Graphics, Catlab.Theories, Catlab.Present
using Catlab.CategoricalAlgebra.FinCats: FinCatGraphEq
@present ThSIR(FreeSchema) begin
(S,I,R)::Ob
end
"""This code will work for any choice of 'type graph'"""
function update_state(state::StructACSe... | [
3500,
5181,
23912,
13,
34,
2397,
12409,
2348,
29230,
11,
5181,
23912,
13,
37065,
82,
11,
5181,
23912,
13,
34695,
11,
5181,
23912,
13,
18172,
11,
5181,
23912,
13,
464,
1749,
11,
5181,
23912,
13,
34695,
198,
3500,
5181,
23912,
13,
34,
... | 2.456494 | 793 |
import Base.Cartesian.@ntuple
nparticles(p) = length(p)
nparticles(p::Type{<:AbstractParticles{T,N}}) where {T,N} = N
nparticles(p::AbstractParticles{T,N}) where {T,N} = N
nparticles(p::ParticleArray) = nparticles(eltype(p))
nparticles(p::Type{<:ParticleArray}) = nparticles(eltype(p))
particletype(p::AbstractParticle... | [
11748,
7308,
13,
43476,
35610,
13,
31,
429,
29291,
198,
198,
77,
3911,
2983,
7,
79,
8,
796,
4129,
7,
79,
8,
198,
77,
3911,
2983,
7,
79,
3712,
6030,
90,
27,
25,
23839,
7841,
2983,
90,
51,
11,
45,
11709,
8,
810,
1391,
51,
11,
... | 2.511335 | 1,985 |
using FileIO
using Images
field = [ "s3", "s8", "s14", "s15", "s20","s37", "s40"]
data_dir = "/datahub/rawdata/tandeng/mRNA_imaging/mRNA_confocal_hamamatsu-60X-TIRF/20200316";
output_dir = "$(data_dir)_visualization"
try
mkdir("$output_dir")
catch
end
function max_projection(pos)
println("Processing $pos")
... | [
198,
3500,
9220,
9399,
198,
3500,
5382,
198,
198,
3245,
796,
685,
366,
82,
18,
1600,
366,
82,
23,
1600,
366,
82,
1415,
1600,
366,
82,
1314,
1600,
366,
82,
1238,
2430,
82,
2718,
1600,
366,
82,
1821,
8973,
198,
7890,
62,
15908,
796,... | 2.074499 | 349 |
import Flatten: flattenable
@metadata initial_value nothing
import FieldMetadata: @units, units
import FieldMetadata: @limits, limits
import FieldMetadata: @prior, prior
import FieldMetadata: @description, description
@metadata bounds nothing
import FieldMetadata: @logscaled, logscaled
@metadata reference nothing
"""... | [
11748,
1610,
41769,
25,
27172,
21633,
198,
31,
38993,
4238,
62,
8367,
2147,
198,
11748,
7663,
9171,
14706,
25,
2488,
41667,
11,
4991,
198,
11748,
7663,
9171,
14706,
25,
2488,
49196,
11,
7095,
198,
11748,
7663,
9171,
14706,
25,
2488,
344... | 2.482063 | 6,300 |
using StatsBase, Plots; pyplot()
names = ["Mary","Mel","David","John","Kayley","Anderson"]
randomName() = rand(names)
X = 3:8
N = 10^6
sampleLengths = [length(randomName()) for _ in 1:N]
bar(X,counts(sampleLengths)/N, ylims=(0,0.35),
xlabel="Name length", ylabel="Estimated p(x)", legend=:none) | [
3500,
20595,
14881,
11,
1345,
1747,
26,
12972,
29487,
3419,
198,
198,
14933,
796,
14631,
24119,
2430,
21102,
2430,
11006,
2430,
7554,
2430,
37247,
1636,
2430,
42991,
8973,
198,
25120,
5376,
3419,
796,
43720,
7,
14933,
8,
198,
55,
796,
5... | 2.586207 | 116 |
int main () {
printInt(fact(7)) ;
printInt(factr(7)) ;
return 0 ;
}
// iterative factorial
int fact (int n) {
int i,r ;
i = 1 ;
r = 1 ;
while (i <= n) {
r = r * i ;
i++ ;
}
return r ;
}
// recursive factorial
int factr (int n) {
if (n < 2)
return 1 ;
else
return n * factr(n-1) ;
}
| [
600,
1388,
7499,
1391,
198,
4798,
5317,
7,
22584,
7,
22,
4008,
2162,
198,
4798,
5317,
7,
22584,
81,
7,
22,
4008,
2162,
198,
7783,
657,
2162,
198,
92,
198,
1003,
11629,
876,
1109,
5132,
198,
600,
1109,
357,
600,
299,
8,
1391,
198,
... | 2.203125 | 128 |
"""
Interval unions sets of defined by unions of disjoint intervals.
This file includes constructors, arithmetic (including intervals and scalars)
and complement functions
Empty sets and intersecting intervals are appropriately handled in the constructor:
julia> a = interval(0,2) ∪ interval(3,4)
... | [
37811,
628,
220,
220,
220,
4225,
2100,
11936,
5621,
286,
5447,
416,
11936,
286,
595,
73,
1563,
20016,
13,
198,
220,
220,
220,
770,
2393,
3407,
5678,
669,
11,
34768,
357,
8201,
20016,
290,
16578,
945,
8,
198,
220,
220,
220,
290,
1682... | 2.193883 | 1,831 |
#=
reverser.jl
based on
https://stackoverflow.com/questions/27411401/julia-reverse-n-dimensional-arrays
=#
export reverser
using Test: @test
"""
y = reverser(x, dims)
reverse array along specified dimensions (or all if unspecified)
"""
function reverser(x::AbstractArray, dims::AbstractVector{<:Int})
y = copy... | [
2,
28,
198,
260,
690,
263,
13,
20362,
198,
3106,
319,
198,
5450,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
28857,
16562,
486,
14,
73,
43640,
12,
50188,
12,
77,
12,
19577,
12,
3258,
592,
198,
46249,
198,
198,
39344,
103... | 2.402402 | 333 |
"""
# Module FortranReader
FortranReader provides basic commands to read the 'unformatted' files written
by Fortran programs.
Although not technically portable, most Fortran programs write these files in
a predictable way, in 'records'. Each record contains either one or several
variables, marked before and after wi... | [
37811,
198,
2,
19937,
6401,
2596,
33634,
198,
198,
21926,
2596,
33634,
3769,
4096,
9729,
284,
1100,
262,
705,
403,
687,
16898,
6,
3696,
3194,
198,
1525,
6401,
2596,
4056,
13,
198,
198,
7003,
407,
14497,
17726,
11,
749,
6401,
2596,
405... | 2.640122 | 1,645 |
using Test
using Logging
using Statistics
using Printf
using JLD2
using CUDA
using Oceananigans
using Oceananigans.Architectures
using JULES
Logging.global_logger(OceananigansLogger())
Archs = [CPU]
@hascuda Archs = [GPU]
CUDA.allowscalar(true)
@testset "JULES" begin
include("test_models.jl")
inc... | [
3500,
6208,
198,
3500,
5972,
2667,
198,
3500,
14370,
198,
3500,
12578,
69,
198,
3500,
449,
11163,
17,
198,
3500,
29369,
5631,
198,
198,
3500,
10692,
272,
34090,
198,
3500,
10692,
272,
34090,
13,
19895,
5712,
942,
198,
3500,
49349,
1546,... | 2.585366 | 164 |
using SearchLight, SearchLight.Migrations, SearchLight.Relationships
cd(@__DIR__)
connection_file = joinpath(@__DIR__,"mysql_connection.yml")
conn_info_postgres = SearchLight.Configuration.load(connection_file)
const conn = SearchLight.connect(conn_info_postgres)
try
SearchLight.Migrations.status()
catch _
Searc... | [
3500,
11140,
15047,
11,
11140,
15047,
13,
44,
3692,
602,
11,
11140,
15047,
13,
47117,
5748,
198,
198,
10210,
7,
31,
834,
34720,
834,
8,
198,
198,
38659,
62,
7753,
796,
4654,
6978,
7,
31,
834,
34720,
834,
553,
28744,
13976,
62,
38659... | 2.798186 | 441 |
#!/usr/bin/env julia
# Best run in the REPL until I work out how to get unicodeplots to print to stdout when in an `include`
# `env JULIA_NUM_THREADS=(nproc) julia --project`
using JustJoshing
import Plots
Plots.unicodeplots()
# This should look like Figure 5.3, page 121 in Joshi (it does)
# NB: looks like Joshi's ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
474,
43640,
198,
198,
2,
6705,
1057,
287,
262,
45285,
1566,
314,
670,
503,
703,
284,
651,
28000,
1098,
489,
1747,
284,
3601,
284,
14367,
448,
618,
287,
281,
4600,
17256,
63,
198,
2,
4600,
24330,... | 1.993871 | 979 |
__precompile__()
module PAPA
export papa_reconstruction, papa_reconstruction_debug
using LinearAlgebra, LeastSquaresOptim
greet() = print("Welcome to PAPA world!")
include("Process_Solver.jl")
include("SupportFunctions.jl")
"""
papa_reconstruction(N, Npairs, pair_order, initial_chilist, sigmaVec[, CP_penalty, ... | [
834,
3866,
5589,
576,
834,
3419,
198,
198,
21412,
350,
2969,
32,
198,
198,
39344,
20461,
64,
62,
260,
9979,
2762,
11,
20461,
64,
62,
260,
9979,
2762,
62,
24442,
198,
198,
3500,
44800,
2348,
29230,
11,
1004,
459,
22266,
3565,
27871,
... | 1.991056 | 2,348 |
# Run package tests
println("Testing Silo.jl in Julia version ", VERSION)
using Base.Test
include(joinpath("..", "src", "Silo.jl"))
# using Silo
# run(`cd $(dirname(@__FILE__))/files && make`)
include("test1dwriteInt.jl")
include("test1dreadwrite.jl")
# Silo.DBInqFile(dbfile.file_name)
| [
2,
5660,
5301,
5254,
198,
35235,
7203,
44154,
4243,
78,
13,
20362,
287,
22300,
2196,
33172,
44156,
2849,
8,
198,
198,
3500,
7308,
13,
14402,
198,
17256,
7,
22179,
6978,
7203,
492,
1600,
366,
10677,
1600,
366,
15086,
78,
13,
20362,
487... | 2.636364 | 110 |
# Modelo de turbina sem sangria
type Turbina
Turbina()=begin
PP2=outers.PP2
new(
DanaPlugin(Dict{Symbol,Any}(
:Brief=>"Steam tables"
)),
Entalpia(),
Eficiencia(Dict{Symbol,Any}(
:Brief=>"Eficiencia da turbina"
)),
Corrente(Dict{Symbol,Any}(
:Symbol=>"_{in}",
:PosX=>0,
:PosY=>0... | [
2,
9104,
78,
390,
14830,
1437,
5026,
25889,
7496,
198,
4906,
3831,
65,
1437,
198,
197,
51,
5945,
1437,
3419,
28,
27471,
198,
197,
197,
10246,
17,
28,
280,
1010,
13,
10246,
17,
198,
197,
197,
3605,
7,
198,
197,
197,
197,
35,
2271,
... | 1.850856 | 818 |
getevennumbers(arr) = filter(iseven,arr) | [
1136,
10197,
77,
17024,
7,
3258,
8,
796,
8106,
7,
786,
574,
11,
3258,
8
] | 2.666667 | 15 |
@testset "Bus Constructors" begin
tBus = Bus()
tLoadZones = LoadZones()
end
@testset "Generation Constructors" begin
tEconThermal = EconThermal()
@test tEconThermal isa PowerSystems.Component
tTechThermal = TechThermal()
@test tTechThermal isa PowerSystems.Component
tThermalGen = ThermalDis... | [
31,
9288,
2617,
366,
16286,
28407,
669,
1,
2221,
198,
220,
220,
220,
256,
16286,
796,
5869,
3419,
198,
220,
220,
220,
256,
8912,
57,
1952,
796,
8778,
57,
1952,
3419,
198,
437,
198,
198,
31,
9288,
2617,
366,
8645,
341,
28407,
669,
... | 2.755513 | 1,043 |
using Base: Int64, Float64, NamedTuple
using Printf
using Glob
# LaMEM I/O
#
# These are routines that help to create a LaMEM marker files from a ParaviewData structure, which can be used to perform geodynamic simulations
# We also include routines with which we can read LaMEM *.pvtr files into julia
export LaMEM_g... | [
3500,
7308,
25,
2558,
2414,
11,
48436,
2414,
11,
34441,
51,
29291,
198,
3500,
12578,
69,
198,
3500,
40713,
198,
198,
2,
4689,
44,
3620,
314,
14,
46,
198,
2,
220,
198,
2,
2312,
389,
31878,
326,
1037,
284,
2251,
257,
4689,
44,
3620,... | 2.019469 | 14,125 |
mutable struct NewickXMLElement <: MyXMLElement
el::XMLOrNothing
newick::String
fix_tree::Bool
NewickXMLElement(newick::String) = new(nothing, newick, true)
end
function make_xml(nl::NewickXMLElement)
el = new_element(bn.NEWICK)
set_attribute(el, bn.ID, bn.DEFAULT_TREE_NAME)
if nl.fix_tre... | [
76,
18187,
2878,
968,
624,
37643,
2538,
1732,
1279,
25,
2011,
37643,
2538,
1732,
198,
220,
220,
220,
1288,
3712,
55,
5805,
5574,
18465,
198,
220,
220,
220,
649,
624,
3712,
10100,
198,
220,
220,
220,
4259,
62,
21048,
3712,
33,
970,
6... | 2.139831 | 236 |
global DISABLESTBPRTLINES = false
function togglePrtStbLines()
global DISABLESTBPRTLINES
DISABLESTBPRTLINES = !DISABLESTBPRTLINES
end
function plotLsrScanFeats(br::Array{Float64,2})
Cart = zeros(size(br))
Cart[:,1] = br[:,2].*cos(br[:,1])
Cart[:,2] = br[:,2].*sin(br[:,1])
plot(x=Cart[:,1],y=Cart[:,2],Geom... | [
20541,
13954,
6242,
43,
6465,
33,
4805,
14990,
1268,
1546,
796,
3991,
198,
198,
8818,
19846,
6836,
83,
1273,
65,
43,
1127,
3419,
198,
220,
3298,
13954,
6242,
43,
6465,
33,
4805,
14990,
1268,
1546,
198,
220,
13954,
6242,
43,
6465,
33,
... | 1.915305 | 12,728 |
module QuakePAK
const _fileid = 0x5041434b # The chars "PACK" used as a signature of PAK archives
struct ReadableFile <: IO
_io::IO
filename:: String
offset:: Int
size:: Int
end
Base.position(rf::ReadableFile) = position(rf._io) - rf.offset
Base.eof(rf.ReadableFile) = position(rf._io) < rf.offset + rf.s... | [
21412,
42901,
4537,
42,
198,
198,
9979,
4808,
7753,
312,
796,
657,
87,
33580,
1415,
2682,
65,
220,
220,
220,
220,
220,
1303,
383,
34534,
366,
47,
8120,
1,
973,
355,
257,
9877,
286,
8147,
42,
22415,
198,
198,
7249,
4149,
540,
8979,
... | 2.519763 | 506 |
@testset "ladderize" begin
start_tree = ParseNewick("((A,(B,(C,(D,E)))),(F,(G,H)));")
descending_tree = ParseNewick("(((((D,E),C),B),A),((G,H),F));")
ascending_tree = ParseNewick("((F,(G,H)),(A,(B,(C,(D,E)))));")
start_newick = newick(start_tree)
desc_newick = newick(descending_tree)
asc_newic... | [
198,
31,
9288,
2617,
366,
9435,
1082,
1096,
1,
2221,
198,
220,
220,
220,
923,
62,
21048,
796,
2547,
325,
3791,
624,
7203,
19510,
32,
11,
7,
33,
11,
7,
34,
11,
7,
35,
11,
36,
22305,
828,
7,
37,
11,
7,
38,
11,
39,
4008,
1776,
... | 2.196133 | 362 |
@everywhere module DatasetPreloader
using HDF5
using Distributed
export preload, load, getPreloadFileName
preloadFileName = ""
preloadFuture = 0
function readFromHDF(filename)
GC.gc()
try
return h5read(filename,"/FullSpectra/TofData")
catch
return 0
end
end
getPreloadFileName() = preloadFileNam... | [
31,
16833,
3003,
8265,
16092,
292,
316,
6719,
29356,
198,
197,
3500,
5572,
37,
20,
198,
197,
3500,
4307,
6169,
198,
197,
39344,
662,
2220,
11,
3440,
11,
651,
6719,
2220,
8979,
5376,
628,
197,
3866,
2220,
8979,
5376,
796,
13538,
198,
... | 2.819018 | 326 |
module TracePrecompiles
function run_julia(cmd)
current_proj = unsafe_string(Base.JLOptions().project)
run(`$(Base.julia_cmd()) --project=$(current_proj) --startup-file=no $(cmd)`)
end
function trace_compiles(package, trace_file, outputfile)
tdir = mktempdir(; cleanup=true)
trace_out = joinpath(tdir, ... | [
21412,
34912,
6719,
5589,
2915,
198,
198,
8818,
1057,
62,
73,
43640,
7,
28758,
8,
198,
220,
220,
220,
1459,
62,
1676,
73,
796,
21596,
62,
8841,
7,
14881,
13,
41,
21982,
8544,
22446,
16302,
8,
198,
220,
220,
220,
1057,
7,
63,
3,
... | 2.419811 | 212 |
import ..KERNEL.System
"Save information needed to identify a SSBond"
struct SSBond #Tuple of chain_id and residue_number
chain_id::Char
res_num::Int64
end
"Packages the parsed fields from a conect line in a struct to avoid allocations"
mutable struct ConectLineParams
bonding_atoms::Vector{Int}
... | [
198,
11748,
11485,
42,
28778,
3698,
13,
11964,
628,
198,
198,
1,
16928,
1321,
2622,
284,
5911,
257,
6723,
33,
623,
1,
198,
7249,
6723,
33,
623,
220,
220,
220,
1303,
51,
29291,
286,
6333,
62,
312,
290,
35186,
62,
17618,
198,
220,
2... | 2.013446 | 6,991 |
import Term: Panel, TextBox
@testset "\e[34mPanel - no content" begin
for style in ("default", "red", "on_blue")
testpanel(
Panel(;fit=true, style=style), 3, 2
)
testpanel(
Panel(), 88, 2
)
testpanel(
Panel(; width=12, height=4, style=... | [
11748,
35118,
25,
18810,
11,
8255,
14253,
628,
198,
198,
31,
9288,
2617,
37082,
68,
58,
2682,
76,
26639,
532,
645,
2695,
1,
2221,
198,
220,
220,
220,
329,
3918,
287,
5855,
12286,
1600,
366,
445,
1600,
366,
261,
62,
17585,
4943,
198,... | 1.570676 | 5,313 |
module Stat
import Gadfly
import StatsBase
using DataArrays
using Compose
using Color
using Loess
using Hexagons
import Gadfly: Scale, Coord, element_aesthetics, default_scales, isconcrete,
nonzero_length, setfield!
import StatsBase: bandwidth, kde
import Distributions: Uniform
import Iterators: chain,... | [
21412,
5133,
198,
198,
11748,
20925,
12254,
198,
11748,
20595,
14881,
198,
3500,
6060,
3163,
20477,
198,
3500,
3082,
577,
198,
3500,
5315,
198,
3500,
6706,
408,
198,
3500,
22212,
34765,
198,
198,
11748,
20925,
12254,
25,
21589,
11,
22819,... | 1.904734 | 13,520 |
using CSV, DataFrames, Distributed, Dates, LinearAlgebra, Distributions, DelimitedFiles, SharedArrays
# Custom package
using Jevo
# Get date to append to output file
date = Dates.format(Dates.today(), "yyyy_mm_dd")
# Get number of workers as a script argument
if length(ARGS) == 1
addprocs(parse(Int64, ARGS[1]))... | [
3500,
44189,
11,
6060,
35439,
11,
4307,
6169,
11,
44712,
11,
44800,
2348,
29230,
11,
46567,
507,
11,
4216,
320,
863,
25876,
11,
39403,
3163,
20477,
198,
198,
2,
8562,
5301,
198,
3500,
449,
1990,
78,
628,
198,
2,
3497,
3128,
284,
244... | 2.06914 | 1,186 |
__precompile__()
module EllipsisNotation
import Base: to_indices, tail
const .. = Val{:..}()
@inline fillcolons(inds, I) = fillcolons((), inds, I)
@inline fillcolons(colons, ::Tuple{}, ::Tuple{}) = colons
@noinline fillcolons(colons, ::Tuple{}, ::Tuple) = throw(ArgumentError("too many indices provided"))
@inline ... | [
834,
3866,
5589,
576,
834,
3419,
198,
198,
21412,
7122,
2419,
271,
3673,
341,
198,
198,
11748,
7308,
25,
284,
62,
521,
1063,
11,
7894,
198,
9979,
11485,
220,
220,
796,
3254,
90,
25,
492,
92,
3419,
198,
198,
31,
45145,
6070,
4033,
... | 2.486667 | 300 |
using ImageSegmentation
using ImageSegmentation.Colors
using ImageSegmentation.FixedPointNumbers
using FileIO
using Statistics
using SparseArrays
using Test
@testset "flood_fill" begin
# 0d
a = reshape([true])
@test flood(identity, a, CartesianIndex()) == a
@test_throws ArgumentError flood(!, a, Cartes... | [
3500,
7412,
41030,
14374,
198,
3500,
7412,
41030,
14374,
13,
5216,
669,
198,
3500,
7412,
41030,
14374,
13,
13715,
12727,
49601,
198,
3500,
9220,
9399,
198,
3500,
14370,
198,
3500,
1338,
17208,
3163,
20477,
198,
3500,
6208,
198,
198,
31,
... | 2.091312 | 1,807 |
# This file is a part of StruckVMEDevices.jl, licensed under the MIT License (MIT).
import Test
Test.@testset "SIS3316Digitizers" begin
end # testset
| [
2,
770,
2393,
318,
257,
636,
286,
520,
30915,
15996,
1961,
1990,
1063,
13,
20362,
11,
11971,
739,
262,
17168,
13789,
357,
36393,
737,
198,
198,
11748,
6208,
198,
14402,
13,
31,
9288,
2617,
366,
50,
1797,
2091,
1433,
19511,
3029,
364,
... | 2.980392 | 51 |
using STC.SUniward
using Base.Test
using Images
function testreflectedsetindex()
a=zeros(20,30)
b= padarray(a,Pad(:symmetric,[16,16],[16,16]))
@testset begin
for j in 1:size(a,2)
for i in 1:size(a,1)
a[i,j]=1
SUniward.reflectedsetindex!(b,i,j,1)
c = padarray(a,Pad(... | [
3500,
3563,
34,
13,
50,
3118,
72,
904,
198,
3500,
7308,
13,
14402,
198,
3500,
5382,
198,
198,
8818,
1332,
5420,
12609,
2617,
9630,
3419,
198,
220,
257,
28,
9107,
418,
7,
1238,
11,
1270,
8,
198,
220,
275,
28,
14841,
18747,
7,
64,
... | 1.995199 | 5,624 |
const packages = [
"AverageShiftedHistograms",
"BDF",
"BrainWave",
"Diversity",
"IterativeSolvers",
"RCall",
"SDT",
"Sims",
"TargetedLearning"
]
const failures = Set()
for package in packages
print(" - ", package)
try
require(package)
println(" ✓")
c... | [
9979,
10392,
796,
685,
198,
220,
220,
220,
366,
26287,
2484,
21715,
13749,
26836,
1600,
198,
220,
220,
220,
366,
33,
8068,
1600,
198,
220,
220,
220,
366,
44687,
39709,
1600,
198,
220,
220,
220,
366,
35,
1608,
1600,
198,
220,
220,
22... | 2.19917 | 241 |
function retrieve_parent_ex(parent_handle::SpecHandle, func::SpecFunc)
parent_handle_var = findfirst(==(parent_handle.name), func.params.type)
@match n = func.name begin
if !isnothing(parent_handle_var)
end => wrap_identifier(func.params[parent_handle_var])
_ => nothing
end
end
func... | [
8818,
19818,
62,
8000,
62,
1069,
7,
8000,
62,
28144,
3712,
22882,
37508,
11,
25439,
3712,
22882,
37,
19524,
8,
198,
220,
220,
220,
2560,
62,
28144,
62,
7785,
796,
1064,
11085,
7,
855,
7,
8000,
62,
28144,
13,
3672,
828,
25439,
13,
... | 2.458045 | 1,013 |
################################################################################
# Common models used in testing
################################################################################
function reldiff(a, b)
diff = sum(abs(a - b))
norm = sum(abs(a))
return diff / (norm + 1e-10)
end
function rand_dims(ma... | [
29113,
29113,
14468,
198,
2,
8070,
4981,
973,
287,
4856,
198,
29113,
29113,
14468,
198,
8818,
302,
335,
733,
7,
64,
11,
275,
8,
198,
220,
814,
796,
2160,
7,
8937,
7,
64,
532,
275,
4008,
198,
220,
2593,
796,
2160,
7,
8937,
7,
64,... | 3.034653 | 202 |
get_all_plots_types() = Set([:fit, :residuals, :normal_checks, :cooksd, :leverage, :homoscedasticity])
get_needed_plots(s::String) = return get_needed_plots([s])
get_needed_plots(s::Symbol) = return get_needed_plots([s])
get_needed_plots(s::Vector{String}) = return get_needed_plots(Symbol.(lowercase.(s)))
get_needed_pl... | [
1136,
62,
439,
62,
489,
1747,
62,
19199,
3419,
796,
5345,
26933,
25,
11147,
11,
1058,
411,
312,
723,
82,
11,
1058,
11265,
62,
42116,
11,
1058,
27916,
21282,
11,
1058,
293,
1857,
11,
1058,
26452,
418,
771,
3477,
414,
12962,
198,
1136... | 2.363168 | 6,793 |
abstract type CMF end
abstract type CIE1931_CMF <: CMF end
abstract type CIE1964_CMF <: CMF end
abstract type CIE1931J_CMF <: CMF end
abstract type CIE1931JV_CMF <: CMF end
abstract type CIE2006_2_CMF <: CMF end
abstract type CIE2006_10_CMF <: CMF end
"""
colormatch(wavelength)
colormatch(matchingfunction, wa... | [
198,
397,
8709,
2099,
16477,
37,
886,
198,
397,
8709,
2099,
327,
10008,
1129,
3132,
62,
24187,
37,
1279,
25,
16477,
37,
886,
198,
397,
8709,
2099,
327,
10008,
46477,
62,
24187,
37,
1279,
25,
16477,
37,
886,
198,
397,
8709,
2099,
327... | 1.839351 | 52,817 |
include("je_polyagamma_struct.jl")
include("je_polyagamma_optimize.jl")
function joint_estimate_pg!(
items::Vector{<:AbstractItem},
examinees::Vector{<:AbstractExaminee},
responses::Vector{<:AbstractResponse};
max_time::Int64 = 100,
mcmc_iter::Int64 = 10,
x_tol_rel::Float64 = 0.001,
item_sa... | [
17256,
7203,
18015,
62,
35428,
363,
321,
2611,
62,
7249,
13,
20362,
4943,
198,
17256,
7203,
18015,
62,
35428,
363,
321,
2611,
62,
40085,
1096,
13,
20362,
4943,
198,
198,
8818,
6466,
62,
395,
1920,
62,
6024,
0,
7,
198,
220,
220,
220,... | 1.761235 | 2,915 |
module TriplotRecipes
using PlotUtils,RecipesBase,TriplotBase
export tricontour,tricontour!,tripcolor,tripcolor!,dgtripcolor,dgtripcolor!,trimesh,trimesh!
function append_with_nan!(a,b)
append!(a,b)
push!(a,NaN)
end
@recipe function f(contours::Vector{TriplotBase.Contour{T}}) where {T}
color = get(plota... | [
21412,
7563,
29487,
6690,
18636,
198,
198,
3500,
28114,
18274,
4487,
11,
6690,
18636,
14881,
11,
14824,
29487,
14881,
198,
198,
39344,
491,
291,
756,
454,
11,
83,
1173,
756,
454,
28265,
39813,
8043,
11,
39813,
8043,
28265,
67,
13655,
55... | 1.915867 | 1,355 |
using LinearAlgebra
using Random
using SparseArrays
using Test
using Jutils.Elements
using Jutils.Functions
using Jutils.Integration
using Jutils.Mesh
using Jutils.Transforms
using Jutils.Topologies
const lineelt = Element(Simplex{1}(), 1)
const squareelt = Element(Tensor([Simplex{1}(), Simplex{1}()]), 1)
ev(func, ... | [
3500,
44800,
2348,
29230,
198,
3500,
14534,
198,
3500,
1338,
17208,
3163,
20477,
198,
3500,
6208,
198,
198,
3500,
449,
26791,
13,
36,
3639,
198,
3500,
449,
26791,
13,
24629,
2733,
198,
3500,
449,
26791,
13,
34500,
1358,
198,
3500,
449,
... | 3.037559 | 213 |
using Test
using Base.BinaryPlatforms
import Libdl
using BinaryBuilderBase
using BinaryBuilderBase: template, dlopen_flags_str
# The platform we're running on
const platform = HostPlatform()
@testset "Products" begin
@test template(raw"$libdir/foo-$arch/$nbits/bar-$target", Platform("x86_64", "windows")) ==
... | [
3500,
6208,
198,
3500,
7308,
13,
33,
3219,
37148,
82,
198,
11748,
7980,
25404,
198,
3500,
45755,
32875,
14881,
198,
3500,
45755,
32875,
14881,
25,
11055,
11,
288,
75,
9654,
62,
33152,
62,
2536,
198,
198,
2,
383,
3859,
356,
821,
2491,
... | 2.359073 | 4,403 |
module SpringCollab2020TrollStrawberry
using ..Ahorn, Maple
@mapdef Entity "SpringCollab2020/trollStrawberry" TrollStrawberry(x::Integer, y::Integer, winged::Bool=false)
const placements = Ahorn.PlacementDict(
"Troll Strawberry (Spring Collab 2020)" => Ahorn.EntityPlacement(
TrollStrawberry
),
... | [
171,
119,
123,
21412,
8225,
22667,
397,
42334,
51,
2487,
1273,
1831,
8396,
198,
198,
3500,
11485,
10910,
1211,
11,
21249,
198,
198,
31,
8899,
4299,
20885,
366,
30387,
22667,
397,
42334,
14,
83,
2487,
1273,
1831,
8396,
1,
28037,
1273,
... | 2.540309 | 583 |
module triangleInterpolator
using Images
export rasterizationBBOX
function pointLine(x::Float64,
y::Float64,
line::Array{Float64},
linex::Float64,
liney::Float64
)::Float64
return line[2]*x - lin... | [
21412,
22950,
9492,
16104,
1352,
198,
220,
220,
220,
1262,
5382,
198,
220,
220,
220,
10784,
374,
1603,
1634,
33,
39758,
628,
220,
220,
220,
2163,
966,
13949,
7,
87,
3712,
43879,
2414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,... | 1.60232 | 3,103 |
using Lazy
import Lazy: cycle, range, drop, take
using Test
# dummy function to test threading macros on
function add_things(n1, n2, n3)
100n1 + 10n2 + n3
end
# dummy macro to test threading macros on
macro m_add_things(n1, n2, n3)
quote
100 * $(esc(n1)) + 10 * $(esc(n2)) + $(esc(n3))
end
end
# d... | [
3500,
406,
12582,
198,
11748,
406,
12582,
25,
6772,
11,
2837,
11,
4268,
11,
1011,
198,
3500,
6208,
198,
198,
2,
31548,
2163,
284,
1332,
4704,
278,
34749,
319,
198,
8818,
751,
62,
27971,
7,
77,
16,
11,
299,
17,
11,
299,
18,
8,
19... | 2.059898 | 1,970 |
import Base: isempty
export ResetMap,
get_A,
get_b
"""
ResetMap{N<:Real, S<:LazySet{N}} <: LazySet{N}
Type that represents a lazy reset map.
A reset map is a special case of an affine map ``A x + b, x ∈ X`` where the
linear map ``A`` is the identity matrix with zero entries in all reset
dimensions,... | [
11748,
7308,
25,
318,
28920,
198,
198,
39344,
30027,
13912,
11,
198,
220,
220,
220,
220,
220,
220,
651,
62,
32,
11,
198,
220,
220,
220,
220,
220,
220,
651,
62,
65,
198,
198,
37811,
198,
220,
220,
220,
30027,
13912,
90,
45,
27,
2... | 2.417473 | 3,308 |
function tuning_display(p)
lines=show(p.output, p.tuner, progress=true)
println();
return lines
end
function convergence_display(p)
try
ciplot=lineplot([p.counter-(length(p.convergence_history)-1):p.counter...], p.convergence_history, title="Convergence Interval Recent History", xlabel="Iterate... | [
8818,
24549,
62,
13812,
7,
79,
8,
198,
220,
220,
220,
3951,
28,
12860,
7,
79,
13,
22915,
11,
279,
13,
28286,
263,
11,
4371,
28,
7942,
8,
198,
220,
220,
220,
44872,
9783,
198,
220,
220,
220,
1441,
3951,
198,
437,
198,
198,
8818,
... | 2.252547 | 1,374 |
struct ERBFilterbank{C,G,T<:Real,U<:Real,V<:Real} <: Filterbank
filters::Vector{SecondOrderSections{C,G}}
ERB::Vector{T}
center_frequencies::Vector{U}
fs::V
end
function make_erb_filterbank(fs, num_channels, low_freq, EarQ = 9.26449, minBW = 24.7, order = 1)
T = 1/fs
if length(num_channels) == ... | [
7249,
13793,
33,
22417,
17796,
90,
34,
11,
38,
11,
51,
27,
25,
15633,
11,
52,
27,
25,
15633,
11,
53,
27,
25,
15633,
92,
1279,
25,
25853,
17796,
198,
220,
220,
220,
16628,
3712,
38469,
90,
12211,
18743,
50,
478,
507,
90,
34,
11,
... | 1.740091 | 1,539 |
using Logging
bundle = ResourceBundle(@__MODULE__, "messages2")
@test bundle.path == abspath("resources")
bundle2 = ResourceBundle(ResourceBundles, "bundle")
@test realpath(bundle2.path) == realpath(normpath(pwd(), "resources"))
bundle3 = ResourceBundle(ResourceBundles, "does1not2exist")
@test bundle3.path == "."
b... | [
3500,
5972,
2667,
198,
198,
65,
31249,
796,
20857,
33,
31249,
7,
31,
834,
33365,
24212,
834,
11,
366,
37348,
1095,
17,
4943,
198,
31,
9288,
18537,
13,
6978,
6624,
2352,
6978,
7203,
37540,
4943,
198,
198,
65,
31249,
17,
796,
20857,
3... | 2.082361 | 2,829 |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .jl
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.6
# kernelspec:
# display_name: Julia 1.0.3
# language: julia
# name: julia-1.0
# ---
module SEIRmodel
using Ordi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
2420,
62,
15603,
341,
25,
198,
2,
220,
220,
220,
... | 2.011834 | 676 |
# function NormalDifference(df, group, var; ind_summary = mean, ylabel = "Median ...", xyfont = font(18, "Bookman Light"))
# res_plt, res_group, res_individual = mean_sem_scatter(df, group, var; ind_summary = ind_summary)
# res_test = test_difference(res_individual, group, var; normality = true)
# pooledSD ... | [
2,
2163,
14435,
28813,
1945,
7,
7568,
11,
1448,
11,
1401,
26,
773,
62,
49736,
796,
1612,
11,
331,
18242,
796,
366,
9921,
666,
35713,
11,
2124,
88,
10331,
796,
10369,
7,
1507,
11,
366,
10482,
805,
4401,
48774,
198,
2,
220,
220,
220... | 2.246614 | 3,175 |
# ---
# title: 20. Valid Parentheses
# id: problem20
# author: Tian Jun
# date: 2020-10-31
# difficulty: Easy
# categories: String, Stack
# link: <https://leetcode.com/problems/valid-parentheses/description/>
# hidden: true
# ---
#
# Given a string `s` containing just the characters `'('`, `')'`, `'{'`, `'}'`,
# `'['`... | [
2,
11420,
198,
2,
3670,
25,
1160,
13,
48951,
16774,
39815,
198,
2,
4686,
25,
1917,
1238,
198,
2,
1772,
25,
20834,
7653,
198,
2,
3128,
25,
12131,
12,
940,
12,
3132,
198,
2,
8722,
25,
16789,
198,
2,
9376,
25,
10903,
11,
23881,
198... | 2.108696 | 552 |
function assemble_structures(layup,n_pt,twist,sloc,xaf,yaf,nchord,lam_t,designparams,x_offset,orientation,xloc,zloc,geom,webloc)
# assemble structural properties
mat = Array{Array{Composites.material,1}}(n_pt)
lam = Array{Composites.laminate,1}(n_pt)
precompinput = Array{PreComp.input,1}(n_pt)
preco... | [
8818,
25432,
62,
7249,
942,
7,
10724,
929,
11,
77,
62,
457,
11,
4246,
396,
11,
6649,
420,
11,
87,
1878,
11,
88,
1878,
11,
77,
354,
585,
11,
2543,
62,
83,
11,
26124,
37266,
11,
87,
62,
28968,
11,
13989,
341,
11,
87,
17946,
11,
... | 1.93438 | 11,338 |
using Makie
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
scene = Scene()
scatter(scene, rand(50), rand(50), markersize = 0.01)
a = axis(scene, range(0, stop = 1, length = 4), range(0, stop = 1, length = 4), textsize = 0.1, axisnames = ("", "", ""))
tf = to_value(a, :tickfont2d)
a... | [
3500,
15841,
494,
198,
198,
14881,
13,
31,
535,
439,
540,
2163,
474,
43640,
62,
12417,
7,
1503,
14313,
3712,
38469,
90,
10100,
92,
2599,
25,
34,
600,
198,
220,
220,
220,
3715,
796,
28315,
3419,
198,
220,
220,
220,
41058,
7,
29734,
... | 2.276596 | 188 |
# for GMM
function SVmoments(m, n, θ, η, ϵ)
S = size(ϵ, 2)
ms = zeros(S,size(m,1))
Threads.@threads for s=1:S
ms[s,:] = sqrt(n)*aux_stat(SVmodel(θ, n, η[:,s], ϵ[:,s])[1])
end
ms .- m'
end
| [
2,
329,
6951,
44,
220,
198,
8818,
20546,
32542,
658,
7,
76,
11,
299,
11,
7377,
116,
11,
7377,
115,
11,
18074,
113,
8,
198,
220,
220,
220,
311,
796,
2546,
7,
139,
113,
11,
362,
8,
198,
220,
220,
220,
13845,
796,
1976,
27498,
7,... | 1.619403 | 134 |
# Init to get started
| [
2,
44707,
284,
651,
2067,
198
] | 3.666667 | 6 |
@testset "4.2.12 (e x)^m (a+b cos(c+d x^n))^p" begin
(a, b, c, d, e, m, n, p, x, ) = @variables a b c d e m n p x
#= ::Package:: =#
#= ::Title:: =#
#=Integrands*of*the*form*(e*x)^m*(a+b*cos(c+d*x^n))^p=#
#= ::Section::Closed:: =#
#=Integrands*of*the*form*(e*x)^m*(a+b*cos(c+d*x^2))^p=#
... | [
31,
9288,
2617,
366,
19,
13,
17,
13,
1065,
357,
68,
2124,
8,
61,
76,
357,
64,
10,
65,
8615,
7,
66,
10,
67,
2124,
61,
77,
4008,
61,
79,
1,
2221,
198,
220,
220,
220,
357,
64,
11,
275,
11,
269,
11,
288,
11,
304,
11,
285,
11... | 1.457083 | 17,592 |
import DataStructures.Stack
type CRPState
# map from data index to cluster index
assignments::Dict{Int, Int}
# map from cluster index size of cluser
counts::Dict{Int, Int}
# reuse ids for the new clusters by pushing them onto a stack
# this is necessary because we may do billions of Gibbs swe... | [
11748,
6060,
44909,
942,
13,
25896,
198,
198,
4906,
8740,
47,
9012,
198,
220,
220,
220,
1303,
3975,
422,
1366,
6376,
284,
13946,
6376,
198,
220,
220,
220,
25815,
3712,
35,
713,
90,
5317,
11,
2558,
92,
628,
220,
220,
220,
1303,
3975,... | 2.243222 | 1,291 |
struct HillClimb <: BaseStructureLearning end
| [
7249,
3327,
34,
2475,
65,
1279,
25,
7308,
1273,
5620,
41730,
886,
198
] | 3.538462 | 13 |
"""In-place version of `signed_exponent(::Array)`."""
function signed_exponent!(A::Array{T}) where {T<:Union{Float16,Float32,Float64}}
# sign&fraction mask
sfmask = Base.sign_mask(T) | Base.significand_mask(T)
emask = Base.exponent_mask(T)
sbits = Base.significand_bits(T)
bias = Base.exponent_bia... | [
37811,
818,
12,
5372,
2196,
286,
4600,
32696,
62,
11201,
3471,
7,
3712,
19182,
8,
63,
526,
15931,
198,
8818,
4488,
62,
11201,
3471,
0,
7,
32,
3712,
19182,
90,
51,
30072,
810,
1391,
51,
27,
25,
38176,
90,
43879,
1433,
11,
43879,
26... | 2.489552 | 670 |
#===================================================================================================
Kernel Kernels Module
===================================================================================================#
module MLKernels
import Base: convert, eltype, print, show, string, ==, *, /, +, -, ^, exp, ... | [
2,
23926,
10052,
18604,
198,
220,
32169,
509,
44930,
19937,
198,
23926,
10052,
18604,
2,
198,
198,
21412,
10373,
42,
44930,
198,
198,
11748,
7308,
25,
10385,
11,
1288,
4906,
11,
3601,
11,
905,
11,
4731,
11,
6624,
11,
1635,
11,
1220,
... | 2.566186 | 763 |
module IntegralsModule
export computeIntegralOverlap, computeElectronRepulsionIntegral, computeTensorBlockElectronRepulsionIntegrals, computeIntegralKinetic, computeIntegralNuclearAttraction, computeIntegralThreeCenterOverlap, computeMatrixBlockOverlap, computeMatrixBlockKinetic, computeMatrixBlockNuclearAttraction
usi... | [
21412,
15995,
30691,
26796,
198,
39344,
24061,
34500,
1373,
5886,
37796,
11,
24061,
19453,
1313,
6207,
15204,
34500,
1373,
11,
24061,
51,
22854,
12235,
19453,
1313,
6207,
15204,
34500,
30691,
11,
24061,
34500,
1373,
49681,
5139,
11,
24061,
... | 2.090428 | 7,741 |
using Test
using InteractiveUtils
using MagneticReadHead: moduleof, functiontypeof
# Define an extra method of eps in this module, so we can test methods of
Base.eps(::typeof(moduleof)) = "dummy"
@testset "moduleof" begin
for meth in methods(detect_ambiguities)
@test moduleof(meth) == Test
end
#... | [
3500,
6208,
198,
3500,
21365,
18274,
4487,
198,
3500,
44629,
5569,
13847,
25,
8265,
1659,
11,
2163,
4906,
1659,
628,
198,
2,
2896,
500,
281,
3131,
2446,
286,
304,
862,
287,
428,
8265,
11,
523,
356,
460,
1332,
5050,
286,
198,
14881,
... | 2.604839 | 372 |
#utilities
import Base.LinAlg: HermOrSym, AbstractTriangular, *, +, -, \, A_mul_Bt, At_mul_B, At_mul_Bt, Ac_mul_B, At_ldiv_B, Ac_ldiv_B
# convert SparseChar {N,T,C} to cusparseOperation_t
function cusparseop(trans::SparseChar)
if trans == 'N'
return CUSPARSE_OPERATION_NON_TRANSPOSE
end
if trans ==... | [
2,
315,
2410,
198,
198,
11748,
7308,
13,
14993,
2348,
70,
25,
18113,
5574,
43094,
11,
27741,
14824,
21413,
11,
1635,
11,
1343,
11,
532,
11,
3467,
11,
317,
62,
76,
377,
62,
33,
83,
11,
1629,
62,
76,
377,
62,
33,
11,
1629,
62,
7... | 1.601063 | 81,073 |
export absolute_error
function Base.:(|>)(t::Transform{T}, p::Point{3,U}) where {T,U}
(xₚ, yₚ, zₚ, wₚ) = sum(transpose(t.m[:,StaticArrays.SUnitRange(1,3)]) .* p,), dims=1) .+ transpose(t.m[:,StaticArrays.SUnitRange(4,4))]
return wₚ ≈ 1 ? promote_type(T, typeof(p))(xₚ, yₚ, zₚ) / wₚ : promote_type(T, typeof(p))(... | [
39344,
4112,
62,
18224,
198,
198,
8818,
7308,
11207,
7,
91,
29,
5769,
83,
3712,
41762,
90,
51,
5512,
279,
3712,
12727,
90,
18,
11,
52,
30072,
810,
1391,
51,
11,
52,
92,
198,
220,
220,
220,
357,
87,
158,
224,
248,
11,
331,
158,
... | 1.871236 | 963 |
using GenomicAnnotations
using GenomicMaps
using ColorTypes
# You can add any kind of annotation that you want to display.
# Here, I add COG annotation:
function addcogs!(chr, filename)
cogs = split.(readlines(filename), Ref('\t'))
i = 1
for gene in @genes(chr, :feature == "CDS")
if gene.locus_tag... | [
3500,
5215,
10179,
2025,
30078,
198,
3500,
5215,
10179,
47010,
198,
3500,
5315,
31431,
628,
198,
2,
921,
460,
751,
597,
1611,
286,
23025,
326,
345,
765,
284,
3359,
13,
198,
2,
3423,
11,
314,
751,
7375,
38,
23025,
25,
198,
8818,
751,... | 1.882748 | 1,339 |
export MCVanilla, Vegas, Domain
export integral, ∫
using QuickTypes: @qstruct
using ArgCheck
using LinearAlgebra, Statistics
using StaticArrays
using Base.Threads: @threads
using Setfield: @settable
import Random
abstract type MCAlgorithm end
@settable @qstruct MCVanilla{R}(
neval::Int64=10^6,
rng:... | [
198,
39344,
13122,
25298,
5049,
11,
9621,
11,
20021,
198,
39344,
19287,
11,
18872,
104,
198,
198,
3500,
12029,
31431,
25,
2488,
80,
7249,
198,
3500,
20559,
9787,
198,
3500,
44800,
2348,
29230,
11,
14370,
198,
3500,
36125,
3163,
20477,
1... | 2.152219 | 1,938 |
#= MIT License
Copyright (c) 2020, 2021 Uwe Fechner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publi... | [
2,
28,
17168,
13789,
198,
198,
15269,
357,
66,
8,
12131,
11,
33448,
471,
732,
376,
3055,
1008,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314... | 2.068745 | 6,095 |
module Gumbo
using Compat
if isfile(joinpath(dirname(dirname(@__FILE__)),"deps","deps.jl"))
include("../deps/deps.jl")
else
error("Gumbo not properly installed. Please run Pkg.build(\"Gumbo\")")
end
include("CGumbo.jl")
export HTMLElement,
HTMLDocument,
HTMLText,
NullNode,
HTMLNo... | [
21412,
402,
29309,
198,
198,
3500,
3082,
265,
198,
198,
361,
318,
7753,
7,
22179,
6978,
7,
15908,
3672,
7,
15908,
3672,
7,
31,
834,
25664,
834,
4008,
553,
10378,
82,
2430,
10378,
82,
13,
20362,
48774,
198,
220,
220,
220,
2291,
7203,... | 2.172414 | 290 |
@testset "distributions" begin
Random.seed!(1234)
# Create random vectors and matrices
dim = 3
a = rand(dim)
b = rand(dim)
c = rand(dim)
A = rand(dim, dim)
B = rand(dim, dim)
C = rand(dim, dim)
# Create random numbers
alpha = rand()
beta = rand()
gamma = rand()
... | [
31,
9288,
2617,
366,
17080,
2455,
507,
1,
2221,
198,
220,
220,
220,
14534,
13,
28826,
0,
7,
1065,
2682,
8,
628,
220,
220,
220,
1303,
13610,
4738,
30104,
290,
2603,
45977,
198,
220,
220,
220,
5391,
796,
513,
198,
220,
220,
220,
257... | 1.85566 | 12,429 |
# Contents: Functions for creating/handling secure cookies.
################################################################################
# Create session cookie
#
# The scheme:
# const_key, const_iv = global constants, output from a cryptographically secure random number generator
# ... | [
2,
26714,
25,
40480,
329,
4441,
14,
4993,
1359,
5713,
14746,
13,
198,
198,
29113,
29113,
14468,
198,
2,
13610,
6246,
19751,
198,
2,
198,
2,
383,
7791,
25,
198,
2,
220,
220,
220,
220,
1500,
62,
2539,
11,
1500,
62,
452,
220,
220,
... | 2.896442 | 2,192 |
# packages -
using LinearAlgebra
using GLPK
# my codes -
include("Flux.jl")
include("Expa.jl")
include("Stoichiometric.jl")
include("Utility.jl") | [
2,
10392,
532,
198,
3500,
44800,
2348,
29230,
198,
3500,
10188,
40492,
198,
198,
2,
616,
12416,
532,
198,
17256,
7203,
37,
22564,
13,
20362,
4943,
198,
17256,
7203,
3109,
8957,
13,
20362,
4943,
198,
17256,
7203,
1273,
78,
16590,
16996,
... | 2.807692 | 52 |
using Statistics
using LinearAlgebra
using Printf
#function nnComputeCosts(nn,datax,datay;print=true,dIdx=1:size(datax,2))
# c = [ nnCost(datay[:,d],nnForward(nn,datax[:,d])) for d=dIdx ];
#
# #Print costs
# if print
# #for d=1:length(c)
# # @printf("dataset %3d: cost=%10.8f\n",d,c[d]);
# #end
# @pri... | [
3500,
14370,
198,
3500,
44800,
2348,
29230,
198,
3500,
12578,
69,
198,
198,
2,
8818,
299,
77,
7293,
1133,
13729,
82,
7,
20471,
11,
19608,
897,
11,
19608,
323,
26,
4798,
28,
7942,
11,
67,
7390,
87,
28,
16,
25,
7857,
7,
19608,
897,
... | 2.068 | 750 |
function convert_cells_to_pop(cells, cell_phenotypes, guides)
cells_to_phenotypes = [DefaultDict{Float64, Int}(0) for _ in 1:length(guides)]
@inbounds for i in eachindex(cells)
cells_to_phenotypes[cells[i]][cell_phenotypes[i]] += 1
end
cells_to_phenotypes
end
function test_crispri_constructio... | [
8818,
10385,
62,
46342,
62,
1462,
62,
12924,
7,
46342,
11,
2685,
62,
31024,
13567,
11,
17555,
8,
198,
220,
220,
220,
4778,
62,
1462,
62,
31024,
13567,
796,
685,
19463,
35,
713,
90,
43879,
2414,
11,
2558,
92,
7,
15,
8,
329,
4808,
... | 2.298397 | 811 |
macro jl15_str(code::AbstractString)
if VERSION >= v"1.5-rc0"
@debug "Parsing code for Julia ≥ 1.5" Text(code)
expr = Meta.parse(string("begin\n", code, "\nend"))
@assert expr.head === :block
if expr.args[1] isa LineNumberNode
expr.args[1] = __source__
end
... | [
20285,
305,
474,
75,
1314,
62,
2536,
7,
8189,
3712,
23839,
10100,
8,
198,
220,
220,
220,
611,
44156,
2849,
18189,
410,
1,
16,
13,
20,
12,
6015,
15,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
24442,
366,
47,
945,
278,
2438,... | 1.975904 | 332 |
using ForwardDiff
using NLSolvers
#ScalarLsqObjective
#VectorLsqObjective
@. model(x, p) = p[1] * exp(-x * p[2])
xdata = range(0, stop = 10, length = 20)
ydata = model(xdata, [1.0 2.0]) + 0.01 * randn(length(xdata))
p0 = [0.5, 0.5]
function f(x)
mod = model(xdata, x)
return sum(abs2, mod .- ydata) / 2
end
x0... | [
3500,
19530,
28813,
198,
3500,
399,
6561,
349,
690,
198,
198,
2,
3351,
282,
283,
43,
31166,
10267,
425,
198,
2,
38469,
43,
31166,
10267,
425,
198,
198,
31,
13,
2746,
7,
87,
11,
279,
8,
796,
279,
58,
16,
60,
1635,
1033,
32590,
87... | 2.297872 | 2,256 |
export body!, content!, loadcss!, loadjs!, load!, importhtml!
content!(o, sel, html::AbstractString; fade = true) =
fade ?
@js_(o, Blink.fill($sel, $html)) :
@js_ o document.querySelector($sel).innerHTML = $html
content!(o, sel, html; fade = true) =
content!(o, sel, stringmime(MIME"text/html"(), html), fa... | [
39344,
1767,
28265,
2695,
28265,
3440,
25471,
28265,
3440,
8457,
28265,
3440,
28265,
848,
1506,
20369,
0,
198,
198,
11299,
0,
7,
78,
11,
384,
75,
11,
27711,
3712,
23839,
10100,
26,
22100,
796,
2081,
8,
796,
198,
220,
22100,
5633,
198,... | 2.214529 | 881 |
@testset "Decomposition" begin
d = loadgraph(joinpath(testdir, "testdata", "graph-decomposition.jgz"))
for g in testgraphs(d)
corenum = @inferred(core_number(g))
@test corenum == [3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0]
@test @inferred(k_core(g)) == k_cor... | [
31,
9288,
2617,
366,
10707,
296,
9150,
1,
2221,
198,
220,
220,
220,
288,
796,
3440,
34960,
7,
22179,
6978,
7,
9288,
15908,
11,
366,
9288,
7890,
1600,
366,
34960,
12,
12501,
296,
9150,
13,
73,
34586,
48774,
628,
220,
220,
220,
329,
... | 1.908957 | 681 |
@safetestset "HEAD requests" begin
@safetestset "HEAD requests should be by default handled by GET" begin
using Genie
using HTTP
port = nothing
port = rand(8500:8900)
route("/") do
"GET request"
end
server = up(port)
response = try
HTTP.request("GET", "http://127.0.0.1:... | [
31,
49585,
316,
395,
2617,
366,
37682,
7007,
1,
2221,
198,
220,
2488,
49585,
316,
395,
2617,
366,
37682,
7007,
815,
307,
416,
4277,
12118,
416,
17151,
1,
2221,
198,
220,
220,
220,
1262,
49405,
198,
220,
220,
220,
1262,
14626,
628,
2... | 2.425097 | 1,028 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.