text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: donglee # environment:python2.7 import numpy as np import math def ini_velocity(K_B, N, D, T, m): # 初始化速度函数;速度分布要求符合玻尔兹曼分布条件且满足能量均分定理 """ :param K_B: Boltzmann's constant K_B波尔兹曼常数 :param N: number of atoms in the system N系统里的总原子...
{"hexsha": "5281484a9662f7e788127f826430446a927bfffb", "size": 1209, "ext": "py", "lang": "Python", "max_stars_repo_path": "initialize_velocity.py", "max_stars_repo_name": "donglee-afar/-", "max_stars_repo_head_hexsha": "5e976305c5d153f172cff8bc5cac17bae3fd9220", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4...
#!/usr/bin/env python import argparse import itertools import math import subprocess import tqdm from pathlib import Path import numpy as np def make_numerical_tex_string(step, input_size, output_size, padding, kernel_size, stride, dilation, mode): """Creates a LaTeX string for a numerical convolution animation....
{"hexsha": "208ad413671362427dcc1f64f133826bd3bdd51f", "size": 27686, "ext": "py", "lang": "Python", "max_stars_repo_path": "produce_figure.py", "max_stars_repo_name": "Jarvis73/conv_arithmetic", "max_stars_repo_head_hexsha": "2302f15aabcaa395d25bf34d522a6c635fa680ea", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
/** * @file core/data/has_serialize.hpp * @author Ryan Curtin * * This file contains the HasSerialize struct, which can be used to detect * whether or not a type is serializable. * * mlpack is free software; you may redistribute it and/or modify it under the * terms of the 3-clause BSD license. You should have...
{"hexsha": "c6bd8dadfa428edf26b5cb7f676ee6066ce1d014", "size": 2245, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/mlpack/core/data/has_serialize.hpp", "max_stars_repo_name": "gaurav-singh1998/mlpack", "max_stars_repo_head_hexsha": "c104a2dcf0b51a98d9d6fcfc01d4e7047cc83872", "max_stars_repo_licenses": ["BSD-...
import json import requests import numpy as np from indicoio import JSON_HEADERS base_url = lambda c: "http://api.indico.io/%s" % c def facial_features(face): data_dict = json.dumps({"face": face}) response = requests.post(base_url("facialfeatures"), data=data_dict, headers=JSON_HEADERS) response_dict =...
{"hexsha": "dffc88f3d3e9e88bdd8d051a3809adcc737727bf", "size": 387, "ext": "py", "lang": "Python", "max_stars_repo_path": "indicoio/images/features.py", "max_stars_repo_name": "JoseRoman/IndicoIo-python", "max_stars_repo_head_hexsha": "4fe2952df45c26392f36acd8b43391dfc50e140b", "max_stars_repo_licenses": ["MIT"], "max_...
```python # this file combare the result between SEN_model and Triplet_LSTM_model # by using different SongParts which filted form [3,10] in the sameSong # remeber to normalize the song part ``` ```python import numpy as np import librosa import glob import os from random import randint import torch import torch.nn a...
{"hexsha": "74b18fc9938f53b36cc8df9c6fb354fad5558738", "size": 22387, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "Different_SongParts_Test.ipynb", "max_stars_repo_name": "ISCASTEAM/Sequencing-the-musical-sections", "max_stars_repo_head_hexsha": "0d02e1260b83fde8b9b18fa6fd8ebe29ce3bc15f", "max_st...
! { dg-do run } ! PR17286 ! Namelist read failed when spaces exist between the '=' and the numbers ! This is a libgfortran bug ! Derived from testcase provided by Paul Thomas <paulthomas2@wanadoo.fr> program bug3 integer num1 , num2 , num3 , num4 data num3 / 42 / data num4 / 56 / n...
{"hexsha": "e9beb6d375d4e12841cf40617677c823c7004d00", "size": 1114, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/CompileTests/Fortran_tests/gfortranTestSuite/gfortran.dg/pr17286.f90", "max_stars_repo_name": "maurizioabba/rose", "max_stars_repo_head_hexsha": "7597292cf14da292bdb9a4ef573001b6c5b9b6c0",...
""" ======================================================================================== TRACK-ORIENTED-(MULTI-TARGET)-MULTI-HYPOTHESIS-TRACKER (with Kalman Filter and PV-model) by Erik Liland, Norwegian University of Science and Technology Trondheim, Norway Spring 2017 =============================================...
{"hexsha": "cd1a64c21027503d903336b410f85d684dbb8c00", "size": 74269, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymht/tracker.py", "max_stars_repo_name": "erikliland/TTK4550-Python", "max_stars_repo_head_hexsha": "58b2cd13a3fb38563a302c0f8380de3a5b0fccb1", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_...
function gen_rho( dr, σ1, σ2 ) Npoints = size(dr)[1] rho = Array{Float64}(undef,Npoints) c1 = 2*σ1^2 c2 = 2*σ2^2 cc1 = sqrt(2*pi*σ1^2)^3 cc2 = sqrt(2*pi*σ2^2)^3 for ip=1:Npoints g1 = exp(-dr[ip]^2/c1)/cc1 g2 = exp(-dr[ip]^2/c2)/cc2 rho[ip] = g2 - g1 end return...
{"hexsha": "23eea114f37a590541fc6f9986c6c2df70c04a5a", "size": 329, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "PW/poisson_01/gen_rho.jl", "max_stars_repo_name": "f-fathurrahman/ffr-ElectronicStructure.jl", "max_stars_repo_head_hexsha": "35dca9831bfc6a3e49bb0f3a5872558ffce4b211", "max_stars_repo_licenses": ["...
from textwrap import dedent from numpy import ( bool_, dtype, float32, float64, int32, int64, int16, uint16, ndarray, uint32, uint8, ) from zipline.errors import ( WindowLengthNotPositive, WindowLengthTooLong, ) from zipline.utils.numpy_utils import ( datetime64n...
{"hexsha": "4c0ee5b864ca9757551d24315a073deba2a400d7", "size": 7512, "ext": "py", "lang": "Python", "max_stars_repo_path": "zipline/lib/adjusted_array.py", "max_stars_repo_name": "lv-cha/zipline-chinese", "max_stars_repo_head_hexsha": "65928d98db46568409add0a9a404bc41729d0bb5", "max_stars_repo_licenses": ["Apache-2.0"]...
# -*- coding: utf-8 -*- """ Created on Tue Feb 5 05:56:59 2019 @author: Zymieth """ import numpy as np import heapq with open('Median.txt') as file: x = [int(row[:-1]) for row in file] def heapMedian(nums): h_min = [max(nums[0],nums[1])] h_max = [-min(nums[0],nums[1])] median_ith = [nums[0],(nums[0]...
{"hexsha": "85e46f1d41a704249bafdebe0dbfcb1042706604", "size": 1219, "ext": "py", "lang": "Python", "max_stars_repo_path": "mixed/heapMedian/median_maintenance.py", "max_stars_repo_name": "Zymrael/Algorithm-greatest-hits", "max_stars_repo_head_hexsha": "8da314b529f0c70e2c4860d5f81a452a978a9ba0", "max_stars_repo_license...
import logging import time import multiprocessing import gc import pandas as pd import numpy as np from sklearn import metrics from sklearn.preprocessing import MinMaxScaler def generate_mse(sample_preds, sample_input): """ Generates mean square error for each customer in the validation dataset. args...
{"hexsha": "4ecbc45067b38bd9591d607dcd31ee9a2e700814", "size": 1831, "ext": "py", "lang": "Python", "max_stars_repo_path": "novelty_detection/autoencoders_evaluate.py", "max_stars_repo_name": "rajat-bhardwaj/anomaly_detection_financial_risk", "max_stars_repo_head_hexsha": "39f39962dd57edf271888cefbf9cf72c85c6c272", "ma...
import numpy as np from tensorflow.keras import Input from tensorflow.keras import Model from tensorflow.keras.layers import Dense from tcn import TCN i = Input(batch_shape=(None, 5, 300)) o = TCN(nb_filters=30, return_sequences=False, padding='same')(i) # The TCN layers are here. o = Dense(1)(o) m = Model(inputs=[i...
{"hexsha": "8b04c07221f650c34d6de279fbf4e0f8797b6479", "size": 568, "ext": "py", "lang": "Python", "max_stars_repo_path": "tasks/non_causal.py", "max_stars_repo_name": "khaledbenag/keras-tcn", "max_stars_repo_head_hexsha": "2390261a726df183e783fede4d18ce3e9661f853", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
import json import os import time import subprocess import tempfile import itertools from collections import defaultdict import numpy as np from .reliability_checks import probability_recovery, runtime_complexity, memory_complexity class ImplementationProfiling: def __init__(self, implementation, config, scalin...
{"hexsha": "f5080419230b91e5fda6c212ceaaf8f07a85e33f", "size": 7426, "ext": "py", "lang": "Python", "max_stars_repo_path": "mlcl/testing/tester.py", "max_stars_repo_name": "tmplxz/carelabels", "max_stars_repo_head_hexsha": "7e9b93ffa05d6f3e6a598ffb79cef3df7aecac68", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst. # -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import logging import numpy as np from threedigrid.orm.base.datasource import DataSource from collections import Ordered...
{"hexsha": "c4d929628c9de22f36de0ee3a1a0d42ba033ba4a", "size": 8119, "ext": "py", "lang": "Python", "max_stars_repo_path": "threedigrid/admin/h5py_datasource.py", "max_stars_repo_name": "nens/threedigrid", "max_stars_repo_head_hexsha": "7bff5f9efa5edb8335a8ed601b9a096f85e19711", "max_stars_repo_licenses": ["BSD-3-Claus...
# Base class for an "other" quantity which is neither kinetic, fluid nor scalar. # import matplotlib.pyplot as plt import numpy as np from . OutputException import OutputException from . UnknownQuantity import UnknownQuantity class OtherQuantity(UnknownQuantity): def __init__(self, name, data, description...
{"hexsha": "f4a76514171e21673578a10a3d514ba22fc31535", "size": 1500, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/DREAM/Output/OtherQuantity.py", "max_stars_repo_name": "chalmersplasmatheory/DREAM", "max_stars_repo_head_hexsha": "715637ada94f5e35db16f23c2fd49bb7401f4a27", "max_stars_repo_licenses": ["MIT"]...
theory FreeLogic imports Main begin consts fExistence:: "'a\<Rightarrow>bool" ("E") (*Existence/definedness predicate in free logic*) abbreviation fForall ("\<^bold>\<forall>") (*Free universal quantification*) where "\<^bold>\<forall>\<Phi> \<equiv> \<forall>x. E x \<longrightarrow> \<Phi> x"...
{"author": "LuccaT95", "repo": "ToposTheory", "sha": "8e468a6bf7111aecd93d48458d8608106fd43256", "save_path": "github-repos/isabelle/LuccaT95-ToposTheory", "path": "github-repos/isabelle/LuccaT95-ToposTheory/ToposTheory-8e468a6bf7111aecd93d48458d8608106fd43256/sledgehammerTheories/FreeLogic.thy"}
# Copyright 2004 by Thomas Hamelryck. # All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """ KD tree data structure for searching N-dimensional vectors. The KD tree...
{"hexsha": "86bf8ab8e0be6dff6ade75e3f1f50a9ceb8a0cba", "size": 8119, "ext": "py", "lang": "Python", "max_stars_repo_path": "Bio/KDTree/KDTree.py", "max_stars_repo_name": "eoc21/biopython", "max_stars_repo_head_hexsha": "c0f8db8f55a506837c320459957a0ce99b0618b6", "max_stars_repo_licenses": ["PostgreSQL"], "max_stars_cou...
from utils.utils import get_pair, store_json_dic import random from scipy.stats import pearsonr import scipy from utils.utils import load_json_dic import json import os import numpy as np import seaborn as sns from models.mlm_wrapper import MLMWrapper def compare_distribution(in_distribution, out_distribution, norm_i...
{"hexsha": "91baa794dd31361e29a6b923a5dcdf26b79f9d23", "size": 8707, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/prompt_utils.py", "max_stars_repo_name": "c-box/causalEval", "max_stars_repo_head_hexsha": "85d237dff997ad4b044a0f329e15cf6531676c75", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_co...
import numpy as np def sort_values(signal): signal = np.array(signal) idices = np.argsort(signal, axis=0) return zip(list(idices), list(signal[idices])) def find_peaks(signal): peaks = [] max_idx = np.argmax(signal) peaks.append((max_idx, signal[max_idx]+1e-50)) return peaks
{"hexsha": "e64a74416e598c8655f20abaa2c7e0fb8851a2ca", "size": 306, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyaatlibs/signalanalyzer.py", "max_stars_repo_name": "HW-Lee/AudioAutoTest", "max_stars_repo_head_hexsha": "69bde0d6c3af55b57519375c993d1e6c20674ea3", "max_stars_repo_licenses": ["Apache-2.0"], "ma...
import matplotlib.pyplot as plt import numpy as np from backbone.dihedral import DihedralReader class FourDihedralHistogram: strand_lst = ['STRAND1', 'STRAND2'] d_resid_lst = {'STRAND1': list(range(4, 19)), 'STRAND2': list(range(25, 40))} #dihedral_lst = ["C2prime-P", 'C4prime-P', 'C1prime-N3orO2', 'C1prim...
{"hexsha": "9867922e44daf53732ecc255c3bee15d6bd69062", "size": 3766, "ext": "py", "lang": "Python", "max_stars_repo_path": "backbone/dihedral_plot.py", "max_stars_repo_name": "yizaochen/backbone_rigidity", "max_stars_repo_head_hexsha": "d3bc8c491b1425fd83e7f4655fca6a5871640347", "max_stars_repo_licenses": ["MIT"], "max...
import numpy as np import json import tensorflow as tf import keras import csv from gan import GAN from src.globals import * from src.utils.protein_utilities import DNA_to_protein from src.utils.data_utilities import triplets, OneHot_Seq from models import Feedback # Adapted from https://github.com/igul222/improved_w...
{"hexsha": "e28f42d7708d21a0cb8a51339112a5b43a3b5327", "size": 10941, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/fbgan.py", "max_stars_repo_name": "karinazad/fbGAN", "max_stars_repo_head_hexsha": "21d06aa5cc15d25bc86dae5b71ec2a4ca9557765", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
import os import re from pathlib import Path import logging import joblib import matplotlib.pyplot as plt import numpy as np import pandas as pd import tensorflow as tf import tensorflow_hub as hub import tensorflow_datasets as tfds from ml_deploy_demo.util.utils import load_yaml, initialize_logging DEFAULT_CONFIG_...
{"hexsha": "0b90abc0093c26b1963a4b0281aa323bbecce64b", "size": 3006, "ext": "py", "lang": "Python", "max_stars_repo_path": "docs/practicums/practicum1/question1/ml_deploy_demo/pipelines/keras.py", "max_stars_repo_name": "hopesummer/2020-AC295", "max_stars_repo_head_hexsha": "6464dcb5b37a2c2e858fb6f76835aa608f2dae7f", "...
def nbyw(x,mode,Ndepth,mu0,T,clog,ww): import scipy.special as sc import const import numpy as np if (mode == 0): w0 = x w = ww if (mode == 1): w = x w0 = ww if (w < 0): w = 0#complex(w) K = 2*np.pi*const.e2**2 c = (2e0/3e0)*np.sqrt(const.me/const.mp/np.pi) # defined below ...
{"hexsha": "77363e75d7389ae16a05e8f4f4b9aa75377bfe7d", "size": 3114, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/qh_warmtarget.py", "max_stars_repo_name": "solarFP/FP", "max_stars_repo_head_hexsha": "a7c7f318ce162e2ab54d37f2f2231efd051e3280", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou...
# MIT License # # Copyright (c) 2018 Tom Runia # # 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, ...
{"hexsha": "8f10f2c479eff3420d978c4c99f528626d973130", "size": 3424, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/blender.py", "max_stars_repo_name": "tomrunia/PyTorchConv3D", "max_stars_repo_head_hexsha": "e6cc440e5613d6c826288402c66681a5e6ea5fa0", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta...
__author__ = 'Tony Beltramelli www.tonybeltramelli.com - 14/09/2015' import scipy.stats as stats from PeakAnalysis import * from ..utils.UMath import * from ..Path import Path class FeatureExtractor: def __init__(self, output_path, view, use_statistical_features=False): self.output_path = output_path ...
{"hexsha": "832ae7b873e5077fb202494b2c517d888d577d64", "size": 5617, "ext": "py", "lang": "Python", "max_stars_repo_path": "server/analytics/modules/feature/FeatureExtractor.py", "max_stars_repo_name": "jycr753/Deep-Spying", "max_stars_repo_head_hexsha": "adefef65222b592b3bdc014b1315f0bddbfb683c", "max_stars_repo_licen...
from scipy import spatial from .validator import validate_keys import numpy as np import time from .utils import paral_query, print_histo, parallel_query _VALID_KWARGS = {"k1": None, "k5": None, "k10": None, "min_dist_vec": None, "n": None, "MRR": None, "mean": None} class Indicators(o...
{"hexsha": "e52846029087eb586f72d5ae131a879607a8d899", "size": 2701, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/indicators.py", "max_stars_repo_name": "Francisco95/ImageSearch", "max_stars_repo_head_hexsha": "4b674918e3d2feb2487e901e45f6a0b7803aa1ad", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
## --- Load observed cooling against which to fit # McDonough bulk silicate earth mcdbse = importdataset("data/mcdbse.csv",',') # # Average cooling curve # obs = importdataset("data/CoolingAverage.csv",',') # TrelObs_time = obs["Age"]/1000 # TrelObs = obs["Trel"] # TrelObs_sigma = obs["Tre...
{"hexsha": "4b2597a6763ec0a156ad87f5e88dc3135151592c", "size": 19877, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Utilities.jl", "max_stars_repo_name": "brenhinkeller/SecularCooling", "max_stars_repo_head_hexsha": "251528139156183bd3202c880ce3bdcfca64672d", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
theory Strings imports Core "strings/RegEx" "strings/Words" "HOL-Library.Numeral_Type" "HOL-Library.List_Lexorder" begin no_notation List.length ("\<bar>_\<bar>") no_notation Groups.abs_class.abs ("\<bar>_\<bar>") section "Standard model for the SMT-LIB Theory of String" subsection "Definition of Unicode chara...
{"author": "formalsmt", "repo": "isabelle_smt", "sha": "e3f990aa6548c67d438a5c0e2cd808760d347d83", "save_path": "github-repos/isabelle/formalsmt-isabelle_smt", "path": "github-repos/isabelle/formalsmt-isabelle_smt/isabelle_smt-e3f990aa6548c67d438a5c0e2cd808760d347d83/Strings.thy"}
using EstimationStatistics using Test @testset "EstimationStatistics.jl" begin # Write your tests here. end
{"hexsha": "37447d1cb7cd33e9d2f53e6b421be036c3cfa56e", "size": 113, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "neuro-myoung/EstimationStatistics.jl", "max_stars_repo_head_hexsha": "7a59151b695a1fda704703a1a848f055a0dbd3fb", "max_stars_repo_licenses": ["MIT"], "max_s...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import argparse import codecs import json import os from collections import defaultdict import numpy as np import spacy from nlplingo.common.utils import IntPair from nlplingo.embeddings.word_embedding...
{"hexsha": "30d2b74557a3608af6903ee4f238fca4b9807f87", "size": 9650, "ext": "py", "lang": "Python", "max_stars_repo_path": "nlplingo/sandbox/decode_text.py", "max_stars_repo_name": "BBN-E/nlplingo", "max_stars_repo_head_hexsha": "32ff17b1320937faa3d3ebe727032f4b3e7a353d", "max_stars_repo_licenses": ["Apache-2.0"], "max...
\chapter{Direct backward ray mapping} \label{chap:raymapping2} In Chapter \ref{chap:raymapping1} we introduced an inverse method based on ray mapping reconstruction in PS. The goal was to calculate the intensity distribution at the target of an optical system. \\ \indent The idea was to construct a map from the target ...
{"hexsha": "205a99469621a71d6fcc75d60f0c39ac9c76e51e", "size": 47423, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "chapters/Extended_ray_mapping.tex", "max_stars_repo_name": "melaniafilosa/ps_raytracing", "max_stars_repo_head_hexsha": "8f9111ea4ec3ac125b593f41b3ac6fe302ea6632", "max_stars_repo_licenses": ["MIT"...
using Flux using Transformers.Basic struct Encoder layers::Array{Transformer} end Flux.@functor Encoder Flux.trainable(encoder::Encoder) = (encoder.layers,) function (encoder::Encoder)(embedding) for transformer ∈ encoder.layers embedding = transformer(embedding) end return embedding end fu...
{"hexsha": "dbdf76216604f2734b1486070425d9333d34a861", "size": 591, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/model/encoder.jl", "max_stars_repo_name": "heinrichreimer/text-summarization-bert-reproducability", "max_stars_repo_head_hexsha": "728bdde483b53332e25b60f97981df7cc7c5ff9c", "max_stars_repo_lice...
import logging import numpy as np from typing import Optional, Tuple class ModelFitter: """ | Fit a linear regression model to inputted X and y data. Contains methods for fitting | via the normal equation or by gradient descent """ def normal_equation(self, X: np.ndarray, ...
{"hexsha": "4a6792d00349fab4134053da63a06460ee6414d6", "size": 7822, "ext": "py", "lang": "Python", "max_stars_repo_path": "1-linear_regression/python/model_fitter.py", "max_stars_repo_name": "mgsosna/multivariate_LR_gradient_descent", "max_stars_repo_head_hexsha": "37987a8a3fe3e891d5f86657ec43888b25607d4c", "max_stars...
mutable struct CRHCCache{M<:AbstractMatrix, V<:AbstractVector, C, IN} momentmatrix::M # nxm "For regression type" modelmatrix::M residuals::V "Scratch matrix" matscr::M "Factorization of X'X" crossx::C # Factorization of X'*X "Meat" Shat::M "The cluster indices ...
{"hexsha": "6f14bc3656a199082cf57e5162b107f1de6419b1", "size": 5113, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/CRHC.jl", "max_stars_repo_name": "UnofficialJuliaMirror/CovarianceMatrices.jl-60f91f6f-d783-54cb-84f9-544141854719", "max_stars_repo_head_hexsha": "71521b4a4d046f491263ada2da2a1dd6f1fc2d55", "m...
from typing import Optional, List import gym import numpy as np from flatland.core.env_observation_builder import ObservationBuilder from flatland.envs.observations import TreeObsForRailEnv from flatlander.envs.observations import Observation, register_obs from flatlander.envs.observations.builders.done_removed_tree ...
{"hexsha": "61b668a43d99bba0c025c2370392e75310226ac3", "size": 3525, "ext": "py", "lang": "Python", "max_stars_repo_path": "flatlander/envs/observations/tree_obs.py", "max_stars_repo_name": "wullli/flatlander", "max_stars_repo_head_hexsha": "2c7fbd3d025f2a05c40895ec735a92d7a6bfb1ad", "max_stars_repo_licenses": ["MIT"],...
[STATEMENT] lemma [simp]: assumes "xs \<noteq> LNil" "ys \<noteq> LNil" "lhd xs = lhd ys" shows lhd_llist_inf: "lhd (inf xs ys) = lhd ys" and ltl_llist_inf: "ltl (inf xs ys) = inf (ltl xs) (ltl ys)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. lhd (xs \<sqinter> ys) = lhd ys &&& ltl (xs \<sqinter> ys) = ltl x...
{"llama_tokens": 293, "file": "Coinductive_Coinductive_List_Prefix", "length": 2}
using Makie using Colors using IntervalConstraintProgramming, IntervalArithmetic ## Constraint programming solid_torus = @constraint (3 - sqrt(x^2 + y^2))^2 + z^2 <= 1 half_space = @constraint (x + y) + z <= 1 x = interval(-5, 5) Y = IntervalBox(x, 3) @time paving = pave(solid_torus ∩ half_space, Y, 0.1); inner =...
{"hexsha": "171e9a26db0ed0a50b30fb9189510804c32aaac6", "size": 1132, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/sliced_solid_torus.jl", "max_stars_repo_name": "lucaferranti/IntervalConstraintProgramming.jl", "max_stars_repo_head_hexsha": "1a208ef86d6603a5629df5b214853d36bf99f994", "max_stars_repo_li...
import os import pandas as pd import numpy as np from astroquery.nasa_exoplanet_archive import NasaExoplanetArchive as query # reads a data file (.csv) from a designated file path params_df = pd.read_csv("\\path\\to\\data") # retrieves data from the archive through astroquery exoplanet_archive_table = query....
{"hexsha": "4143e52426bd606b21da4d82e0f66c371206d560", "size": 2543, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/nasa_api_request.py", "max_stars_repo_name": "rndev2017/ExoBoost", "max_stars_repo_head_hexsha": "6f5514fcadc41e77ab4c07e04667600500d87c6e", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
## compute nearest station from a given import pandas as pd import numpy as np from .utils import merge_two_dicts ## Weather variable vocablary. def haversine_distance(lat1, lon1, lat2, lon2): earth_radius = 6371.16 deg2rad = lambda deg: deg*np.pi/180 dlat = deg2rad(lat2 - lat1) dlon = deg2rad(lon2...
{"hexsha": "ed7318485730b347ac6506cf7d771485fcd09b80", "size": 3643, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/common/sdxutils.py", "max_stars_repo_name": "SensorDX/rainqc", "max_stars_repo_head_hexsha": "d957705e0f1e2e05b3bf23c5b6fd77a135ac69cd", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c...
[STATEMENT] lemma inv_ik_dynI: assumes "\<And>t m x . \<lbrakk>t \<in> terms_pkt m; m \<in> loc2 s x\<rbrakk> \<Longrightarrow> t \<in> synth (analz ik)" and "\<And>t m x . \<lbrakk>t \<in> terms_pkt m; m \<in> chan2 s x\<rbrakk> \<Longrightarrow> t \<in> synth (analz ik)" shows "inv_ik_dyn s" [PROOF STATE] pr...
{"llama_tokens": 355, "file": "IsaNet_Parametrized_Dataplane_2", "length": 2}
# from util.utils import collate_fn from data import Data_Driver # from util.engine import train_one_epoch, evaluate import torch import torchvision from models import * import matplotlib.pyplot as plt import util.utils as utils import numpy as np from util.engine import train_one_epoch, evaluate # Base batch shuffli...
{"hexsha": "beeeb3bbae63cda43d5b85b449ec43eb857fb485", "size": 8553, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "Skhaki18/APS360", "max_stars_repo_head_hexsha": "4a386fc8ee14802bcb5ef25eefc234160673896a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_...
""" layer_info.py """ from typing import Any, Dict, List, Optional, Sequence, Union import numpy as np import torch import torch.nn as nn DETECTED_OUTPUT_TYPES = Union[Sequence[Any], Dict[Any, torch.Tensor], torch.Tensor] class LayerInfo: """ Class that holds information about a layer module. """ def __ini...
{"hexsha": "44c37ecee3fd20e118f39ca4ac7892b2ab7cfdf5", "size": 4702, "ext": "py", "lang": "Python", "max_stars_repo_path": "torchsummary/layer_info.py", "max_stars_repo_name": "roym899/torch-summary", "max_stars_repo_head_hexsha": "2a2ccbb83a403f411bc092fab15f66acb696cf1f", "max_stars_repo_licenses": ["MIT"], "max_star...
[STATEMENT] lemma init_fin_descend_thr_redT_updT [simp]: "init_fin_descend_thr (redT_updT ts (convert_new_thread_action (Pair status) nt)) = redT_updT (init_fin_descend_thr ts) nt" [PROOF STATE] proof (prove) goal (1 subgoal): 1. init_fin_descend_thr (redT_updT ts (convert_new_thread_action (Pair status) nt)) = r...
{"llama_tokens": 179, "file": "JinjaThreads_Framework_FWInitFinLift", "length": 1}
import numpy as np from scipy import interpolate,signal import matplotlib.pyplot as plt import math class FDSAF: def __init__( self,filterlen ): self.M = filterlen self.w_f = np.fft.fft(np.concatenate((np.ones(1),np.zeros(2*self.M-1)))) self.last_buffer = np.zeros(self.M, dtype='...
{"hexsha": "9e4f755a5de3cf7f362c03e009dd445d884b3f7c", "size": 13411, "ext": "py", "lang": "Python", "max_stars_repo_path": "FDSAF.py", "max_stars_repo_name": "mjbremer/ActiveNoiseCancellation", "max_stars_repo_head_hexsha": "3c9706add9d1e57135dd3a41ffa7649431ed2640", "max_stars_repo_licenses": ["Unlicense"], "max_star...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QFileDialog> #include <QMessageBox> #include "crc.h" #include <iostream> #include <time.h> #include <boost/crc.hpp> // for boost::crc_32_type #include <cstdlib> // for EXIT_SUCCESS, EXIT_FAILURE #include <exception> // for std::exception #include <fstre...
{"hexsha": "7a37e9bd73212b65c936c8d806b446ed5e5400e8", "size": 15291, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "mainwindow.cpp", "max_stars_repo_name": "Klos27/CRC32", "max_stars_repo_head_hexsha": "6ab845e3c0725de4939e7778c92fb32502f1d933", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1.0, "max_st...
#include "hoCuNDArray_utils.h" #include "radial_utilities.h" #include "hoNDArray_fileio.h" #include "cuNDArray.h" #include "imageOperator.h" #include "identityOperator.h" #include "hoPartialDerivativeOperator.h" #include "hoCuConebeamProjectionOperator.h" #include "cuConvolutionOperator.h" #include "hoCuIdentityOperato...
{"hexsha": "1d8746535cf988fc6f6c6ca41dd90a7c96819e6b", "size": 7591, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "xray/CB_CGreconstruct.cpp", "max_stars_repo_name": "ahsanjav/gt-tomography", "max_stars_repo_head_hexsha": "1f53d72672ccda417bc8966d8497af6d786e8935", "max_stars_repo_licenses": ["MIT"], "max_stars_...
[STATEMENT] theorem unwinding_theorem_FCI: "\<lbrakk> fcrb \<Gamma> ur; osc ur \<rbrakk> \<Longrightarrow> FCI \<Gamma> \<V> Tr\<^bsub>(induceES SES)\<^esub>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>fcrb \<Gamma> ur; osc ur\<rbrakk> \<Longrightarrow> FCI \<Gamma> \<V> Tr\<^bsub>(induceES SES)\<^esub>...
{"llama_tokens": 9251, "file": "Modular_Assembly_Kit_Security_Verification_Unwinding_UnwindingResults", "length": 57}
from ..embedding.sentence_embedder import GloveSentenceEmbedder from ..embedding.word_embedding import Glove from ..embedding.core_nlp import SimpleSentence from ..data.graph_dataset import GraphDataset from ..manifolds import SphericalManifold import torch import numpy as np from tqdm import tqdm def get_wordnet_feat...
{"hexsha": "99eb7d8767704ebc36c97a74b71a90904ad3b966", "size": 1541, "ext": "py", "lang": "Python", "max_stars_repo_path": "riemann/featurizers/wordnet_featurizer.py", "max_stars_repo_name": "jdieter31/riemannian-nlp", "max_stars_repo_head_hexsha": "75ef47608c81ec6e925fe24d16c67985e4b987c6", "max_stars_repo_licenses": ...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Antonio Jesús Banegas-Luna" __version__ = "1.0" __maintainer__ = "Antonio" __email__ = "ajbanegas@ucam.edu" __status__ = "Production" import pandas as pd import numpy as np from Tools.Graphics import Graphics from Tools.ToolsModels import is_tf_model, is_rule...
{"hexsha": "a2cf682c460c17e9513669609370e7c615bbacf8", "size": 1538, "ext": "py", "lang": "Python", "max_stars_repo_path": "Common/Analysis/Explainers/ALEExplainer.py", "max_stars_repo_name": "bio-hpc/sibila", "max_stars_repo_head_hexsha": "337ea84692d6ea4f4d3e4de9da51f5ee53cff6d7", "max_stars_repo_licenses": ["Apache-...
# This file was generated, do not modify it. # hide no_miss = .!ismissing.(y) y = collect(skipmissing(y)) X = X[no_miss, :] train, test = partition(eachindex(y), 0.5, shuffle=true, rng=424);
{"hexsha": "e6c4d461a707be212903a739e0961a6993681ff4", "size": 190, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "_assets/pages/isl/lab-6b/code/ex3.jl", "max_stars_repo_name": "giordano/DataScienceTutorials.jl", "max_stars_repo_head_hexsha": "8284298842e0d77061cf8ee767d0899fb7d051ff", "max_stars_repo_licenses":...
#include <cassert> #include <chrono> #include <boost/asio.hpp> #include <boost/thread/thread.hpp> #include <spdlog/spdlog.h> #include <spdlog/fmt/chrono.h> #include <arguments.hpp> #include <block_file.hpp> #include <block_reader.hpp> #include <hasher.hpp> #include <writer.hpp> signed main( int argument_count, char...
{"hexsha": "d3bb79f12ba25f96daa395c1393d77b9c3968aca", "size": 7047, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/v2/main.cpp", "max_stars_repo_name": "fslobanov/veeam-signature", "max_stars_repo_head_hexsha": "e981d56c81646f9f24e2e60cf2b807e7faa28bd8", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import cv2 import numpy as np from PIL import Image m="bunny.png" mask=Image.open(m) face_cascade=cv2.CascadeClassifier("haarcascade_frontalface_default.xml") def dog(image): gray=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) faces=face_cascade.detectMultiScale(gray,1.3) background = Image.fromarray(image) ...
{"hexsha": "8e1ef30a41448ddaf7776184c2a77a244a24b465", "size": 696, "ext": "py", "lang": "Python", "max_stars_repo_path": "my_dog_thug.py", "max_stars_repo_name": "Vrittik/ThugLife-Mask", "max_stars_repo_head_hexsha": "50543987ffa9f9d33bd5a48f81326a6ca82de74f", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun...
/*! @file Forward declares `boost::hana::one`. @copyright Louis Dionne 2015 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_FWD_ONE_HPP #define BOOST_HANA_FWD_ONE_HPP #include <boost/hana/core/when.hpp> ...
{"hexsha": "4b254cd71b5572d794ae0f643a2c0f31409ae25d", "size": 1026, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/hana/fwd/one.hpp", "max_stars_repo_name": "qicosmos/hana", "max_stars_repo_head_hexsha": "b0f8cf2bf19d491b7b739dcb7b8d7497b0e5829f", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_...
\<^marker>\<open>creator "Johannes Hölzl"\<close> chapter \<open>MDP Semantics for PGCL\<close> theory MDP_Semantics imports PGCL begin paragraph \<open>Summary\<close> text \<open>This theory provides an operational interpretation of pGCL running times as MDPs, and proves its equivalence to pGCL's the denota...
{"author": "maxhaslbeck", "repo": "verERT", "sha": "193188292620a60005e528a78247323eb53084bc", "save_path": "github-repos/isabelle/maxhaslbeck-verERT", "path": "github-repos/isabelle/maxhaslbeck-verERT/verERT-193188292620a60005e528a78247323eb53084bc/MDP_Semantics.thy"}
import numpy as np import matplotlib matplotlib.use("TkAgg") import matplotlib.pyplot as plt def subplots(data_for_plots, figsize=[12, 4]): """ data_for_plots = [[1,2,3], [4,5,6]] """ f, axes = plt.subplots(np.int(np.ceil(len(data_for_plots) / 2)), 2, figsize=figsize) for ax, data_for_plot i...
{"hexsha": "037642ae83e3368947231103b2d8d4d76c4437d1", "size": 385, "ext": "py", "lang": "Python", "max_stars_repo_path": "torch_buddy/utils/plot.py", "max_stars_repo_name": "NickYi1990/torch_buddy", "max_stars_repo_head_hexsha": "b888f60b25e4f70b89960d158aaf893ab6183481", "max_stars_repo_licenses": ["MIT"], "max_stars...
"""Train CIFAR100 with PyTorch.""" from __future__ import print_function import argparse import os import numpy import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler import torch.backends.cudnn as cudnn import torchvision import torchvision.transforms as transforms from...
{"hexsha": "c80004918e0a0df270cf2c3f941685dc9df41ec0", "size": 7325, "ext": "py", "lang": "Python", "max_stars_repo_path": "main_cifar100.py", "max_stars_repo_name": "FranklinAurelio/mixup_pytorch", "max_stars_repo_head_hexsha": "20604068224795f17697989d95d20d376b244e39", "max_stars_repo_licenses": ["MIT"], "max_stars_...
#!/usr/bin/python # -*- coding: UTF-8 -*- import codecs import pandas as pd import numpy as np import re def data2pkl(): datas = list() labels = list() linedata=list() linelabel=list() tags = set() input_data = codecs.open('./wordtagsplit.txt', 'r', 'utf-8') for line in input_data.readlin...
{"hexsha": "9f83c52abeb0656ae93d4ba67e17a8ad9c57054b", "size": 4378, "ext": "py", "lang": "Python", "max_stars_repo_path": "NER-Chinese-BiLSTM+CRF/data/boson/data_util.py", "max_stars_repo_name": "aka-zyq/NER-TF", "max_stars_repo_head_hexsha": "2f540019fceb5673d71b2602145456392f935892", "max_stars_repo_licenses": ["MIT...
# File: pyNOMAD.py # Author: Nicolas Bons # Description: This program finds the optimum solution for a given objective # function using the optimization package NOMAD. # ============================================================================= # NOMAD Library # =====================================================...
{"hexsha": "2976f0bb504c206570b9924032d4251182e5cc2d", "size": 5591, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyoptsparse/pyNOMAD/pyNOMAD.py", "max_stars_repo_name": "hschilling/pyoptsparse", "max_stars_repo_head_hexsha": "72d784a9d74eee7b5b840b272c89d69de6cee3a5", "max_stars_repo_licenses": ["CNRI-Python...
""" Construct 3x3 rotation matrices for rotating around the x, y and z axes individually, as well as 3x3 rotation matrices from sequences of three Euler angles. """ import numpy as np def _to_radians(angle, is_in_radians): """ Internal function to convert angle to radians :param angle: float or int, the a...
{"hexsha": "46e2655a0071c3a292f4f8decfef2a33357e71d5", "size": 5599, "ext": "py", "lang": "Python", "max_stars_repo_path": "sksurgerycore/transforms/matrix.py", "max_stars_repo_name": "thompson318/scikit-surgerycore", "max_stars_repo_head_hexsha": "22867073a5a3e87def68b4a76e70fe54d085be32", "max_stars_repo_licenses": [...
from numpy import isclose, allclose, arange, sin, pi, zeros from skdh.gait.get_gait_events import get_cwt_scales, get_gait_events def test_get_cwt_scales(): s1, s2 = get_cwt_scales(False, None, 8, 50.0) assert s1 == s2 == 8 # optimal scaling t = arange(0, 10, 0.02) x = sin(2 * pi * 1.0 * t) ...
{"hexsha": "5a71600eb0438633345532469836dab43767c3b2", "size": 1019, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/gait/test_get_gait_events.py", "max_stars_repo_name": "PfizerRD/scikit-digital-health", "max_stars_repo_head_hexsha": "f834a82d750d9e3cdd35f4f5692a0a388210b821", "max_stars_repo_licenses": ["...
# Sebastian A. Mueller # A simple simulation of electro-magnetic-air-showers (one-dimensional) # Goal: Simulate the Cherenkov-photon-emission. import numpy as np """ Adopting thoughts from: J. Matthews "A Heitler model of extensive air showers" Astroparticle Physics 22 (2005) 387–397 """ UNIT_CHARGE = 1.6...
{"hexsha": "9f8697090cc6e40cc1d2c66686b91ab3a8ac4017", "size": 12313, "ext": "py", "lang": "Python", "max_stars_repo_path": "toy_air_shower/__init__.py", "max_stars_repo_name": "cherenkov-plenoscope/toy_air_shower", "max_stars_repo_head_hexsha": "c0055f22f55c85a24e97112fd5c73d52ffdd4d09", "max_stars_repo_licenses": ["M...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import cv2 import numpy as np def load_img(path, grayscale=False, target_size=None, crop_size=None): """ Load an image. # Arguments path: Path to image file. grayscale: Boolean, whether to load the image as grayscale. target_size...
{"hexsha": "d3bec46717a77f663fa4b3ab48b03a9861272e6a", "size": 1594, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/img_utils.py", "max_stars_repo_name": "chisyliu/A_General_Framework_for_Uncertainty_Estimation_in_Deep_Learning", "max_stars_repo_head_hexsha": "da49ea5a040289d6e76e86bb06325fbfaf13803b", "max...
#include "ParticleSystem.h" #include <AdventOfCodeCommon/DisableLibraryWarningsMacros.h> __BEGIN_LIBRARIES_DISABLE_WARNINGS #include <boost/functional/hash/hash.hpp> #include <algorithm> #include <unordered_map> __END_LIBRARIES_DISABLE_WARNINGS namespace AdventOfCode { namespace Year2017 { namespace Day20 { Partic...
{"hexsha": "ae8394fc2b37c1cd50fe901eaa22bf461743ae4c", "size": 2539, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/AdventOfCode2017/Day20-ParticleSwarm/ParticleSystem.cpp", "max_stars_repo_name": "dbartok/advent-of-code-cpp", "max_stars_repo_head_hexsha": "c8c2df7a21980f8f3e42128f7bc5df8288f18490", "max_star...
#include <math.h> #include <stdio.h> #include <gsl/gsl_rng.h> #include "matrix_operations.c" #include "ellipse/parametric_function_roots.c" #include "polynomial.c" void characteristic_ellipse_matrix(double *X, double *R, double phi, double exponent) { // rotation matrix double Q[2][2] = {{ 0 }}; doub...
{"hexsha": "6982edd357305a135062fd5b2dfedf111a95eb78", "size": 8770, "ext": "c", "lang": "C", "max_stars_repo_path": "particle_packing/cython/c/ellipse.c", "max_stars_repo_name": "aluchies/particle_packing", "max_stars_repo_head_hexsha": "127603a519ae25979de6c6197810a7ea38ec945b", "max_stars_repo_licenses": ["BSD-3-Cla...
[STATEMENT] lemma wf_meth_defs_in_wf_class[rule_format]: "meth_def \<in> set (class_methods_f cld) \<and> wf_class P cld \<longrightarrow> wf_meth P (ty_def ctx_def (class_name_f cld)) meth_def" [PROOF STATE] proof (prove) goal (1 subgoal): 1. meth_def \<in> set (class_methods_f cld) \<and> wf_class P cld \<lo...
{"llama_tokens": 2241, "file": "LightweightJava_Lightweight_Java_Proof", "length": 7}
[STATEMENT] lemma Ando_undef: "(Ando \<phi> \<psi> = undeff) = (\<phi>=undeff \<or> \<psi>=undeff)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (Ando \<phi> \<psi> = undeff) = (\<phi> = undeff \<or> \<psi> = undeff) [PROOF STEP] by (metis Ando.elims option.distinct(1))
{"llama_tokens": 119, "file": "Differential_Game_Logic_USubst", "length": 1}
import tensorflow as tf import numpy as np import tensorflow_probability as tfp from blackbox_mpc.optimizers.optimizer_base import OptimizerBase tfd = tfp.distributions class PI2Optimizer(OptimizerBase): def __init__(self, env_action_space, env_observation_space, planning_horizon=50, max_iteratio...
{"hexsha": "dc9073cf51c897c9d34035526adc41c3ecc9cbd4", "size": 6001, "ext": "py", "lang": "Python", "max_stars_repo_path": "blackbox_mpc/optimizers/pi2.py", "max_stars_repo_name": "wangsd01/blackbox_mpc", "max_stars_repo_head_hexsha": "7876dee1bd85bde310e88741f5c63e3f7bd93916", "max_stars_repo_licenses": ["MIT"], "max_...
from .datamodel import * from . import dbconnect from .properties import Properties from . import imagetools import wx import numpy as np import matplotlib.cm from base64 import b64decode from .guiutils import BitmapPopup import imageio abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' # Well Displays ROUN...
{"hexsha": "809fe62c73129a964dc8f9ea504416b56696fd91", "size": 21317, "ext": "py", "lang": "Python", "max_stars_repo_path": "cpa/platemappanel.py", "max_stars_repo_name": "DavidStirling/CellProfiler-Analyst", "max_stars_repo_head_hexsha": "7a0bfcb5cc7db067844595bdbb90f3132f9a8ea9", "max_stars_repo_licenses": ["MIT"], "...
! { dg-do run } ! ! Test the fix for PR81048, where in the second call to 'g2' the ! default initialization was "forgotten". 'g1', 'g1a' and 'g3' check ! that this does not occur for scalars and explicit results. ! ! Contributed by David Smith <dm577216smith@gmail.com> ! program test type f integer :: f = -1...
{"hexsha": "5f3c7882ff21d30d5cb1da7124641e9f665b669b", "size": 1293, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "gcc-gcc-7_3_0-release/gcc/testsuite/gfortran.dg/derived_init_4.f90", "max_stars_repo_name": "best08618/asylo", "max_stars_repo_head_hexsha": "5a520a9f5c461ede0f32acc284017b737a43898c", "max_star...
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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 a...
{"hexsha": "4a79afca7e87583b80a02ac3701f656f8d2fe5df", "size": 34929, "ext": "py", "lang": "Python", "max_stars_repo_path": "mars/tensor/statistics/histogram.py", "max_stars_repo_name": "aporia-ai/aporia-mars", "max_stars_repo_head_hexsha": "fbebef726f80282b151971849d0b2bc0246c9b58", "max_stars_repo_licenses": ["Apache...
import pandas as pd import numpy as np from download import download from asltam.io import url_price, path_price class load_price : """ Une classe utile pour charger les données des prix. Pour le bon fonctionnement du module veillez à ce que les données soient bien sous le bon format (voir documentation ...
{"hexsha": "fcb15ec1194bd25457fa7b360a9f8aa30946cb8d", "size": 3089, "ext": "py", "lang": "Python", "max_stars_repo_path": "asltam/io/load_price.py", "max_stars_repo_name": "Eldohrim/Project_2021_HAX712X", "max_stars_repo_head_hexsha": "420e623f680072522b4f0eb7eb6f4b27b143ca28", "max_stars_repo_licenses": ["MIT"], "max...
[STATEMENT] lemma exec_move_BinOpI2: assumes exec: "exec_move ci P t e2 h (stk, loc, pc, xcp) ta h' (stk', loc', pc', xcp')" shows "exec_move ci P t (e1 \<guillemotleft>bop\<guillemotright> e2) h (stk @ [v], loc, length (compE2 e1) + pc, xcp) ta h' (stk' @ [v], loc', length (compE2 e1) + pc', xcp')" [PROOF STATE] p...
{"llama_tokens": 1429, "file": "JinjaThreads_Compiler_Execs", "length": 9}
[STATEMENT] lemma VVp_to_V [intro]: "v \<in> VV p \<Longrightarrow> v \<in> V" [PROOF STATE] proof (prove) goal (1 subgoal): 1. v \<in> VV p \<Longrightarrow> v \<in> V [PROOF STEP] using valid_player0_set [PROOF STATE] proof (prove) using this: V0 \<subseteq> V goal (1 subgoal): 1. v \<in> VV p \<Longrightarrow> v ...
{"llama_tokens": 154, "file": "Parity_Game_ParityGame", "length": 2}
from typing import List import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.patches as mpatches import seaborn as sns from larval_gonad.io import feather_to_cluster_matrix from larval_gonad.plotting.common import get_fbgn2symbol from larval_gonad.plotting.biomarkers import _cleanup...
{"hexsha": "97394e89a7bf7aa0aaa9465644f9e9163b5c5ee3", "size": 8793, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/larval_gonad/plotting/literature.py", "max_stars_repo_name": "jfear/larval_gonad", "max_stars_repo_head_hexsha": "624a71741864b74e0372f89bdcca578e5cca3722", "max_stars_repo_licenses": ["MIT"],...
# SPDX-FileCopyrightText: 2021 Kirill Pushkaryov <kpushkaryov@gmail.com> # # SPDX-License-Identifier: MIT """Missile evader model object interface and base classes.""" from abc import abstractmethod from typing import Protocol, Any, Optional import logging import numpy as np import evader.math module_logger = loggin...
{"hexsha": "59442ca5fde0abedf902d1da5f4b1fc2aa7ddd64", "size": 2947, "ext": "py", "lang": "Python", "max_stars_repo_path": "evader/baseobjects.py", "max_stars_repo_name": "kpushkaryov/evader", "max_stars_repo_head_hexsha": "cae88f447a3940bc72aab691f1b3d3630de7b5e3", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
""" Locally Weighted Regression References ---------- CS229 Lecture notes1, Chapter 3 Locally weighted linear regression, Prof. Andrew Ng http://cs229.stanford.edu/notes/cs229-notes1.pdf weighted least squares and locally weighted linear regression http://www.dsplog.com/2012/02/05/weighted-least-squares-and-locally-w...
{"hexsha": "acfc25b50984787adb9faf99d1442c7f2a2f365a", "size": 2849, "ext": "py", "lang": "Python", "max_stars_repo_path": "regression/locally_weighted_regression.py", "max_stars_repo_name": "romanorac/ml", "max_stars_repo_head_hexsha": "a2b39e91145e1c5270020e943d3608b582ea2e0c", "max_stars_repo_licenses": ["Apache-2.0...
import numpy as np import pandas as pd import taxcalc as tc from .impute_pencon import impute_pension_contributions from .constants import UNUSED_READ_VARS from pathlib import Path CUR_PATH = Path(__file__).resolve().parent USABLE_VARS = tc.Records(data=None).USABLE_READ_VARS USABLE_VARS.add("filer") def finalprep(...
{"hexsha": "aa41ec92530eb06c728d567b221d56cc0a6e2db2", "size": 11372, "ext": "py", "lang": "Python", "max_stars_repo_path": "taxdata/puf/finalprep.py", "max_stars_repo_name": "jdebacker/taxdata", "max_stars_repo_head_hexsha": "c32d401a10a6c8f6e889d87c6cc72fd4338017b2", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars...
import random import numpy as np HORIZONTAL, VERTICAL = True, False class Mondrian: # Fill colours for boxes, and their cumulative probability distribution colours = ['blue', 'red', 'yellow', 'white'] colours_cdf = [0.15, 0.3, 0.45, 1.0] def __init__(self, config={}, seed=None): random....
{"hexsha": "514fee097cb48dee5b9c81cbda7659579552c4df", "size": 7287, "ext": "py", "lang": "Python", "max_stars_repo_path": "mondrian-fogleman-hill-hall/_in_development/mondrian.py", "max_stars_repo_name": "earthbound19/neoplasticism-generators-collection", "max_stars_repo_head_hexsha": "3a451e6116504889c9f62c9a748aa68a...
from __future__ import division import numpy as np from scipy.stats import norm from sklearn.metrics.pairwise import euclidean_distances #from prada_gaussian_process import PradaGaussianProcess class AcquisitionFunction(object): """ An object to compute the acquisition functions. """ def __init__(sel...
{"hexsha": "4802c385b262bea3cc0aa555076349cd7e604cee", "size": 4963, "ext": "py", "lang": "Python", "max_stars_repo_path": "prada_bayes_opt/acquisition_functions.py", "max_stars_repo_name": "ntienvu/ICDM2016_B3O", "max_stars_repo_head_hexsha": "b004f49f442558f22c0f12fe8ba68e528c568d28", "max_stars_repo_licenses": ["MIT...
[STATEMENT] lemma all_is_set: assumes \<open>all_is p ps xs\<close> shows \<open>{p} \<union> set (omit xs ps) = {p} \<union> set ps\<close> [PROOF STATE] proof (prove) goal (1 subgoal): 1. {p} \<union> set (omit xs ps) = {p} \<union> set ps [PROOF STEP] using assms omit_all_is omit_set [PROOF STATE] proof (prove)...
{"llama_tokens": 422, "file": "Hybrid_Logic_Hybrid_Logic", "length": 3}
from __future__ import division import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.style as ms ms.use('seaborn-muted') import mir_eval import mir_eval.display import librosa.display import pretty_midi import io import itertools import numpy as np from .piano_roll import thresh ...
{"hexsha": "a39a3c07ad138115e29ec0a9676d2d0103e0b5dc", "size": 8223, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/renderers.py", "max_stars_repo_name": "lmartak/amt-wavenet", "max_stars_repo_head_hexsha": "9717eb35f317994372cfd1c76b1546d21272fb67", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
""" boruvka_mst(g, distmx = weights(g); minimize = true) Return a tuple `(mst, weights)` where `mst` is a vector of edges representing the optimum (minimum, by default) spanning tree of a connected, undirected graph `g` with optional matrix `distmx` that provides distinct edge weights, and `weights` is the sum of ...
{"hexsha": "fbe32da577f99339a66b9efb7e6378e95646fe9f", "size": 2439, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/spanningtrees/boruvka.jl", "max_stars_repo_name": "estelle0500/LightGraphs.jl", "max_stars_repo_head_hexsha": "12c5b2e0de2d8a7f063f56c9237f5d1cbc298cfc", "max_stars_repo_licenses": ["MIT"], "ma...
import numpy as np from random import gauss import itertools class Random_walk(object): def __init__(self): self.__stdev = None self.__mean = None self.tick_builder = None def forecast(self, mini_series, order=None, analyse_changes=False): if self.__stdev is None or self.__mea...
{"hexsha": "a2fd5feb5753888750794ae21ed7ddd844421de8", "size": 997, "ext": "py", "lang": "Python", "max_stars_repo_path": "random_walk/random_walk.py", "max_stars_repo_name": "mikesligo/FYP-fuzzy-time-series", "max_stars_repo_head_hexsha": "dc325bef0e3e43b499f63e703b7f9819cc6a8452", "max_stars_repo_licenses": ["MIT"], ...
import numpy as np from scipy.stats import hmean from sumo.data import spindle_vect_to_indices def get_overlap(spindles_detected, spindles_gs): n_detected_spindles = spindles_detected.shape[0] n_gs_spindles = spindles_gs.shape[0] # The (relative) overlap between each pair of detected spindle and gs spin...
{"hexsha": "4230c862967abdf9b2d12781b82b990598315458", "size": 4634, "ext": "py", "lang": "Python", "max_stars_repo_path": "sumo/evaluation/performance_analysis.py", "max_stars_repo_name": "dslaborg/sumo", "max_stars_repo_head_hexsha": "1e9bfedaff201d4bd37b4889b6091cc4b9c8ad01", "max_stars_repo_licenses": ["MIT"], "max...
import torchvision import numpy as np from torchvision.transforms import ToPILImage, Compose import torch.optim as optim from utils.data import SketchyDB, UnnormImage from utils.utils import * import os from os.path import isfile from shutil import copyfile from time import time from models.PSim_net import PSimNet from...
{"hexsha": "bf7ad427a871eb0081ff77e2296dd06818b7e00e", "size": 11998, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "PoChunChen1012/synthesizing_human_like_sketches", "max_stars_repo_head_hexsha": "ec2ba76cda3f658c21b5484bd478e0d4cee52fc6", "max_stars_repo_licenses": ["MIT"], ...
/** * Copyright (C) 2015 Dato, Inc. * All rights reserved. * * This software may be modified and distributed under the terms * of the BSD license. See the LICENSE file for details. */ /** * Copyright (c) 2009 Carnegie Mellon University. * All rights reserved. * * Licensed under the Apache License, Ver...
{"hexsha": "d146b85b8532c99c54040cb19402e87ac73999c2", "size": 6512, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "oss_src/graphlab/options/options_map.hpp", "max_stars_repo_name": "parquette/ParFrame", "max_stars_repo_head_hexsha": "0522aa6afdf529b3e91505b70e918f1500aae886", "max_stars_repo_licenses": ["BSD-3-C...
! ############################################################################################################################### ! Begin MIT license text. ! ______________________________________________________________________________...
{"hexsha": "61e38d049ebc6a7965a8e99ee92804008895577b", "size": 6192, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Source/Interfaces/OFP2_Interface.f90", "max_stars_repo_name": "luzpaz/MYSTRAN", "max_stars_repo_head_hexsha": "cacae986607d9c39d20caf863a877ec7db59a738", "max_stars_repo_licenses": ["MIT"], "max...
#! /usr/bin/env python import h5py import numpy as np # # You can use this file in two ways: You can call it as a program from # a directory with a "shake_result.hdf" file in it, and it will spit out # some slightly interesting information. You might do that as a test. Or # you can put it in a directory with your cod...
{"hexsha": "9c1f90ec1bf1ca32c0241058904d260cb34ef2d0", "size": 2586, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/hdf2dict.py", "max_stars_repo_name": "ggann/shakemap", "max_stars_repo_head_hexsha": "4d7bbf13d0ba580cc7fbd55a2f72c1e80087549b", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": 98...
import numpy as np import matplotlib.pyplot as plt #import matplotlib.pyplot as plt import torch from torchvision import transforms, models import torch.optim as optim from torch.utils.data import Dataset, DataLoader f...
{"hexsha": "71d1769cf85cd443a0f13554115ca17587bed038", "size": 8971, "ext": "py", "lang": "Python", "max_stars_repo_path": "PointNet-Pose/test.py", "max_stars_repo_name": "indoorpositioning/fusionloc", "max_stars_repo_head_hexsha": "be5e135d0b47c55c705b1f6187fe1303e1ad5ffb", "max_stars_repo_licenses": ["MIT"], "max_sta...
from __future__ import division, print_function, unicode_literals import cv2 import numpy as np from sklearn.cluster import KMeans from idocr.models import Image from idocr.segmentation import model_handler from idocr.segmentation.constants import ( HEIGHT, WIDTH, SLIDE, TRAINED_MODELS, MODEL) CLUSTER_REGION = ...
{"hexsha": "ea66bf33604a2397da8f52bac9a50367ec7ea716", "size": 4480, "ext": "py", "lang": "Python", "max_stars_repo_path": "IdRecDemo/idocr/segmentation/segmentor.py", "max_stars_repo_name": "trangnm58/idrec", "max_stars_repo_head_hexsha": "57f815b55919adf2431ddafc9eb96ceb4f586af0", "max_stars_repo_licenses": ["MIT"], ...
import pandas as pd import numpy as np from sklearn.model_selection import KFold import itertools class DoubleMLMultiwayResampling: def __init__(self, n_folds, smpl_sizes): self.n_folds = n_folds self.smpl_sizes = smpl_sizes assert len(smpl_sizes), 'For D...
{"hexsha": "090a165cce2eee5dc4a28ef0f5846d18d32ec2b1", "size": 4421, "ext": "py", "lang": "Python", "max_stars_repo_path": "doubleml/tests/_utils_cluster.py", "max_stars_repo_name": "SvenKlaassen/doubleml-for-py", "max_stars_repo_head_hexsha": "b3cbdb572fce435c18ec67ca323645900fc901b5", "max_stars_repo_licenses": ["MIT...
#' Method of RCTtoolbox: \code{power()} #' #' When you create R6 object "RCTtoolbox" #' via \code{link{create_RCTtoolbox}()} #' and run its method \code{power()}, #' the method internally implements a function #' that performs power analysis. #' The method \code{power()} provides some arguments. #' See the section "Arg...
{"hexsha": "1cbb53295bea53a1a73cae7fb6b75fd74ae25f3d", "size": 4204, "ext": "r", "lang": "R", "max_stars_repo_path": "R/RCTtoolbox-power.r", "max_stars_repo_name": "KatoPachi/multiarmRCT", "max_stars_repo_head_hexsha": "fe75143c5dc194abac8579aba49814fdb0b3acb6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
import math from typing import TYPE_CHECKING, List, Dict, Union import pandas as pd import numpy as np from gmhazard_calc import utils from gmhazard_calc import constants as const from qcore import nhm, geo if TYPE_CHECKING: from gmhazard_calc import gm_data RUPTURE_FAULT_DF_COLUMNS = [ "rupture_name", ...
{"hexsha": "d4d09ffda1fb7e8a4638bc13fddb034e05146ab0", "size": 5664, "ext": "py", "lang": "Python", "max_stars_repo_path": "calculation/gmhazard_calc/gmhazard_calc/rupture/rupture.py", "max_stars_repo_name": "ucgmsim/gmhazard", "max_stars_repo_head_hexsha": "d3d90b4c94b3d9605597a3efeccc8523a1e50c0e", "max_stars_repo_li...
from __future__ import division, absolute_import from struct import unpack as _unpack, pack as _pack import os.path from sys import byteorder as _BYTEORDER import warnings import numpy as np from scipy.ndimage import zoom, gaussian_filter from ._powerfit import blur_points, dilate_points class Volume(object): @...
{"hexsha": "c6c24d425f287e582dcee393955a83e9db46561d", "size": 20760, "ext": "py", "lang": "Python", "max_stars_repo_path": "powerfit/volume.py", "max_stars_repo_name": "haddocking/powerfit", "max_stars_repo_head_hexsha": "fe940e42ffb6f58c4ec63ce4f3fb1642469273e3", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_...
import torch.nn as nn # from torch.utils.data import Dataset # import numpy as np import torch from utils import get_gaussian_mean, rotate_img class Reshape(nn.Module): def __init__(self): super(Reshape, self).__init__() pass def forward(self, x): return x.view(x.shape[0], -1) class...
{"hexsha": "5a6984ff630b3c4a165fe21946ea4c6ebfd4e4c6", "size": 5400, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/blocks.py", "max_stars_repo_name": "MrChenFeng/Project-Template", "max_stars_repo_head_hexsha": "42a335c6abb710bbae6407cbb0ca461533bc12f9", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
\documentclass[12pt, a4paper, footexclude, headexclude]{scrartcl} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[margin=0.5in]{geometry} \usep...
{"hexsha": "eee1467666e9234937611341459a195d79c13b56", "size": 25798, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "src/set.tex", "max_stars_repo_name": "rwarnking/pdf-games", "max_stars_repo_head_hexsha": "a581a89518639e008dacb913573a2c90c80a8827", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m...
[STATEMENT] lemma matrix_equation_main_step: fixes p:: "real poly" fixes qs:: "real poly list" fixes I:: "nat list" fixes signs:: "rat list list" assumes nonzero: "p\<noteq>0" assumes distinct_signs: "distinct signs" assumes all_info: "set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> se...
{"llama_tokens": 729, "file": "BenOr_Kozen_Reif_Matrix_Equation_Construction", "length": 3}
[STATEMENT] lemma poly2_poly_x_minus_y[simp]: fixes p :: "'a :: comm_ring_1 poly" shows "poly2 (poly_x_minus_y p) x y = poly p (x-y)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. poly2 (poly_x_minus_y p) x y = poly p (x - y) [PROOF STEP] unfolding poly2_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. pol...
{"llama_tokens": 183, "file": "Algebraic_Numbers_Algebraic_Numbers", "length": 2}
import random # For fix SIGSEGV. import open3d import numpy as np import torch import pointnet2_atlasnet.configuration as conf import pointnet2_atlasnet.libs.helpers as h from pointnet2_atlasnet.libs.settings import Settings from pointnet2_atlasnet.libs.network_wrapper import NetworkWrapper def set_random_seed(): ...
{"hexsha": "955698f38a899e95a6946dcce875e1b56c71953d", "size": 1382, "ext": "py", "lang": "Python", "max_stars_repo_path": "pointnet2_atlasnet/scripts/train_ae.py", "max_stars_repo_name": "skudin/PointNet2-AtlasNet", "max_stars_repo_head_hexsha": "bf407f0b3f30f99d8be2c2e365066e8d887b2502", "max_stars_repo_licenses": ["...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import copy import shutil try: import fcntl except ImportError: print "NO FILE LOCKING AVAILABLE (no fcntl on windows...)" import scipy as sp import scipy.linalg as la import sympy as sy import evoMPS.tdvp_uniform as tdvp import evoMPS.dynamics as d...
{"hexsha": "3bc12ccef3d59abfadf42075bc57ae38e379bf10", "size": 79797, "ext": "py", "lang": "Python", "max_stars_repo_path": "petals.py", "max_stars_repo_name": "amilsted/mps-rotors", "max_stars_repo_head_hexsha": "f040c879cc9db7c41fc2749efba76af345b844ff", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m...