text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
"""test_wave.py.
.. module:: test_wave
:platform: Unix, Windows
.. modelauthor:: Juan C Galan-Hernandez <jcgalanh@gmail.com>
"""
import unittest
import waveletcodec.wave as wave
import numpy as np
import numpy.testing as npt
import cv2
class TestWave(unittest.TestCase):
"""Test unit of the wave module.
... | {"hexsha": "d7a9c8d19a0f5a0ea17a03bb238a8d5181434f0e", "size": 1415, "ext": "py", "lang": "Python", "max_stars_repo_path": "waveletcodec/test/test_wave.py", "max_stars_repo_name": "zenathark/jg.waveletcodec", "max_stars_repo_head_hexsha": "7994dd18ef5472e7e4d6447062cf4dc3c2f6463f", "max_stars_repo_licenses": ["MIT"], "... |
/**
* \file
* \author Thomas Fischer
* \date 2010-06-16
* \brief Implementation of string helper functions.
*
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
*... | {"hexsha": "a1e10e4a1ec141e1c0c99a7ef635accc1158a4e1", "size": 2809, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "BaseLib/StringTools.cpp", "max_stars_repo_name": "mjamoein/ogs", "max_stars_repo_head_hexsha": "52e4d1bcf3bc21a44ee7710fc9900d8729334ad4", "max_stars_repo_licenses": ["BSD-4-Clause"], "max_stars_cou... |
# classes to hold the physical components of the system
# e.g. the stellar light, dark matter, black hole, globular clusters
import numpy as np
import logging
from dynamite import mges as mge
class System(object):
"""The physical system being modelled
e.g. system is a galaxy. A system is composed of ``Compo... | {"hexsha": "302694ea697c61ba9ed5a9256e214d8738e61755", "size": 20844, "ext": "py", "lang": "Python", "max_stars_repo_path": "dynamite/physical_system.py", "max_stars_repo_name": "dynamics-of-stellar-systems/dynamite_release", "max_stars_repo_head_hexsha": "a921d8a1bde98f48daeea78213fb17b3edb223bb", "max_stars_repo_lice... |
function [Bx,By,Bz] = magnetic_field_current_loop(x,y,z,x_p,y_p,z_p,a,I0)
%Kilian O'Donoghue
%30th July 2013
%This function calculates the magnetic field resulting from a single
%circular coil of radius a, carrying a currnet I0. The coil points in the z
%direction. The centre of the coil is located at {x_p,y_p,z_p}... | {"author": "Sable", "repo": "mcbench-benchmarks", "sha": "ba13b2f0296ef49491b95e3f984c7c41fccdb6d8", "save_path": "github-repos/MATLAB/Sable-mcbench-benchmarks", "path": "github-repos/MATLAB/Sable-mcbench-benchmarks/mcbench-benchmarks-ba13b2f0296ef49491b95e3f984c7c41fccdb6d8/43394-magnetic-field-of-circular-coils-using... |
from __future__ import absolute_import, division, unicode_literals
import time
from collections import defaultdict
import numpy as np
import panel as pn
from bokeh.models import (
CustomJS, FactorRange, DatetimeAxis, Range1d, DataRange1d,
PolyDrawTool, BoxEditTool, PolyEditTool, FreehandDrawTool,
PointD... | {"hexsha": "913dc9f09af00dec3a9dcbdcbb4ba4d6b807d6a8", "size": 45066, "ext": "py", "lang": "Python", "max_stars_repo_path": "holoviews/plotting/bokeh/callbacks.py", "max_stars_repo_name": "kgullikson88/holoviews", "max_stars_repo_head_hexsha": "942c5ac7db46d1bc04b21a1fcf837285bbc9bde8", "max_stars_repo_licenses": ["BSD... |
#=
From https://reference.wolfram.com/language/ref/HypergeometricDistribution.html
"""
Suppose an urn has 100 elements, of which 40 are special.
...
Compute the probability that there are more than 25 special elements in a
draw of 50 elements.
Answer: 0.0120902
Compute the expected number o... | {"hexsha": "437d76e3aaea2110803a199ca62d7ab8af15a8c3", "size": 2722, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "julia/turing/urn_model1.jl", "max_stars_repo_name": "tias/hakank", "max_stars_repo_head_hexsha": "87b7f180c9393afce440864eb9e5fb119bdec1a4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2... |
# Hierarchical Model for Abalone Length
Abalone were collected from various sites on the coast of California north of San Francisco. Here I'm going to develop a model to predict abalone lengths based on sites and harvest method - diving or rock-picking. I'm interested in how abalone lengths vary between sites and harv... | {"hexsha": "67fe8aac687949b5cd9c018b051d724a8d2a8261", "size": 343600, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "examples/Abalone Model.ipynb", "max_stars_repo_name": "wilsonify/sampyl", "max_stars_repo_head_hexsha": "fb05a0d04393e4f1691bcc9bc664dbc1b688fc97", "max_stars_repo_licenses": ["MIT"... |
import numpy as np
from datetime import datetime
import time
from sklearn import tree
from sklearn.preprocessing import normalize, scale
from sklearn.metrics import accuracy_score
fmt = '%H:%M:%S'
def get_current_time():
time.ctime()
return time.strftime(fmt)
r = range(42, 753)
trainX = np.genfromtxt(fname... | {"hexsha": "2f64b7c0d32168c58a9122a88cfe12e7d7c8004d", "size": 1638, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/Solution(DecisionTree).py", "max_stars_repo_name": "FarhanShoukat/DigitRecognition1438", "max_stars_repo_head_hexsha": "f1245b393905ee2722b30589acfeac947c69cc8a", "max_stars_repo_licenses": [... |
module OILMMs
using AbstractGPs
using ChainRulesCore
using FillArrays
using KernelFunctions
using LinearAlgebra
using Random
using AbstractGPs: AbstractGP, FiniteGP
using KernelFunctions: MOInput
include("util.jl")
include("oilmm.jl")
include("missing_data.jl")
export OILMM
end # module
| {"hexsha": "8ade0c71939dd686d98ce21e1ccebfdc80c2dbcc", "size": 293, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/OILMMs.jl", "max_stars_repo_name": "willtebbutt/OILMMs.jl", "max_stars_repo_head_hexsha": "c860fd6f9266331b4877921ce8147d962bcbd72a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "m... |
import numpy as np
from time import sleep
# Registers
reg_id = 0x00
reg_timestamp = 0x04
reg_pkt_len = 0x08
reg_decay = 0x0C
reg_wr_en = 0x10
reg_rst = 0x14
reg_n_in = 0x18
reg_n_out = 0x1C
# First mean in register
reg_mean_in = 0x20
# First mean out register
reg_mean_out = 0xC60
# ... | {"hexsha": "e11c324dea94a8c44d2327d50abfec792159930e", "size": 3416, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/gyro.py", "max_stars_repo_name": "federicohyo/Gyro", "max_stars_repo_head_hexsha": "9475b250aa3986948ed78a7ab27e0b86547025a0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
"""
Tensor
======
Tensor is implement as ndarray from numpy
``from numpy import ndarray as Tensor``
"""
# TO DO: Implement Tensor class seperate from numpy
from numpy import ndarray as Tensor | {"hexsha": "1529f24ef33932b92d5c3d074b2e8153f75783e2", "size": 195, "ext": "py", "lang": "Python", "max_stars_repo_path": "bluebird/tensor.py", "max_stars_repo_name": "Stoick01/bluebird", "max_stars_repo_head_hexsha": "a6ab5fcbf42da24ef8268ba6bc110b9eadd9a2ac", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
import os, sys
import numpy as np
from pdb import set_trace as st
import pandas as pd
posneg_dir = f"models/prune/lastconv_class_auc_channel_pos+neg"
dir = f"models/prune/lastconv_class_auc_channel"
result_dir = f"models/prune/lastconv_class_auc_channel_new"
os.makedirs(result_dir, exist_ok=True)
exp_configs = {
... | {"hexsha": "b7e7e0363a62f9325b01cbcf6d8f8d5f0809e680", "size": 949, "ext": "py", "lang": "Python", "max_stars_repo_path": "submissions/available/NNSlicer/finetune/knockoff/prune/post_process/concat_posneg_exps.py", "max_stars_repo_name": "ziqi-zhang/fse20", "max_stars_repo_head_hexsha": "f3998abda2e40d67989ec113340236f... |
// Copyright (c) 2014-2021 LG Electronics, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... | {"hexsha": "17260ed8b2830031944b6ca1a2625f811d60598f", "size": 4316, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/pbnjson_validate/pbnjson_validate.cpp", "max_stars_repo_name": "webosose/libpbnjson", "max_stars_repo_head_hexsha": "19c047b28d73c50330c1c97d2fa94aa8fccebcf6", "max_stars_repo_licenses": ["Apach... |
import numpy as np
import time
import util as u
# simulation parameters
dt = 0.1 # time step
T = 3000 # number of time steps
# parameters of the system
gamma = .00002 # gravitational coefficient
m1 = 300 # mass of the first planet
m2 = 1 # mass of the second planet
# initial conditions: st... | {"hexsha": "6af5c2bdecd1c4fa441f13333a6baf4a53ae707a", "size": 1655, "ext": "py", "lang": "Python", "max_stars_repo_path": "planets/planets.py", "max_stars_repo_name": "ricsirke/simulations", "max_stars_repo_head_hexsha": "395722bfe524d3b62a994bbc99c504f2f434d9f9", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# © 2019 University of Illinois Board of Trustees. All rights reserved
import h5py
import MemmapDataLite
import _pickle as pickle
import sys
import logging
import numpy as np
logging.basicConfig(level=logging.INFO)
def compare_tensors(a, b):
a = np.array(a)
b = np.array(b)
logging.info("Comparing tenso... | {"hexsha": "3b4280bb647875135b8fa7905ad89a0a32dc1d7a", "size": 1394, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/test_dict_data.py", "max_stars_repo_name": "anands-repo/hello", "max_stars_repo_head_hexsha": "743ff49c0de97a985643280a3b5cb562c58e7fb7", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
@inline metric(κ::Kernel) = κ.metric
## Allows to iterate over kernels
Base.length(::Kernel) = 1
Base.iterate(k::Kernel) = (k,nothing)
Base.iterate(k::Kernel, ::Any) = nothing
### Syntactic sugar for creating matrices and using kernel functions
for k in [:ExponentialKernel,:SqExponentialKernel,:GammaExponentialKernel... | {"hexsha": "bb5ee5a6d8bab00504865ad0e6ed7e8eab6fc26e", "size": 1899, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/generic.jl", "max_stars_repo_name": "UnofficialJuliaMirror/KernelFunctions.jl-ec8451be-7e33-11e9-00cf-bbf324bd1392", "max_stars_repo_head_hexsha": "2765f8e101aed49e4cdf44cca83dba4829d1554b", "m... |
"""
For panda (two-finger) gripper: pushing, pushing-left, pushing-up, pulling, pulling-left, pulling-up
50% all parts closed, 50% middle (for each part, 50% prob. closed, 50% prob. middle)
Simulate until static before starting
"""
import os
os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'
os.environ... | {"hexsha": "e09b03372b64371a29c425f51ab8d4aa22abedc7", "size": 11460, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/collect_data.py", "max_stars_repo_name": "georgegu1997/where2act", "max_stars_repo_head_hexsha": "90867056e79dc1fce38ccec170c30b7874379593", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
// The Open Trading Project - open-trading.org
//
// Copyright (c) 2011 Martin Tapia - martin.tapia@open-trading.org
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributio... | {"hexsha": "6fbcd0193735a9948bd2f13e6b88fa30f9a46b23", "size": 2535, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/hischeck/main.cpp", "max_stars_repo_name": "paps/Open-Trading", "max_stars_repo_head_hexsha": "b62f85f391be9975a161713f87aeff0cae0a1e37", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_... |
# TF CNN Basics
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
sess = tf.InteractiveSession()
# sess = tf.Session()으로 열면 앞부분에 그래프를 먼저 구성하고(모델링)하고
# 세션범위 안에서 값을 sess.un(Tesor)해서 확인해야하지만,
# InteractiveSession의 경우는 현재 세션을 de... | {"hexsha": "29d2df1317fd752f37b837c8984141dfb155190e", "size": 4381, "ext": "py", "lang": "Python", "max_stars_repo_path": "TF_Lab_11_1.py", "max_stars_repo_name": "leedongminAI/DL_Tensorflow_Lab", "max_stars_repo_head_hexsha": "1956429adf29b972ffe638c07db8dd8dde7eabd3", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# Use baremodule to shave off a few KB from the serialized `.ji` file
baremodule SDPA_jll
using Base
using Base: UUID
import JLLWrappers
JLLWrappers.@generate_main_file_header("SDPA")
JLLWrappers.@generate_main_file("SDPA", UUID("7fc90fd6-dbef-5a6a-93f8-169f2a2e705b"))
end # module SDPA_jll
| {"hexsha": "7cc1951f6d6a3c0188bcaea102937b774d665a6b", "size": 294, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SDPA_jll.jl", "max_stars_repo_name": "JuliaBinaryWrappers/SDPA_jll.jl", "max_stars_repo_head_hexsha": "8b9692712c6f1e8870499f9c0499b139b7b88b50", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
[STATEMENT]
lemma subset_Ico_iff[simp]:
"{a..<b} \<subseteq> {c..<b} \<longleftrightarrow> b \<le> a \<or> c \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ({a..<b} \<subseteq> {c..<b}) = (b \<le> a \<or> c \<le> a)
[PROOF STEP]
unfolding atLeastLessThan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
... | {"llama_tokens": 205, "file": "Poincare_Bendixson_Analysis_Misc", "length": 2} |
# MIT license
# Copyright (c) Microsoft Corporation. All rights reserved.
# See LICENSE in the project root for full license information.
# This file contains average properties of the human eye and optical human eye models
# luminance (cd/m2) Multiple Value Item
# 10−6 µcd/m2 1 µcd/m2 Absolute threshold of vision[1... | {"hexsha": "e0a6559a6fee7818691ce99b1cc1364ae332e8aa", "size": 2982, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Data/HumanEye.jl", "max_stars_repo_name": "LukasACH/OpticSim.jl", "max_stars_repo_head_hexsha": "36aca7c067e4f4754efe649a8f906a64eb682442", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
include("MeshCreator.jl")
include("MeshTopology.jl")
include("MeshGeometry.jl")
function processopenfoammesh(polymesh)
println("Generating mesh ...")
# Create mesh
nodes = createnodes(polymesh["points"])
faces = createfaces(polymesh["faces"], polymesh["owner"], polymesh["neighbour"])
bou... | {"hexsha": "a5110ead0c4ba76a424bfd7958f6f8c36b78beb7", "size": 1004, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Mesh/MeshProcessor.jl", "max_stars_repo_name": "andiraarif/FlicsFlow.jl", "max_stars_repo_head_hexsha": "50fa959666b9ed4fde158fc1be4d259f73675b06", "max_stars_repo_licenses": ["MIT"], "max_star... |
include("models.jl")
function test_bernoulli()
model_bernoulli = bernoulli_example()
graph_bernoulli = trackdependencies(model_bernoulli)
@testdependencies(model_bernoulli, w, p, x)
cond_bernoulli_p = StaticConditional(model_bernoulli, :p)
@test_nothrow sample(model_bernoulli, Gibbs(cond_bernoulli... | {"hexsha": "9aeb2af04ef7a32052df75c8885f7d576ca5bc24", "size": 9637, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_conditionals.jl", "max_stars_repo_name": "phipsgabler/AutoGibbs.jl", "max_stars_repo_head_hexsha": "de3cb28a00943ca4c3f1b928c391777f69d32fd5", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | {"hexsha": "488e161433af9df01f9064f9a25846bb12e1f2f7", "size": 1721, "ext": "py", "lang": "Python", "max_stars_repo_path": "model-optimizer/extensions/back/remove_last_softmax_pattern.py", "max_stars_repo_name": "apexxs/dldt", "max_stars_repo_head_hexsha": "17e66dc5a6631d630da454506902bd7c25d4170b", "max_stars_repo_lic... |
# Copyright (c) Felix Petersen.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
import argparse
import random
from tqdm import tqdm, trange
import time
import numpy as np
from sklearn.decomposition import ... | {"hexsha": "4c09672e7eab57c0661f3d21d626295ccf65385c", "size": 30020, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_coordinate_descent.py", "max_stars_repo_name": "Felix-Petersen/fairness-post-processing", "max_stars_repo_head_hexsha": "6c23ed4976544df83d67c0d79feb70a5fff92027", "max_stars_repo_licenses": ... |
from flask import Blueprint, Response, request, send_file
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
import pandas as pd
import numpy as np
from io import BytesIO
from .db import engine
from .auth import checkAuth
bp = Blueprint('expenses', __name__, url_prefix... | {"hexsha": "070734ec21ac7e5ba453c7e3cdca25829ddab412", "size": 11873, "ext": "py", "lang": "Python", "max_stars_repo_path": "flaskr/expenses.py", "max_stars_repo_name": "elijah415hz/finances-flask", "max_stars_repo_head_hexsha": "a74f09b7c51fa3f08d88540e75bfffd6ca840563", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
#! /usr/bin/env python
import numpy as np
import gc
import matplotlib.pyplot as plt
from random import seed, sample, randint
from ransac import LineModel, ransac
from time import time
random_seed = 0
num_iterations = 100
num_samples = 1000
noise_ratio = 0.8
num_noise = int(noise_ratio * num_sampl... | {"hexsha": "dd5a89069494ad6a57081f54dc38bbf75eb3a79e", "size": 1575, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "FredrikAppelros/ransac", "max_stars_repo_head_hexsha": "1ce13a963e2fc6d3e86edf2b0e3f6ef22ceec177", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "max_... |
[STATEMENT]
lemma square_part_square_dvd [simp, intro]: "square_part n ^ 2 dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (square_part n)\<^sup>2 dvd n
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. n = (0::'a) \<Longrightarrow> (square_part n)\<^sup>2 dvd n
2. n \<note... | {"llama_tokens": 472, "file": null, "length": 5} |
[STATEMENT]
lemma S5n_common_knowledge_induct:
assumes S5n: "S5n M"
assumes w: "w \<in> worlds M"
assumes E: "\<forall>a \<in> set as. \<forall>w \<in> worlds M.
M, w \<Turnstile> \<phi> \<longrightarrow> M, w \<Turnstile> \<^bold>K\<^sub>a (Kand \<phi> \<psi>)"
assumes p: "M, w \<Turnstile> \<... | {"llama_tokens": 1291, "file": "KBPs_Kripke", "length": 12} |
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 06 19:09:58 2014
@author: Morten
"""
import os
from pathlib import Path
import pytest
import numpy as np
from anypytools.tools import (
array2anyscript,
get_anybodycon_path,
define2str,
path2str,
AnyPyProcessOutput,
AnyPyProcessOutputList,
)
@p... | {"hexsha": "9516c1eaddf679dc2180e3b53cf92d288e7486e1", "size": 3404, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_tools.py", "max_stars_repo_name": "AnyBody-Research-Group/AnyPyTools", "max_stars_repo_head_hexsha": "042bc454122e9f8e03d96e1ec9e46be41a2dd5c8", "max_stars_repo_licenses": ["MIT", "BSD-... |
"""Test for kernel functionality."""
import functools
import jax
import jax.numpy as jnp
import pytest
import pytest_cases
from probfindiff.utils import autodiff, kernel, kernel_zoo
def case_exponentiated_quadratic():
k = lambda x, y: jnp.exp(-(x - y).dot(x - y))
return kernel.batch_gram(k)[0]
def case_... | {"hexsha": "d066822dc351a3f259080f5f3b9244114f120d9d", "size": 1786, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_utils/test_kernel.py", "max_stars_repo_name": "schmidtjonathan/probfindiff", "max_stars_repo_head_hexsha": "8d7e3fc991d8589ca70dacac9c01ab93d185dd82", "max_stars_repo_licenses": ["MIT"]... |
[STATEMENT]
lemma "r = \<lparr>xpos = xpos r, ypos = ypos r\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. r = \<lparr>xpos = xpos r, ypos = ypos r\<rparr>
[PROOF STEP]
by simp | {"llama_tokens": 92, "file": null, "length": 1} |
(*
Autor(s):
Andrej Dudenhefner (1)
Affiliation(s):
(1) Saarland University, Saarbrücken, Germany
Related Work:
[1] Giannini, Paola, and Simona Ronchi Della Rocca.
"Characterization of typings in polymorphic type discipline."
Proceedings Third Annual Symposium on Logic in Computer... | {"author": "uds-psl", "repo": "coq-synthetic-incompleteness", "sha": "cd7d8490f8542bfe85658c465bcb26b2ed163f53", "save_path": "github-repos/coq/uds-psl-coq-synthetic-incompleteness", "path": "github-repos/coq/uds-psl-coq-synthetic-incompleteness/coq-synthetic-incompleteness-cd7d8490f8542bfe85658c465bcb26b2ed163f53/theo... |
#ifndef LEESA_SEQUENCE_HPP
#define LEESA_SEQUENCE_HPP
#ifdef LEESA_SUPPORTS_VARIADIC_TEMPLATES
#include <typeinfo>
namespace boost {
namespace mpl {
struct null_type {};
template <typename... Arg>
struct vector {};
template <typename V> struct front;
template <typename V> struct pop_front;
template <typename He... | {"hexsha": "d0eb80f17c407af0e211d20965ac606b14919de5", "size": 5236, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/LEESA/Sequence.hpp", "max_stars_repo_name": "sutambe/LEESA", "max_stars_repo_head_hexsha": "fedaf4c0d7887c361d2a79967e3e770f375ddc25", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars... |
import json
import pathlib
from unittest import mock
from click.testing import CliRunner
import numpy as np
import pytest
import yaml
from cabinetry import cli
from cabinetry import fit
class CLIHelpers:
@staticmethod
def write_config(path, config):
with open(path, "w") as f:
yaml.dump(c... | {"hexsha": "9374b07c5864c1bd39bfd940c835254737354bb7", "size": 17161, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/cli/test_cli.py", "max_stars_repo_name": "ExternalRepositories/cabinetry", "max_stars_repo_head_hexsha": "2261b603786dd3a5c5963b4e365d04ff250ba012", "max_stars_repo_licenses": ["BSD-3-Claus... |
\documentclass[letterpaper]{article}
\usepackage{amsmath, amsfonts, amssymb, amsthm}
\usepackage{enumerate,hyperref}
\usepackage[margin=1in]{geometry}
\usepackage[section]{placeins}
\theoremstyle{definition}
\newtheorem{problem}{Problem}
\newtheorem*{lemma}{Lemma}
\newtheorem*{corollary}{Corollary}
\providecommand{... | {"hexsha": "9dd89e7b899168398a25938a30b9ba776b9e0284", "size": 8029, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "contrib/whitepaper/SpellDamage.tex", "max_stars_repo_name": "kmmiles/libclassic", "max_stars_repo_head_hexsha": "d1cfbb110a49677b8cb1cc82231e4931efa02e63", "max_stars_repo_licenses": ["MIT"], "max_s... |
# encoding=utf-8
import unittest
import numpy as np
from ..scorers import *
class TestScorers(unittest.TestCase):
def test_average_precision(self):
y_true = ["perm2", "perm4", "perm8"]
y_pred = ["perm2", "perm3", "perm4", "perm5"]
result = 0.5556
ap = round(average_precision(y_tru... | {"hexsha": "76fc91f63e8d556ca51cc3d48dfa620f7f195db0", "size": 2315, "ext": "py", "lang": "Python", "max_stars_repo_path": "perrec/common/tests/test_scorers.py", "max_stars_repo_name": "Tbabm/PerRec", "max_stars_repo_head_hexsha": "1f711d70df8354156b37857719db0559876be08c", "max_stars_repo_licenses": ["MIT"], "max_star... |
# Optimize.py
# Created: Feb 2016, M. Vegh
# Modified: Aug 2017, E. Botero
# Aug 2018, T. MacDonald
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import SUAVE
if not SUAVE.__version__... | {"hexsha": "6c93e799f7a8b9597023826f6a0d577d4abd80ad", "size": 5635, "ext": "py", "lang": "Python", "max_stars_repo_path": "SUAVE/Tutorials-2.5.0/Regional_Jet_Optimization/Optimize.py", "max_stars_repo_name": "Vinicius-Tanigawa/Undergraduate-Research-Project", "max_stars_repo_head_hexsha": "e92372f07882484b127d7affe305... |
import ghalton
import numpy as np
from src.autoks.distance.sampling.sampler import Sampler
from src.autoks.distance.sampling.scramble import scramble_array
def generate_halton(n: int, d: int):
sequencer = ghalton.Halton(d)
return sequencer.get(n)
def generate_generalized_halton(n: int, d: int):
sequenc... | {"hexsha": "fdb08479b2fdc3089d7f511ea2922e6d46714aa0", "size": 1450, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/autoks/distance/sampling/halton.py", "max_stars_repo_name": "lschlessinger1/MS-project", "max_stars_repo_head_hexsha": "e1c02d1d1a7a2480ff6f14f30625dc42ee3417e3", "max_stars_repo_licenses": ["... |
'''
Classifier : K Nearest Neighbour
Dataset : Play Predictor Dataset
Features : Whether, Temperature
Labels : Yes, No
Training Dataset : 30 Entries
Testing Dataset : 1 Entry
Author : Prasad Dangare
Function Name : MarvellousPredictor
'''
import ... | {"hexsha": "d2c63992fb571e957045b0b1b258a9e62ffc97b9", "size": 1574, "ext": "py", "lang": "Python", "max_stars_repo_path": "Application7/Play_Predictor2.py", "max_stars_repo_name": "PRASAD-DANGARE/Machine_Learning-Applications", "max_stars_repo_head_hexsha": "e2fa540d44993dc0750d95ce6ad686facd3bb769", "max_stars_repo_l... |
import pickle
from collections import deque
import numpy as np
from mher.algos.util import convert_episode_to_batch_major, store_args
class RolloutWorker:
@store_args
def __init__(self, venv, policy, dims, logger, T, rollout_batch_size=1,
exploit=False, use_target_net=False, compute_Q=False,... | {"hexsha": "9c56a3fbad1c99ce1a7d56dfa9fd85ae2cc3a4f8", "size": 6781, "ext": "py", "lang": "Python", "max_stars_repo_path": "mher/rollouts/rollout.py", "max_stars_repo_name": "YangRui2015/Modular_HER", "max_stars_repo_head_hexsha": "77acca83d6849d140ab893ec1b472b71e1da08d4", "max_stars_repo_licenses": ["MIT"], "max_star... |
from time import time
import copy
import numpy
from rmgpy.tools.canteraModel import Cantera
try:
#import muq.libmuqModelling
from libmuqModelling import ModPiece
#import muq.libmuqUtilities as libmuqUtilities
#import muq.libmuqApproximation as libmuqApproximation
from libmuqUtilities impor... | {"hexsha": "38a68cc1c155943adb75f375180abc1512634e90", "size": 19390, "ext": "py", "lang": "Python", "max_stars_repo_path": "rmgpy/tools/muq.py", "max_stars_repo_name": "keceli/RMG-Py", "max_stars_repo_head_hexsha": "17c7870195a4feb6e8bf8974292f9bcdca1a1d9d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m... |
import numpy as np
import matplotlib.pyplot as plt
from random import randint
#TODO: there a a couple of places for optimization:
#1)Calculate accuracy only once per epoch
#2)Incorporate testing accuracy within learning
#Entry point into the program
class MLP:
def __init__(self, hiddenNeurons, beta, mome... | {"hexsha": "582b96cdf6519cb1e74e16c0c21f4a19714f1e7a", "size": 10761, "ext": "py", "lang": "Python", "max_stars_repo_path": "PerceptronTwo.py", "max_stars_repo_name": "gmillia/PerceptronTwo", "max_stars_repo_head_hexsha": "9f2a6add614b04bc5bb9712408df6914d4ee8a52", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
#==============================================================================
# Test for lmer
#==============================================================================
#------------------------------------------------------------------------------
# Because current version of predict.merMod oes not support pre... | {"hexsha": "e6be0fdc3e6681a4dd157d7dc04f7637569aa031", "size": 1125, "ext": "r", "lang": "R", "max_stars_repo_path": "tests/test__model.adapter__function__lmer.r", "max_stars_repo_name": "Marchen/model.adapter", "max_stars_repo_head_hexsha": "ace7f78abee9e2ce2b1ee5e09cc8ac59cea66c3e", "max_stars_repo_licenses": ["MIT"]... |
# 1.
# import math
# # a,b,c = map(float,input('Enter a,b,c:').split(','))
# a,b,c = eval(input('Enter a,b,c:'))
# sum=b*b-4*a*c
# if sum >0:
# r1=(-b+math.sqrt(sum))/2*a
# r2=(-b-math.sqrt(sum))/2*a
# print('The roots are %.2f and %.2f'%(r1,r2))
# elif sum == 0:
# r1=r2=(-b+math.sqrt(sum))/2... | {"hexsha": "f88dde8030042f5fb5cb91f4286dd07bc28d1294", "size": 4879, "ext": "py", "lang": "Python", "max_stars_repo_path": "homework2.py", "max_stars_repo_name": "TiAmolj/Python-By-Joker", "max_stars_repo_head_hexsha": "df37ddfb58c40d68298b4e862ba23671943de8cf", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from datetime import datetime
from datagen import TextgenDatagen
from model import textgen_transformer
text_file = '../datasets/text_generation/deeplearning.txt'
output_path = 'output'
seq_len = 40
performance = 10
datagen = TextgenDatagen()... | {"hexsha": "f08e7af060f51b7676d2c226f1430c8b04776104", "size": 1295, "ext": "py", "lang": "Python", "max_stars_repo_path": "transformer/test_textgen.py", "max_stars_repo_name": "hqbao/dlp_tf", "max_stars_repo_head_hexsha": "e8fe3281470faebbe8e36caf55025c270e84c44f", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing as mp
import os
import re
import time
import ants
import antspynet
import sys
import numpy as np
from utils.HelperFunctions import Imaging, FileOperations
from dependencies import ROOTDIR, FILEDIR, CONFIGDATA
class AntsPyX:
"""this class conta... | {"hexsha": "0ed5811c2ac1b6078b72b90c5cb829fb10ef54f1", "size": 4291, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/BrainExtraction.py", "max_stars_repo_name": "dpedrosac/MRItremor", "max_stars_repo_head_hexsha": "04af7e6024f99ca9392ea40e91650653ede80f9e", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
%% test2.m - exp03
% This script shows histograms for errors computed in test1.m
%
% 02-08-10 Michal Uricar
% 07-03-11 Michal Uricar
% clc;
close all; clearvars;
%% Timestamp
fprintf(1,'Started on %s\n\n', datestr(now));
%% Add path
addpath('./Functions/');
%% Load errors
load('./results/errors.mat');
%% Optio... | {"author": "uricamic", "repo": "flandmark", "sha": "ecf122f93f73504fe7d8faccca525c6b1e98fdcd", "save_path": "github-repos/MATLAB/uricamic-flandmark", "path": "github-repos/MATLAB/uricamic-flandmark/flandmark-ecf122f93f73504fe7d8faccca525c6b1e98fdcd/learning/code/test2.m"} |
"""Documentation for verify_results.py
This script processes class data in order to calculate accuracy, sensitivity etc. on the overall class. This should match results given in our report.
The script prints these values out to screen.
"""
import os
import sys
import argparse
import glob
import json
import numpy... | {"hexsha": "3bf355bdb1566d160b84b6da51219a25d855b192", "size": 7017, "ext": "py", "lang": "Python", "max_stars_repo_path": "verification/verify_results.py", "max_stars_repo_name": "philip-baker/engage", "max_stars_repo_head_hexsha": "dbc4c3278db07fd3b4c678af337a59ab3c319b55", "max_stars_repo_licenses": ["MIT"], "max_st... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools to return the installed astropy and photutils
versions.
"""
def _get_version_info():
"""
Return astropy and photutils versions.
Returns
-------
result : str
The astropy and photutils versions.
... | {"hexsha": "83e41a4b98d43d13f6d459129449314667986afa", "size": 516, "ext": "py", "lang": "Python", "max_stars_repo_path": "photutils/utils/_misc.py", "max_stars_repo_name": "Onoddil/photutils", "max_stars_repo_head_hexsha": "433f3e54d3f53282ae04eadde9e1ddf657944590", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
# coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import tensorflow_probability as tfp
from tensorflow.python.ops import control_flow_util
from tensorflow.python.framework import function
class Layer... | {"hexsha": "bd067621c090fe6dea528b16cd897c6d555597bc", "size": 13635, "ext": "py", "lang": "Python", "max_stars_repo_path": "pct/layers/common_layers.py", "max_stars_repo_name": "EstelleHuang666/mini_transformer", "max_stars_repo_head_hexsha": "dc6fc270c573e613bc2f5cad62534c6416e7dbd5", "max_stars_repo_licenses": ["MIT... |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as pl
#%% Q1 setup
def binomial(n, p, N):
return np.math.factorial(N)/(np.math.factorial(n)*np.math.factorial(N-n))*(p**n)*((1-p)**(N-n))
def uniform(n, p, N):
return 1/(N+1)
def KL(p, N, distp, distq):
kl = 0
for n in... | {"hexsha": "15cb5eb58f68cbe18e3650e64391ce786f96e5b7", "size": 2372, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/info_ps3.py", "max_stars_repo_name": "adrielyeung/info-theory", "max_stars_repo_head_hexsha": "89863cf5d704c4c6396647d29d6e0446e8627c4b", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
@typeparams struct MutableBinaryHeapWithReduction
v::{}
r::{}
k2i::{}
i2k::{}
order::{<:Ordering}
reduce::{}
end
function MutableBinaryHeapWithReduction(
v,
r = Vector{eltype(v)}(undef, length(v)),
i2k = nothing,
k2i = nothing;
reduce,
lt = isless,
by = identity,
... | {"hexsha": "4592f316d672b9e88a34f0f7464e83514c5a7a7e", "size": 1525, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/MutableBinaryHeapsWithReduction.jl", "max_stars_repo_name": "synchronoustechnologies/BinaryHeaps.jl", "max_stars_repo_head_hexsha": "01066c3a451c25d004111a277e82e72ff3e57332", "max_stars_repo_l... |
"""doc
# leanai.data.datasets.images_in_classfolders_dataset
> An implementation of a dataset where the images are stored in folders which have the class names.
"""
from typing import NamedTuple
import numpy as np
import os
import cv2
from leanai.core.definitions import SPLIT_TRAIN, SPLIT_VAL, SPLIT_TEST
from leanai.d... | {"hexsha": "c28d7fc7bea8044400eeb7bb8953475caa79402d", "size": 2265, "ext": "py", "lang": "Python", "max_stars_repo_path": "leanai/data/datasets/images_in_classfolders_dataset.py", "max_stars_repo_name": "penguinmenac3/leanai", "max_stars_repo_head_hexsha": "6d26575b248ff03c4a24009cd82f26ea99d96d15", "max_stars_repo_li... |
import numpy as np
from mex.simplex.simplex_networks import create_matrix
from mex.simplex.problem_definition import constrain, obj, maxz
from mex.utils.general import generates_matrix, generate_tableau
class Maximizer():
"""
Maximize the objective function
Args:
A (matrix):
b (vector):... | {"hexsha": "98f8a4a4522d2cfb50c98971dd6d6db35d37bd27", "size": 1842, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/mex/simplex/maximizer_class.py", "max_stars_repo_name": "lecepe00/mex_simplex", "max_stars_repo_head_hexsha": "ab103bc7df4a8fa73daac4469c50eae43a55ffca", "max_stars_repo_licenses": ["MIT"], "m... |
C$Procedure VRELG ( Vector relative difference, general dimension )
DOUBLE PRECISION FUNCTION VRELG ( V1, V2, NDIM )
C$ Abstract
C
C Return the relative difference between two vectors of general
C dimension.
C
C$ Disclaimer
C
C THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
C CALIFOR... | {"hexsha": "9c58e70092f6281ff284b5927daa505370d2e59c", "size": 6897, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "source/nasa_f/vrelg.f", "max_stars_repo_name": "agforero/FTFramework", "max_stars_repo_head_hexsha": "6caf0bc7bae8dc54a62da62df37e852625f0427d", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
from __future__ import division
import numpy as np
import audio_producer
class SpeechModelState(object):
def __init__(self, rnn_state):
self.rnn_state = rnn_state
self.audio = None
self.frames = None
class StreamingSpeechModel(object):
def __init__(self, model, session, sample_rate... | {"hexsha": "fa0e5d55619271248ee3cf7604e4c4e552774b72", "size": 2218, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/streaming_model.py", "max_stars_repo_name": "gaoyiyeah/KWS-CTC", "max_stars_repo_head_hexsha": "28fdc2062281996d6408e41a9b49febf3334d730", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
'''subcommands/test.py'''
"""
Test auto-editor and make sure everything is working.
"""
# Internal Libraries
import os
import sys
import shutil
import platform
import subprocess
from time import perf_counter
# Included Libraries
from auto_editor.utils.func import clean_list
from auto_editor.utils.log import Log
impo... | {"hexsha": "1097b5f938fd62a01fd454f2bb4776ac3de503a3", "size": 20010, "ext": "py", "lang": "Python", "max_stars_repo_path": "auto_editor/subcommands/test.py", "max_stars_repo_name": "dunganau/auto-editor", "max_stars_repo_head_hexsha": "bdfd8b955f0b35c2061d0f5a9e7d500ee5bf0ec7", "max_stars_repo_licenses": ["Unlicense"]... |
\section{Memo}
\memoto{\LaTeX{}studio}
\memofrom{Liam Huang}
\memosubject{Happy \TeX{}ing!}
\memodate{\today}
\memologo{\includegraphics{SUSTeX.pdf}}
\begin{memo}[Memorandum]
hello world.
\end{memo} | {"hexsha": "db19cbceb633746dc314aed38b78cf089e911edc", "size": 200, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Contest/2019MCM/sections/memo.tex", "max_stars_repo_name": "iydon/homework", "max_stars_repo_head_hexsha": "253d4746528ef62d33eba1de0b90dcb17ec587ed", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
"""
Chronological Ephemeris
-----------------------
Collate ephemeris data generated by :mod:`~embers.sat_utils.sat_ephemeris` for multiple satellites
and determine all ephemeris present in 30 minute observation windows.
"""
import json
import math
from datetime import datetime, timedelta
from pathlib import Path
i... | {"hexsha": "a5944c3b14e12f3fbf204368d643a204ab407840", "size": 11870, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/embers/sat_utils/chrono_ephem.py", "max_stars_repo_name": "amanchokshi/mwa-satellites", "max_stars_repo_head_hexsha": "f9e8de353e7eddf28ed715c01d7d3fb5336f0f18", "max_stars_repo_licenses": ["... |
import json
import os
import copy
import numpy as np
import torch
import json
from deer.experiment.base_controllers import Controller
from deer.helper.exploration import calculate_scores
from deer.helper.knn import ranked_avg_knn_scores, batch_count_scaled_knn
from deer.helper.pytorch import device, calculate_large_bat... | {"hexsha": "fc471332781a7d06c92ac28ac92f54b4d03d57c8", "size": 36701, "ext": "py", "lang": "Python", "max_stars_repo_path": "nsrl/experiment/exploration_helpers.py", "max_stars_repo_name": "taodav/novelty-search-repr-space", "max_stars_repo_head_hexsha": "461691104dc3a72b9b4f7ec040b71d95eec434b1", "max_stars_repo_licen... |
module mod_uscr_insert_entries
use blas_sparse_namedconstants
use mod_uscr_insert_entry
interface uscr_insert_entries
module procedure iuscr_insert_entries
module procedure suscr_insert_entries
module procedure duscr_insert_entries
module procedure cuscr_insert_entries
module procedure zuscr_insert_entri... | {"hexsha": "6ab27a70417d129795006070c4c6ee92dba139d5", "size": 4193, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "ext/SOFTWARE/uscr_insert_entries.f90", "max_stars_repo_name": "ittnas/qsc", "max_stars_repo_head_hexsha": "5e23c7f0c2985d79b966f8301a17c2679a5f2c8d", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""Script for testing reference files
Usage:
test_ref_file <ref_file> <db_path> [--data=<fname>] [--max_matches=<match>] [--num_cpu=<n>] [--email=<addr>]
Arguments:
<db_path> Absolute path to database.
<file_path> Absolute path to fits file to add.
Options:
-h --help Show this scre... | {"hexsha": "a18a0ee0c1ce7e33f0f4c2e963ca051451745735", "size": 11316, "ext": "py", "lang": "Python", "max_stars_repo_path": "reference_file_testing_tool/reftest.py", "max_stars_repo_name": "pllim/reference-file-testing-tool", "max_stars_repo_head_hexsha": "f6ee7b6d306904c29b6321c738d8ac76c0a75157", "max_stars_repo_lice... |
import numpy as np
import performance
import dislib as ds
from dislib.cluster import KMeans
def main():
n_samples = 300000000
n_chunks = 1536
chunk_size = int(np.ceil(n_samples / n_chunks))
n_features = 100
n_clusters = 500
x = ds.random_array((n_samples, n_features), (chunk_size, n_features... | {"hexsha": "b95289e3fa4abc5ccb9d1ebede12d6348bcc14d8", "size": 485, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/performance/mn4/tests/kmeans.py", "max_stars_repo_name": "alexbarcelo/dislib", "max_stars_repo_head_hexsha": "989f81f235ae30b17410a8d805df258c7d931b38", "max_stars_repo_licenses": ["Apache-2.... |
from __future__ import division
import os
import warnings
import numpy as np
import matplotlib.pyplot as plt
# This is our custom tesseroid code
from tesseroid_density import tesseroid
# Define functions
def density_function(height):
return np.exp(b_factor * height / thickness)
def normalized_density(height):
... | {"hexsha": "f956102eab5914d0a147a2b36b4f9dc634af118d", "size": 5597, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/scripts/density-based-discretization.py", "max_stars_repo_name": "pinga-lab/tesseroid-variable-density", "max_stars_repo_head_hexsha": "7fae8a2d6df645d64ce940f98273aef256de2e38", "max_stars_r... |
import numpy as np
import pytest
import shetar
# =================== Test input paramaters ===================
@pytest.fixture(scope='module', params=[3, 5])
def input_order(request):
return request.param
@pytest.fixture(scope='module', params=[3, 5])
def output_order(request):
return request.param
@pytes... | {"hexsha": "d0cb6f418b1a2705ede6f3874efa0f10f0b88ca1", "size": 8819, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_broadcasting.py", "max_stars_repo_name": "AppliedAcousticsChalmers/Spherical-Helmholtz-Translation-and-Rotation", "max_stars_repo_head_hexsha": "84c5b51dab5d7ee26886ece44945a5d887bff369... |
from CTL._tree import _CausalTree
from CTL.causal_tree.sig_diff.sig_base import SigTreeBase
from CTL.causal_tree.sig_diff.sig_val import SigTreeVal
import numpy as np
class SigDiffTree(_CausalTree):
def __init__(self, alpha=0.05, min_size=2, max_depth=-1, val=False, split_size=0.5, seed=724):
super().__i... | {"hexsha": "0d9db95cc410ba47e887550291f1af66c26dabd5", "size": 1053, "ext": "py", "lang": "Python", "max_stars_repo_path": "CTL/sig_diff_tree.py", "max_stars_repo_name": "Youngyi/CTL", "max_stars_repo_head_hexsha": "3dc578b17adf7ddc4eecb5630ed96b3693c53f68", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 38, "m... |
function TestCart()
nx=4;
nz=4;
xL=0;
xU=10;
zL=0;
zU=10;
Boundary.BT='FreeSlip';
Boundary.WE='FreeSlip';
Param.hS='AgnesiCart';
Param.hC=1;
Param.x0C=5;
Param.aC=1;
Param.Grid=CartGrid(nx,nz,xU-xL,zU-zL,xL,zL,OrientFaceCart,Boundary,Param);
DG.OrdPoly=2;
DG.OrdPolyX=2;
DG.OrdPolyY=2;
[DG.w,DG.xw]=GaussLobattoQuad(DG... | {"hexsha": "cc59fd4174fb96f82094bbd11ffd01d82923c71a", "size": 994, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/Grid/TestCart.jl", "max_stars_repo_name": "CliMA/CGDycore.jl", "max_stars_repo_head_hexsha": "77297631f8db7775f19daee2d7ac75bc810d9c11", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co... |
from icecream import ic
import os
import logging
from tqdm import tqdm
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
from keras.applications.vgg16 import preprocess_input
from keras.applications.vgg16 import VGG16
from keras.models import Model
from sklearn.decompos... | {"hexsha": "c9fece490a04a2b45746fbfde25162086b4d1b43", "size": 2000, "ext": "py", "lang": "Python", "max_stars_repo_path": "clustering.py", "max_stars_repo_name": "rtkfan/image-clusters", "max_stars_repo_head_hexsha": "18a7aa26079c91c960c1f615c8951e3dd60522ac", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
\chapter{Linear time invariant DT systems}
\section{DT system representations}
We can mathematically represent, or model, DT systems multiple ways.
\begin{itemize}
\item purely mathematically - in time domain we will use
\begin{itemize}
\item linear, constant coefficient difference equations, e.g.
\[
y[... | {"hexsha": "69205f3c6817950eb3739d47257b41c7cc0fc520", "size": 6831, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "07-dt-lti.tex", "max_stars_repo_name": "clwyatt/notes-2714", "max_stars_repo_head_hexsha": "4715455db62b5455a05e274f25c5b9fb21ed7573", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_count": nu... |
import numpy as np
from py_wake.site._site import UniformWeibullSite
from py_wake.wind_turbines import WindTurbine
from py_wake.wind_turbines.power_ct_functions import PowerCtTabular
wt_x = [423974, 424042, 424111, 424179, 424247, 424315, 424384, 424452, 424534,
424602, 424671, 424739, 424807, 424875, 424944, ... | {"hexsha": "1ca8a437f28d9fb8bf111391ff260642ec9facaf", "size": 5398, "ext": "py", "lang": "Python", "max_stars_repo_path": "py_wake/examples/data/hornsrev1.py", "max_stars_repo_name": "aemoser/PyWake", "max_stars_repo_head_hexsha": "889a2c10882195af21339e9bcf2ede0db9b58319", "max_stars_repo_licenses": ["MIT"], "max_sta... |
section \<open>Implementation\<close>
theory Affine_Code
imports
Executable_Euclidean_Space
Affine_Approximation
begin
text \<open>Implementing partial deviations as sorted lists of coefficients.\<close>
subsection \<open>Reverse Sorted, Distinct Association Lists\<close>
typedef (overloaded) ('a, 'b) slis... | {"author": "rizaldialbert", "repo": "overtaking", "sha": "0e76426d75f791635cd9e23b8e07669b7ce61a81", "save_path": "github-repos/isabelle/rizaldialbert-overtaking", "path": "github-repos/isabelle/rizaldialbert-overtaking/overtaking-0e76426d75f791635cd9e23b8e07669b7ce61a81/Affine_Arithmetic/Affine_Code.thy"} |
fahrenhetToRankine(f) = f+460.0
rankineToFahrenheit(r) = r-460.0
| {"hexsha": "85ed0fc96a26a059582de18cd7407aac91264831", "size": 65, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/UnitConversions.jl", "max_stars_repo_name": "leytzher/Shot", "max_stars_repo_head_hexsha": "b35d2dab13e74dc1cd251197029ae31d291fdbe4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
import cv2
import numpy as np
def F1_score_128(pred_lines_128_list, gt_lines_128_list, thickness=3):
"""
@brief heat F1 score, draw the lines to a 128 * 128 img
@pred_lines_128 [ [x0, y0, x1, y1], ... ]
@gt_lines_128_list [ [x0, y0, x1, y1], ... ]
"""
pred_heatmap = np.zeros((128, 128), ... | {"hexsha": "b9cb8c75a2a348b538f652c3c9d599c2687a7bc3", "size": 3249, "ext": "py", "lang": "Python", "max_stars_repo_path": "mlsd_pytorch/metric.py", "max_stars_repo_name": "michelebechini/mlsd_pytorch", "max_stars_repo_head_hexsha": "fa7dcd10dd1f4e12f33df027c14950c8b655ff06", "max_stars_repo_licenses": ["Apache-2.0"], ... |
Require Import Coq.ZArith.ZArith.
Require Import Crypto.Arithmetic.PrimeFieldTheorems.
Require Import Crypto.Specific.montgomery32_2e384m5x2e368m1_12limbs.Synthesis.
Local Open Scope Z_scope.
(* TODO : change this to field once field isomorphism happens *)
Definition nonzero :
{ nonzero : feBW_small -> BoundedWord.B... | {"author": "anonymous-code-submission-01", "repo": "sp2019-54-code", "sha": "8867f5bed0821415ec99f593b1d61f715ed4f789", "save_path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code", "path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code/sp2019-54-code-8867f5bed0821415ec99f593b1d61f715ed4f7... |
[GOAL]
a b : ℕ
⊢ a ≠ b ↔ ↑a ≠ ↑b
[PROOFSTEP]
simp only [ne_eq, Int.cast_eq_cast_iff_Nat]
| {"mathlib_filename": "Mathlib.Tactic.Zify", "llama_tokens": 55} |
import pandas as pd
import argparse
import matplotlib.pyplot as plt
import numpy as np
import json
import os
from sklearn.metrics import r2_score
from scipy import stats
def _check_col_type(df, col, df_type):
"""
Each column we are working with should be of type "float".
Checks to ensure this is true, ot... | {"hexsha": "b662cf9f9b3f3ecc04ab5da7ce06bd1dd14072c0", "size": 7740, "ext": "py", "lang": "Python", "max_stars_repo_path": "UQ_analysis.py", "max_stars_repo_name": "opnbnch/chemprop", "max_stars_repo_head_hexsha": "b7c364b108b3421c2bd5a135233f6e36d9cb32cc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max... |
import argparse
import json
import logging
import os
import threading
import time
import traceback
import colors
import docker
import numpy
import psutil
from benchmark.algorithms.definitions import (Definition,
instantiate_algorithm)
from benchmark.datasets import DATAS... | {"hexsha": "4d139b3ffc4bb348f4692df50106d246f1b00442", "size": 9459, "ext": "py", "lang": "Python", "max_stars_repo_path": "benchmark/runner.py", "max_stars_repo_name": "uoynac/big-ann-benchmarks", "max_stars_repo_head_hexsha": "8180e0e6ea5b8e36f76c5e34728116f0de23c05e", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
from __future__ import division, print_function, absolute_import
from keras.models import Sequential, model_from_json
from keras.layers import (
Dense,
Dropout,
Flatten,
Conv3D,
MaxPool3D,
BatchNormalization,
Input,
)
from keras.optimizers import RMSprop
from keras.preprocessing.image impor... | {"hexsha": "361fc87f4c863c6062becf7fd2fecbbb22dd8df8", "size": 4179, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/starter-code/cnn3d.py", "max_stars_repo_name": "kiat/debs2019", "max_stars_repo_head_hexsha": "b1231a0995a154f8549ef23a00f635b81cc3c689", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
using compost
using SafeTestsets
using DataFrames
using Test
# Test functions that calculate comparative advantage: ==============
@safetestset "Comparative advantage tests" begin include(normpath(@__DIR__, "test/comparative-advantage-tests.jl")) end
# Test functions the calculate similarity and distance measures: ==... | {"hexsha": "c1934fdf3c3c29c46ef36c5e585693c6a1d05812", "size": 692, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "sbpost/compost", "max_stars_repo_head_hexsha": "616d1e123bea38ef5adbcdcf857b6f0b8ddbca44", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
import numpy as np
import tensorflow as tf
import tensorflow.keras.layers as layers
from tensorflow_graphics.rendering.camera import perspective
from scipy.spatial import Delaunay
from utils.matrix_util import *
from model.nerf import RadianceField, RadianceFieldBase, PositionalEncoding
class MLPDecomposition(tf.M... | {"hexsha": "89ee967e8967904c61b688c5bb87005b18f20294", "size": 15168, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/derf.py", "max_stars_repo_name": "ubc-vision/derf", "max_stars_repo_head_hexsha": "f8f1704fc01ddb42fa2c4853f8bb7607611982b4", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 2... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import os
import json
import uuid
import numpy as np
from os.path import join as pjoin
from typing import Optional, Mapping, Dict, Union
from numpy.random import RandomState
from textworld import g_rng
from textworld.utils... | {"hexsha": "0f300807fa5fd162adfdda680f152286f93afa1c", "size": 8436, "ext": "py", "lang": "Python", "max_stars_repo_path": "textworld/generator/__init__.py", "max_stars_repo_name": "HakiRose/TextWorld", "max_stars_repo_head_hexsha": "2b38411e6492ac0e57d8c89482c1b36ff2f20067", "max_stars_repo_licenses": ["MIT"], "max_st... |
# -*- coding:utf-8 -*-
"""
获取疫情数据接口
# Created on 2021/12/15
# @author: WHT
# @group : datafactory
# @contact: whtsf@foxmail.com
"""
from __future__ import division
import time
import json
import re
import pandas as pd
import numpy as np
from datafactory.disease import cons as ct
from datafactory.util import dateu... | {"hexsha": "e9ca5f89ee9d57cdfb50340032757262397d228c", "size": 4415, "ext": "py", "lang": "Python", "max_stars_repo_path": "datafactory/disease/ncov.py", "max_stars_repo_name": "taotaotututu/ncov_data", "max_stars_repo_head_hexsha": "58a40ac4b66d93f1a75a10907ae82f2cadb40d02", "max_stars_repo_licenses": ["MIT"], "max_st... |
"""
Implementation of a class for the analysis of hyperfine structure spectra with isomeric presence.
.. moduleauthor:: Wouter Gins <wouter.gins@kuleuven.be>
.. moduleauthor:: Ruben de Groote <ruben.degroote@kuleuven.be>
"""
import copy
import lmfit as lm
from satlas.models.basemodel import BaseModel
from satlas.utili... | {"hexsha": "877407b4f1a20c7b7217501244fa98f72198eb5d", "size": 10710, "ext": "py", "lang": "Python", "max_stars_repo_path": "satlas/models/summodel.py", "max_stars_repo_name": "woutergins/SATLAS", "max_stars_repo_head_hexsha": "2f7a4be557165f8f7f12e5cace71881b0046c19d", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import torch
import numpy as np
def generate_field(f, xi, H, W, el, roll, device):
u0 = W / 2.
v0 = H / 2.
grid_x, grid_y = torch.meshgrid(torch.arange(0, W).float().to(device), torch.arange(0, H).float().to(device))
x_ref = 1
y_ref = 1
X_Cam = (grid_x - u0) / f
Y_Cam = -(grid_y - v0) /... | {"hexsha": "b7bf2337745fc5b8c00536784df58abcdacc4e41", "size": 3909, "ext": "py", "lang": "Python", "max_stars_repo_path": "RELEASE_ScaleNet_minimal/utils/compute_vectors.py", "max_stars_repo_name": "Jerrypiglet/scalenet", "max_stars_repo_head_hexsha": "6a5db480e650d10d1e575e93b6cee366d1912c8a", "max_stars_repo_license... |
[STATEMENT]
lemma BSIA_implies_SIA_for_modified_view :
"\<lbrakk>BSIA \<rho>' \<V>' Tr\<^bsub>ES\<^esub>; \<V>' = \<lparr> V = V\<^bsub>\<V>\<^esub> \<union> N\<^bsub>\<V>\<^esub> , N = {} , C = C\<^bsub>\<V>\<^esub> \<rparr>; \<rho> \<V> = \<rho>' \<V>'\<rbrakk> \<Longrightarrow> SIA \<rho> \<V> Tr\<^bsub>ES\<^esub... | {"llama_tokens": 10006, "file": "Modular_Assembly_Kit_Security_Verification_Basics_BSPTaxonomy", "length": 46} |
#include <catch.hpp>
#include <random>
#include <vector>
#include <Eigen/Core>
#include <torch/torch.h>
#include <renderer_utils.cuh>
#include <losses.h>
#include "check_adjoint.h"
#include "test_utils.h"
//namespace std {
// template < class T >
// inline std::ostream& operator << (std::ostream& os, const std::vecto... | {"hexsha": "323695eceedbfdf3eaf8623e53e318cddcf55302", "size": 7557, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "unittests/testMath.cpp", "max_stars_repo_name": "shamanDevel/DiffDVR", "max_stars_repo_head_hexsha": "99fbe9f114d0097daf402bde2ae35f18dade335d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
from whoosh.analysis import *
from whoosh.index import create_in
from whoosh.qparser import *
from whoosh.fields import *
from whoosh import scoring
from whoosh import index
import csv
import statistics
import numpy as np
import matplotlib.pyplot as plt
import math
import itertools
def mrr(gt, se):
sum = 0
fo... | {"hexsha": "c18e202e8868f0b62a06a735c9a14bdf191ff0a3", "size": 11939, "ext": "py", "lang": "Python", "max_stars_repo_path": "search-engine-evaluation/search_engine.py", "max_stars_repo_name": "NefeliTav/Search-Engine-Evaluation", "max_stars_repo_head_hexsha": "bdc8ceb316448ad334410e5f8ef227f355ef4e3b", "max_stars_repo_... |
import numpy as np
import numba
def argminrelmin(a, axis=None, out=None):
"""
Return the index of the minimum relative minimum.
A relative minimum is an element which is lower than its neigbours, or the
central element of a series of contiguous elements which are equal to each
other and lower ... | {"hexsha": "7ec48a0f363eabb9a7a6c34e8887127b116f69ca", "size": 2468, "ext": "py", "lang": "Python", "max_stars_repo_path": "argminrelmin.py", "max_stars_repo_name": "Gattocrucco/sipmfilter", "max_stars_repo_head_hexsha": "74215d6c53b998808fc6c677b46030234d996bdf", "max_stars_repo_licenses": ["CC-BY-4.0", "MIT"], "max_s... |
import json
import numpy as np
from scipy.stats import norm
import math
from scipy.linalg import cholesky
# Basis function of the Metalog
def basis(y,t) -> int:
ret = 0
if(t == 1):
ret = 1
elif(t == 2):
ret = math.log(y/(1-y))
elif(t == 3):
ret = (y-0.5)*math.log(y... | {"hexsha": "63e47d2bbbcdee82ca4174d723ee168377b4ca25", "size": 9703, "ext": "py", "lang": "Python", "max_stars_repo_path": "PySIP/chanceCalc.py", "max_stars_repo_name": "knownboyofno/PySIPmath", "max_stars_repo_head_hexsha": "22521d0acaa74250fb7684b8eedbb3e6d044b4af", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
[STATEMENT]
lemma lnull_inf_step2inf_step_table [simp]:
"lnull (inf_step2inf_step_table s tls) \<longleftrightarrow> lnull tls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lnull (inf_step2inf_step_table s tls) = lnull tls
[PROOF STEP]
by(simp add: inf_step2inf_step_table_def) | {"llama_tokens": 122, "file": "JinjaThreads_Framework_LTS", "length": 1} |
import os
import math
import time
import numpy as np
from skimage.io import imread
from skimage.measure import regionprops,label
from skimage.transform import resize
from . import DataGenerator
class ArtefactGenerator(DataGenerator):
def __init__(self, **kwargs):
super().__init__(**kwargs)
if( s... | {"hexsha": "71930c4b619a1ba71c114df5c68c0a46667e3871", "size": 5379, "ext": "py", "lang": "Python", "max_stars_repo_path": "generator/ArtefactGenerator.py", "max_stars_repo_name": "adfoucart/deephisto", "max_stars_repo_head_hexsha": "f70fbaad9f95a9b9f2e420c9c33d46bdfab5bdf9", "max_stars_repo_licenses": ["MIT"], "max_st... |
import string
import chainer
import cupy as cp
class HashMap(object):
def __init__(self, data, table_size=2 ** 24):
xp = chainer.cuda.get_array_module(data)
self.hash_factor = 2531011
self.batch_size, self.num_points, self.dim = data.shape
self.table_size = table_size
sel... | {"hexsha": "c69f919f46a55ba2e415d6d53ba8fb4152802e1a", "size": 5862, "ext": "py", "lang": "Python", "max_stars_repo_path": "fast_gaussian_filter/hash_table.py", "max_stars_repo_name": "hiroharu-kato/fast_gaussian_filter", "max_stars_repo_head_hexsha": "2ffc62c8ba1d7bf9559559e102a8eb84bf3a65dc", "max_stars_repo_licenses... |
push!(LOAD_PATH,"../src/") # load module from local directory
using TheDancer
N, Edisorder, Jdisorder, modelJ, B, dipolestrength, r = init!(50, 0.0, 0.0, 0.001, 298, 7.5)
function main()
SCFcycles=200
Unitarycycles=500
for dampening in [0.07,0.025,0.05]
SCFthenUnitary(dampening, SCFcycles, Uni... | {"hexsha": "aea4ce5482ce76a9f00f1fb9c0119ee58d43fe03", "size": 424, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "example/example.jl", "max_stars_repo_name": "jarvist/1D-TimeDependentPolaron", "max_stars_repo_head_hexsha": "e71e52ae58b6c9a5ad81cfe33f4017e1b7ba8cc1", "max_stars_repo_licenses": ["MIT"], "max_star... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 8 17:42:34 2018
@author: Arvinder Shinh
"""
import numpy as np
import matplotlib.pyplot as plt
# returns 10 evenly spaced samples from 0.1 to 2*PI
x = np.linspace(2, 2 * np.pi, 30)
G = np.zeros_like(x)
F = lambda x: np.exp(x)
fig, vax = plt.subplots(1, 1, figsize=(6, 3... | {"hexsha": "89a380ab066a1a3a8d9c934bb8df157cac4c3255", "size": 453, "ext": "py", "lang": "Python", "max_stars_repo_path": "Mandatory Documents/plot.py", "max_stars_repo_name": "arvindershinh/ExponentialWave", "max_stars_repo_head_hexsha": "0b79f84bd7ae64b60758e05b623e7d00c04670bf", "max_stars_repo_licenses": ["MIT"], "... |
import sys
import os
import argparse
# import numpy as np
# import pandas as pd
from fr.tagc.rainet.core.util.exception.RainetException import RainetException
from fr.tagc.rainet.core.util.log.Logger import Logger
from fr.tagc.rainet.core.util.time.Timer import Timer
# from fr.tagc.rainet.core.util.subprocess.Subpro... | {"hexsha": "6a4a1c3b01d8d5b2201ec3fb056073f4c13c3d81", "size": 13789, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/fr/tagc/rainet/core/execution/analysis/EnrichmentAnalysis/ParseLnc2cancer.py", "max_stars_repo_name": "TAGC-Brun/RAINET-RNA", "max_stars_repo_head_hexsha": "4d5a6658c41d4ab28d7c3d168eed65fe79... |
import os
import numpy as np
import deepchem as dc
import pandas as pd
from rdkit import Chem
def load_pdbbind_labels(labels_file):
"""Loads pdbbind labels as dataframe
Parameters
----------
labels_file: str
Location of PDBbind datafile.
Returns
-------
contents_df: pd.DataFrame
Dataframe cont... | {"hexsha": "382c14a2b76bec4d3631cd2a96f55007ad7cab3f", "size": 2090, "ext": "py", "lang": "Python", "max_stars_repo_path": "contrib/atomicconv/splits/pdbbind_temporal_split.py", "max_stars_repo_name": "cjgalvin/deepchem", "max_stars_repo_head_hexsha": "64993a129e7f0f78fed9500298b1828ac8a0757a", "max_stars_repo_licenses... |
[STATEMENT]
lemma AE_restr_to_subalg:
assumes "subalgebra M F"
"AE x in (restr_to_subalg M F). P x"
shows "AE x in M. P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. almost_everywhere M P
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. almost_everywhere M P
[PROOF STEP]
obtai... | {"llama_tokens": 1513, "file": null, "length": 17} |
module Main
main : IO()
main = putStrLn "Hello world" | {"hexsha": "50e1db5ee36147f4132e1c7f56590b8b2910fdbb", "size": 53, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "fp/idris/tutorial/src/hello.idr", "max_stars_repo_name": "lonelyhentai/workspace", "max_stars_repo_head_hexsha": "2a996af58d6b9be5d608ed040267398bcf72403b", "max_stars_repo_licenses": ["MIT"], "max_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.