text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
export isbase64 function isbase64(str::AbstractString, urlsafe::Bool=false)::Bool notBase64 = r"[^A-Z0-9+\/=]"i urlSafeBase64 = r"^[A-Z0-9_\-]*$"i if str === "" return true end if urlsafe return contains(str, urlSafeBase64) end if length(str) % 4 !== 0 || contains(str, no...
{"hexsha": "f214b94de9da385c146c3fd5f8f9e2fe55efe0c9", "size": 629, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/isbase64.jl", "max_stars_repo_name": "iskyd/validators.jl", "max_stars_repo_head_hexsha": "e3aba26ffb583ed48a5453358878c79aecce1df7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 10, "...
import numpy as np import logging from itertools import product from copy import copy import random class RandomSampler: def __init__(self, num_pops, num_strats, num_players, alpha_rank_func=None): self.num_pops = num_pops self.num_strats = num_strats self.num_players = num_players ...
{"hexsha": "43beaa5b2159f48a9d908b6d79d13d19ebc8ffa9", "size": 1570, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sampling_schemes/random.py", "max_stars_repo_name": "microsoft/InfoGainalpharank", "max_stars_repo_head_hexsha": "8cdab55e4c08f913918b48308c5062184bd8c7a8", "max_stars_repo_licenses": ["MIT"],...
import numpy as np arr = np.arange(10) np.random.shuffle(arr) print(arr)
{"hexsha": "574e795b40102127dfb4faa95635da3bd03a4900", "size": 74, "ext": "py", "lang": "Python", "max_stars_repo_path": ".notes/test.py", "max_stars_repo_name": "upupming/2019-MCM", "max_stars_repo_head_hexsha": "e86fd9152102d7e2f8f9b86597850cdf48dce917", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 11, "max...
from celery import shared_task,current_task from numpy import random from scipy.fftpack import fft @shared_task def fft_random(n): """ Brainless number crunching just to have a substantial task: """ for i in range(n): x = random.normal(0, 0.1, 2000) y = fft(x) if(i%30 == 0): ...
{"hexsha": "99054946983885bb445a0a78b73f6331774e06c8", "size": 633, "ext": "py", "lang": "Python", "max_stars_repo_path": "testapp/tasks.py", "max_stars_repo_name": "rohitchopra32/Django-Celery-With-Progress-Bar", "max_stars_repo_head_hexsha": "208e03c7efbaab95d51cae875c31b1c5dfdab88b", "max_stars_repo_licenses": ["MIT...
# Distributed under the MIT License. # See LICENSE.txt for details. import numpy as np from scipy.optimize import newton def compute_alpha(density, radius): def f(a): return density * radius**2 - 3. / (2. * np.pi) * a**10 / (1. + a**2)**6 def fprime(a): return 3. * a**9 * (a**2 - 5.) / (1. +...
{"hexsha": "a29c1b43f627d7d0fc052668a8540a3acac4bc41", "size": 1052, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/Unit/PointwiseFunctions/AnalyticSolutions/Xcts/ConstantDensityStar.py", "max_stars_repo_name": "nilsvu/spectre", "max_stars_repo_head_hexsha": "1455b9a8d7e92db8ad600c66f54795c29c3052ee", "ma...
# Load various imports import pandas as pd import os from datetime import datetime import librosa import numpy as np from os import environ environ['TF_CPP_MIN_LOG_LEVEL']='5' from keras.utils import to_categorical from keras.callbacks import ModelCheckpoint from keras.models import Sequential from keras.layers imp...
{"hexsha": "28f1ef0c6e92d465af461384507b131c9f012c7e", "size": 3520, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "fmented/Sound-classifier", "max_stars_repo_head_hexsha": "7a9a6f77f21886729cf896d0f261efc9f5e3489b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ...
import argparse import os import torch import numpy as np import cv2 import math import sys sys.path.append('../') from torch.utils import data from torch.autograd import Variable device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') def rot_normal(yaw, pitch, roll, normal): ''' Input: normal...
{"hexsha": "2e5e0d67ef45069aa96634221ccba15f86b16a9c", "size": 8738, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/normal_estimation/valid.py", "max_stars_repo_name": "qabach/coen-342-project", "max_stars_repo_head_hexsha": "70713ccbda4d53b18d29405b454c06a9dd6946cb", "max_stars_repo_licenses": ["BS...
[STATEMENT] lemma pairK_neq [simp]: "Key K \<notin> used evs \<Longrightarrow> pairK(A,B) \<noteq> K" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Key K \<notin> used evs \<Longrightarrow> pairK (A, B) \<noteq> K [PROOF STEP] apply clarify [PROOF STATE] proof (prove) goal: No subgoals! [PROOF STEP] done
{"llama_tokens": 128, "file": null, "length": 2}
# copyright Nils Deppe 2019 # (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) import matplotlib as mpl import matplotlib.ticker as mtick import numpy as np # Use standard LaTeX font on plots mpl.rcParams['mathtext.fontset'] = 'cm' mpl.rcParams['mathtext.rm'] = 'serif' mpl.rcParams['fon...
{"hexsha": "adf18796c2918e5a8b9025a102164a6c8f4b9520", "size": 8851, "ext": "py", "lang": "Python", "max_stars_repo_path": "pydro/Plotting.py", "max_stars_repo_name": "nilsdeppe/pydro", "max_stars_repo_head_hexsha": "aae4a985d45228301fabd8b725da682a545d9d32", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_count": 3...
function [hfig,finalim,final_pforefly] = PlotSampleFramesColor(trx,readframe,bkgdim0,predictions,mainfly,otherflies,ts,varargin) colorpos = [.7,0,0]; colorneg = [0,0,.7]; border = 20; [colorpos,colorneg,border,hfig,figpos,... cm,fg_thresh,bg_thresh,sigma_bkgd,wmah,frac_a_back,dist_epsilon,... ncolors_reference,so...
{"author": "kristinbranson", "repo": "JAABA", "sha": "5d778a23e3e7cf272df9a89a72b1b66d94f535d7", "save_path": "github-repos/MATLAB/kristinbranson-JAABA", "path": "github-repos/MATLAB/kristinbranson-JAABA/JAABA-5d778a23e3e7cf272df9a89a72b1b66d94f535d7/figurecode/PlotSampleFramesColor.m"}
# https://www.jakeruss.com/cheatsheets/stargazer/ # https://www.rdocumentation.org/packages/stargazer/versions/5.2.2/topics/stargazer suppressMessages(library(stargazer)) library(xtable) library(functional) load_model <- function(path){ model <- readRDS(path) return(model) } format_covariate_labels <- func...
{"hexsha": "f5f427194db7be1cfc6a92836b456edfa58231c1", "size": 893, "ext": "r", "lang": "R", "max_stars_repo_path": "pipeline/templates/stargazer.r", "max_stars_repo_name": "OpenSourceEconomics/pipeline", "max_stars_repo_head_hexsha": "cdd9679c62af32f52a07aba800b752e90af08396", "max_stars_repo_licenses": ["BSD-3-Clause...
function c = tapas_hgf_ar1_binary_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the Hierarchical Gaussian Filter (HGF) for AR(1) processes % for binary inputs in the absence of perceptual uncertainty. % % The HGF is the mod...
{"author": "translationalneuromodeling", "repo": "tapas", "sha": "604c56843c15411f5bd80190f81d845ac57d8592", "save_path": "github-repos/MATLAB/translationalneuromodeling-tapas", "path": "github-repos/MATLAB/translationalneuromodeling-tapas/tapas-604c56843c15411f5bd80190f81d845ac57d8592/HGF/tapas_hgf_ar1_binary_config.m...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This node calculates deviation and pitch angular velocity estimations both in simulation and real world. The monitor node has to subscribe to results of this node and form the negative return. During rollouts in the real world, this node evaluates safety measures of t...
{"hexsha": "5da1d0fffb5492b179c8b99f1163fae4e7fb2140", "size": 6823, "ext": "py", "lang": "Python", "max_stars_repo_path": "monitor/scripts/safety/safety.py", "max_stars_repo_name": "gwaxG/robot_ws", "max_stars_repo_head_hexsha": "ec8c85cc3b5e7262bba881bf96f4213f5403b8b5", "max_stars_repo_licenses": ["MIT"], "max_stars...
import numpy as np import pandas as pd import os from sklearn.model_selection import train_test_split from util import data_io def build_features(data): features = [] # remove NaNs data.fillna(0, inplace=True) data.loc[data.Open.isnull(), "Open"] = 1 # Use some properties directly features.ext...
{"hexsha": "c54c63e2789f6485ebbceb0250be6d37ba087b78", "size": 5313, "ext": "py", "lang": "Python", "max_stars_repo_path": "rossmann_data.py", "max_stars_repo_name": "dertilo/regression", "max_stars_repo_head_hexsha": "eb0cad7d47db610720ebc7aea7dacbbfc2e3af0c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
using PlotlyJS export drawMolGMM, drawMolGMMs, drawmol, drawPharmacophoreGMMs, plotdrawing const atom_colors = Dict(:C => "#383838", # dark grey :H => "#b5b5b5", # light grey :O => "#d62728", # red :N => "#1f77b4", # blue :S => "#cbd123", # yellow :...
{"hexsha": "b44598117eba14bfea64fcba8c4af18d223e7372", "size": 6237, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/draw.jl", "max_stars_repo_name": "tmcgrath325/MolecularGaussians.jl", "max_stars_repo_head_hexsha": "298ccb0f01b004c00a405a06bfe656de5b97f4a0", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
\section{Materials} \index{materials} \MMonCa\ assumes that the space is divided in {\tt materials}. A material can be a unary\index{unary material} material (i.e. Silicon, Iron), or a binary material\index{binary material} (i.e., SiC, GaAs). All materials are defined as directories in the \param{config} \MMonCa\ fold...
{"hexsha": "797961326f7b2917ed8accc932fd4854d640fd01", "size": 9813, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/defects/syntaxis.tex", "max_stars_repo_name": "imartinbragado/MMonCa", "max_stars_repo_head_hexsha": "126744a90253d7d7884c6dc7ec100db00a106a66", "max_stars_repo_licenses": ["Apache-2.0"], "max_s...
[STATEMENT] lemma hom_graph_inf: "hom_graph f S x a \<Longrightarrow> hom_graph f S y b \<Longrightarrow> hom_graph f S (x \<sqinter> y) (a \<sqinter> b)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>hom_graph f S x a; hom_graph f S y b\<rbrakk> \<Longrightarrow> hom_graph f S (x \<sqinter> y) (a \<s...
{"llama_tokens": 1218, "file": "Free-Boolean-Algebra_Free_Boolean_Algebra", "length": 6}
__precompile__(true) module MathParse import Base.string import Base.show export string export show function replacewithfunc(s::String, m::Regex, f) while (i = match(m, s)) != nothing s = replace(s, m => f(i.captures), count=1) end return s end function mparse(s::String) s = replace(s, r"\s+" => "") s = r...
{"hexsha": "fc7323564df66fca5e0cde11af952eb5d50c1fec", "size": 2136, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "MathParse/src/MathParse.jl", "max_stars_repo_name": "MarcusTL12/JuliaModules", "max_stars_repo_head_hexsha": "3ddb3f05548d25f74a6f9d7e3499be7f01510cd7", "max_stars_repo_licenses": ["Apache-2.0"], "...
[STATEMENT] lemma order_mult: assumes "p * q \<noteq> 0" shows "order a (p * q) = order a p + order a q" [PROOF STATE] proof (prove) goal (1 subgoal): 1. order a (p * q) = order a p + order a q [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. order a (p * q) = order a p + order a q [PROOF STEP]...
{"llama_tokens": 1869, "file": null, "length": 21}
/********************************************************************* * Software License Agreement (BSD License) * * Copyright 2016-2017 Davide Faconti * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions ...
{"hexsha": "ff5521871a1b52bfc34c54ebbcd835c68bcec976", "size": 6074, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/ros_type_introspection/substitution_rule.hpp", "max_stars_repo_name": "seanyen/ros_type_introspection", "max_stars_repo_head_hexsha": "f1f7ef5f8e3f1fe71fb3aa8682b59dc0c3920324", "max_stars_r...
[STATEMENT] lemma (in HMM) likelihood_init: "likelihood s os = T (s, obs) {\<omega> \<in> space S. L os \<omega>}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. likelihood s os = emeasure (T (s, obs)) {\<omega> \<in> space (stream_space (count_space UNIV)). \<exists>xs \<omega>'. \<omega> = xs @- \<omega>' \<and>...
{"llama_tokens": 2754, "file": "Hidden_Markov_Models_Hidden_Markov_Model", "length": 14}
import copy import os import tempfile import numpy as np import pytest import json from kaggle_environments.envs.halite.helpers import Board from halite_rl.utils import HaliteStateActionPair @pytest.fixture def halite_sap(): base_path = os.path.dirname(os.path.realpath(__file__)) sample_file = os.path.join...
{"hexsha": "918804128b5c107317fbc8c94cabb7128b4f2fb5", "size": 5256, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/utils/test_halite_state_action_pair.py", "max_stars_repo_name": "RyanJDick/halite_rl", "max_stars_repo_head_hexsha": "e6309a24d3d613171ceb6522ddf07fece3815e62", "max_stars_repo_licenses": ["...
import numpy as np from matplotlib import pyplot as plt import seaborn as sns def plot_data(): (load_timestamp, avg_loads, exp_loads, raw_loads, runtime_timestamps, runtimes) = (np.load("load_timestamp.npy"), np.load("avg_loads.npy"), np.load("exp_loads.npy"), np.load("raw_loads...
{"hexsha": "3ddfe9dd35913af250a6cc13202397de20206cee", "size": 5375, "ext": "py", "lang": "Python", "max_stars_repo_path": "utility/data_plotter.py", "max_stars_repo_name": "EfficientAI/efficient_cv", "max_stars_repo_head_hexsha": "e308f229e4d99da86ad56f87f3a78b2c81f27ca5", "max_stars_repo_licenses": ["MIT"], "max_star...
# Video 01: Gradient Descent video: https://www.youtube.com/watch?v=xRJCOz3AfYY&list=PL2-dafEMk2A7mu0bSksCGMJEmeddU_H4D source code: https://github.com/llSourcell/Intro_to_the_Math_of_intelligence/blob/master/demo.py gradient descent for line fitting: ## Sum of Squares Error Function $$sse(m,b) = \frac{1}{n} ...
{"hexsha": "1008dbc5cf7df476f9a24bd9d5135f48211a6075", "size": 7523, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "py/jupyter/Course-Math_of_Intelligence-Siraj_Raval.ipynb", "max_stars_repo_name": "jsdelivrbot/study-1", "max_stars_repo_head_hexsha": "3357cf1c3112e40018fee84b7eb62d14ce2258a1", "max...
import pandas as pd import numpy as np from heapq import nsmallest import matplotlib.pyplot as plt # Pull in data intrinio_df = pd.read_csv("intrinio_pull_total.csv") intrinio_df = intrinio_df[['enterprise_value', 'sector', 'ticker']] quandl_df = pd.read_csv("quandl_pull_total.csv") # Merge, Reorder, Drop NaNs, Drop ...
{"hexsha": "b69f3a19c2e580264a82db2704a4506a72e5e9f2", "size": 4261, "ext": "py", "lang": "Python", "max_stars_repo_path": "valuation_models/comp.py", "max_stars_repo_name": "Sean-Koval/PyVal", "max_stars_repo_head_hexsha": "c465cafed95d2375d088f3749b6d0b2f30bb3609", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import cv2 import numpy as np # Read image img = cv2.imread("imori_noise.jpg") H, W, C = img.shape # Gaussian Filter K_size = 3 sigma = 1.3 ## Zero padding pad = K_size // 2 out = np.zeros((H + pad*2, W + pad*2, C), dtype=np.float) out[pad:pad+H, pad:pad+W] = img.copy().astype(np.float) ## Kernel K = np.zeros((K_s...
{"hexsha": "7319c7384f88ad293fb14d1d0d0dbd91b924e86d", "size": 868, "ext": "py", "lang": "Python", "max_stars_repo_path": "Question_01_10/answers/answer_9.py", "max_stars_repo_name": "nishidayoshikatsu/Gasyori100knock", "max_stars_repo_head_hexsha": "f7fe35bca772eda2961a0790274c4934119b3fc2", "max_stars_repo_licenses":...
// // test-stat-collector.cc // // Created by Peter Gusev on 10 March 2016. // Copyright 2013-2016 Regents of the University of California // #include <stdlib.h> #include <boost/asio.hpp> #include <boost/assign.hpp> #include <boost/make_shared.hpp> #include <boost/algorithm/string/classification.hpp> #include <boos...
{"hexsha": "b604f3e5c1be23b7c6f37d67c14503f73f7cf906", "size": 14013, "ext": "cc", "lang": "C++", "max_stars_repo_path": "cpp/tests/test-stat-collector.cc", "max_stars_repo_name": "peurpdapeurp/ndnrtc", "max_stars_repo_head_hexsha": "59552bff9398ee2e49636f32cac020cc8027ae04", "max_stars_repo_licenses": ["BSD-2-Clause"]...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2014 Peter Caspers This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/o...
{"hexsha": "370c18414a610160494ed3a017e5119b96056223", "size": 10134, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "ql/experimental/volatility/sviinterpolation.hpp", "max_stars_repo_name": "thejourneyofman/QuantLib", "max_stars_repo_head_hexsha": "98467eaf6d1a20885f05ea1aa602bb8380c39390", "max_stars_repo_licens...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: tshzzz """ import torch import numpy as np def load_conv(buf, start, conv_model): num_w = conv_model.weight.numel() num_b = conv_model.bias.numel() conv_model.bias.data.copy_(torch.from_numpy(buf[start:start + num_b]).view_as(conv_model.bias));...
{"hexsha": "0b95c5ebd443b389431ef4a5762c735191c1c530", "size": 2874, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/utils.py", "max_stars_repo_name": "b1xian/jinnan_yolo_baseline", "max_stars_repo_head_hexsha": "539d748d7aa60ab0e3c964eab333af46b806e1db", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
//#include <cstddef> #include <boost/preprocessor.hpp> #ifndef POLICY_LIMIT #define POLICY_LIMIT 4 #endif namespace detail { struct nada { }; template<typename Before, typename T> struct dummy_concept : public Before { }; } #define TEMPL_PARAM(z, N, data) \ BOOST_PP_COMMA_IF(N)...
{"hexsha": "96b59eb27da29b021226d55aec6f9cca14d48620", "size": 2182, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "sketches/old/greatcontainer2.cpp", "max_stars_repo_name": "aristidb/fragments", "max_stars_repo_head_hexsha": "5bcf566b02a77f97d9726a0ba91425ca15a1f946", "max_stars_repo_licenses": ["BSL-1.0"], "max...
# coding: utf-8 # Copyright (c) SJTU Pymatgen Development Team. from __future__ import division, unicode_literals, print_function import logging from collections import defaultdict import numpy as np from monty.io import zopen from pymatgen.core.structure import Structure from pymatgen.core.lattice import Lattice f...
{"hexsha": "11fe4ccb0c258f639688210d96557f26fcfe2e34", "size": 9316, "ext": "py", "lang": "Python", "max_stars_repo_path": "lmpdump.py", "max_stars_repo_name": "lingtikong/sjtumgi", "max_stars_repo_head_hexsha": "15c94d853b89eb6fa44fefe257925f285052bcc4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma...
SUBROUTINE TRLG C C THIS IS THE MODULE DRIVER FOR TRLG(TRANSIENT LOAD GENERATOR) C C INPUTS(14) C CASEXX CASECONTROL C USETD C DLT DYNAMIC LOAD TABLE C SLT STATIC LOAD TABLE C BGPDT BASIC GRID POINT DEFINITION TABLE C SIL S...
{"hexsha": "5b93fd1eba7d92db21e3c849a7a2e6cd5c9975cb", "size": 2355, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "mis/trlg.f", "max_stars_repo_name": "ldallolio/NASTRAN-95", "max_stars_repo_head_hexsha": "6d2c175f5b53ebaec4ba2b5186f7926ef9d0ed47", "max_stars_repo_licenses": ["NASA-1.3"], "max_stars_count": 14...
""":mod:`mirgecom.flux` provides inter-facial flux routines. Numerical Flux Routines ^^^^^^^^^^^^^^^^^^^^^^^ .. autofunction:: gradient_flux_central .. autofunction:: divergence_flux_central .. autofunction:: flux_lfr .. autofunction:: divergence_flux_lfr """ __copyright__ = """ Copyright (C) 2021 University of Illi...
{"hexsha": "92d5ff838e7635f1507f763f981cafc6cb19f1ac", "size": 7429, "ext": "py", "lang": "Python", "max_stars_repo_path": "mirgecom/flux.py", "max_stars_repo_name": "dreamer2368/mirgecom", "max_stars_repo_head_hexsha": "dc79645af040510a7e2b11d3f93db4c34ad39228", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3...
/* Copyright 2005-2007 Adobe Systems Incorporated Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt or a copy at http://stlab.adobe.com/licenses.html) */ /*************************************************************************************************/ #include <adobe/config.hpp> #includ...
{"hexsha": "75fcf31ab79471d889e5974b1908e4d97b9d6592", "size": 1389, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/unit_tests/name/name_test.cpp", "max_stars_repo_name": "brycelelbach/asl", "max_stars_repo_head_hexsha": "df0d271f6c67fbb944039a9455c4eb69ae6df141", "max_stars_repo_licenses": ["MIT"], "max_sta...
from types import SimpleNamespace from typing import Dict, Tuple, Union import gym import numpy as np class RewardModelMeanWrapper(gym.RewardWrapper): def __init__(self, env: gym.Env, reward_model, debug=False, normalize=False): self.reward_model = reward_model self.debug = debug self.nor...
{"hexsha": "35a2121067a6bf1dea06a214f4b3b56acc0f21ba", "size": 2208, "ext": "py", "lang": "Python", "max_stars_repo_path": "active_reward_learning/envs/reward_model_mean_wrapper.py", "max_stars_repo_name": "david-lindner/idrl", "max_stars_repo_head_hexsha": "54cfad330b0598ad4f6621796f2411644e50a6ba", "max_stars_repo_li...
print("Testing Parameters...") took_seconds = @elapsed include("ParametersTests.jl") println("done (took ", took_seconds, " seconds)") print("Testing Trial/TrialEstimate/TrialRatio/TrialJudgement...") took_seconds = @elapsed include("TrialsTests.jl") println("done (took ", took_seconds, " seconds)") print("Testing Be...
{"hexsha": "e725948232c89d6a3d5e7cc240c9178a3c174a8c", "size": 714, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "sthagen/JuliaCI-BenchmarkTools.jl", "max_stars_repo_head_hexsha": "adaa9e8f6e06bf625a85973d159884810920e470", "max_stars_repo_licenses": ["MIT"], "max_star...
# "NOQA" to suppress flake8 warning from cupy.functional import piecewise # NOQA
{"hexsha": "866e855103435a3c6e361d6af64598e0fef2b343", "size": 82, "ext": "py", "lang": "Python", "max_stars_repo_path": "cupy/functional/__init__.py", "max_stars_repo_name": "mnicely/cupy", "max_stars_repo_head_hexsha": "9ed1d0db1404e9baa3c139032515d6028078bc91", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
import math import os import random from typing import List, Optional, Tuple import matplotlib.pyplot as plt import numpy as np import seaborn as sns import torch from matplotlib.axes import Axes from matplotlib.figure import Figure from torch import Tensor __all__ = ["plot", "set_random_seed"] sns.set_theme(style="...
{"hexsha": "f184c211050a611cbd73805a8f9b24b3d92c73ce", "size": 4524, "ext": "py", "lang": "Python", "max_stars_repo_path": "tsts/utils.py", "max_stars_repo_name": "TakuyaShintate/tsts", "max_stars_repo_head_hexsha": "483db1edc2f765a5449137446a77acaf17684ce9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16, "...
""" Likelihood module to evaluate the joint likelihood of a set of tomographic 3x2pt power spectra, binned into bandpowers, on the cut sky using a multivariate Gaussian likelihood. The main functions are setup, which should be called once per analysis, and execute, which is called for every new point in parameter spac...
{"hexsha": "ecf4bce5787f147212738ea4c98b4e908fabec60", "size": 11043, "ext": "py", "lang": "Python", "max_stars_repo_path": "angular_binning/like_bp_gauss_mix.py", "max_stars_repo_name": "robinupham/angular_binning", "max_stars_repo_head_hexsha": "da3f6bf32efd8bad1a7f61a9a457f521ed8ebe87", "max_stars_repo_licenses": ["...
import csv import iomb.util as util import iomb.refmap as ref import logging as log import matplotlib.pyplot as plt import pandas as pd import numpy as np class Entry(object): """ Contains the information of an entry in a satellite table. """ def __init__(self, value: float): self.value = value ...
{"hexsha": "8cc125c7a901472e7be15f75cb74a5aec226a915", "size": 13573, "ext": "py", "lang": "Python", "max_stars_repo_path": "iomb/sat.py", "max_stars_repo_name": "USEPA/IO-Model-Builder", "max_stars_repo_head_hexsha": "8ddd95a40034fb4080e627e2ca75dc41355f946e", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count":...
import datetime from typing import Dict, Optional, Union import numpy as np import pandas as pd from src.core.base_model import ExtraModel from src.core.common.singletons import RESHAPE VegAttribute = Union[float, list, tuple, np.ndarray] class LifeStages(ExtraModel): def __init__(self, ls, constants): ...
{"hexsha": "5cd90479755be2d2af0f93f912f52053510e9da6", "size": 7062, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/biota_models/vegetation/model/veg_lifestages.py", "max_stars_repo_name": "Deltares/NBSDynamics", "max_stars_repo_head_hexsha": "4710da529d85b588ea249f6e2b4f4cac132bb34f", "max_stars_repo_licen...
# TODO # prendi un topo # prendi 8 parametri! T, lapse, r11, r12, r13, r21, r22, r23 # nll_data(dati, T, lapse, r11, r12, r13, r21, r22, r23) # come si fa? # splitta in df11, ..., df23 (protocollo e barrier) # calcola nll_data(df11, T, r11, lapse), etc.. # fai la somma # ottimizza per T, r11, r12, r13, r21, r22, r23, l...
{"hexsha": "47792b793cb06814714b35d8082328b44add274f", "size": 4985, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "sequence/E_FixedTreshandLapse.jl", "max_stars_repo_name": "DarioSarra/FlippingModel.jl", "max_stars_repo_head_hexsha": "5fa22cfe17506010d3f91e0ab6ff64e5b4610c90", "max_stars_repo_licenses": ["MIT"]...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
{"hexsha": "72a7fbe410ac083aa6cb7e338ce793c142d2af25", "size": 6982, "ext": "py", "lang": "Python", "max_stars_repo_path": "qiskit_nature/problems/second_quantization/vibrational/vibrational_structure_problem.py", "max_stars_repo_name": "davindratulsi/qiskit-nature", "max_stars_repo_head_hexsha": "d5209bbfe6b83496dc2be...
# @Date: 2020-04-24T10:19:05+02:00 # @Last modified time: 2020-04-25T11:59:59+02:00 import model import numpy as np import h5py import scipy.io as scio from sklearn.metrics import accuracy_score from sklearn.metrics import classification_report from sklearn.metrics import cohen_kappa_score from sklearn.metrics imp...
{"hexsha": "ec150ca38cd755feb479409ab5f72403266fc352", "size": 2027, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluation.py", "max_stars_repo_name": "ChunpingQiu/benchmark-on-So2SatLCZ42-dataset-a-simple-tour", "max_stars_repo_head_hexsha": "4d28ac48c7b226f79ea792cda6c6a6a58f79c04e", "max_stars_repo_licen...
#!/usr/bin/env python3 from jinja2 import Environment, FileSystemLoader import yaml import os import datetime import numpy as np # HARDCODE LUMPTEMPLATE = 'LuMP_recorder.j2' LCUTEMPLATE = 'beamctl.j2' LUMPPROCESS = 'LuMP_processor.j2' DATADIRROOT = '/local_data/ARTEMIS/' SCRIPTDIR = '/data/Commissioning/PSRMonitor/Ar...
{"hexsha": "71eefc09fcc6e718e67615cdb9812684ec786bc9", "size": 6307, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/generateObsScripts.py", "max_stars_repo_name": "ArisKarastergiou/artemis3", "max_stars_repo_head_hexsha": "7c76eedcdd7252113a041d55c185a7e1e8488ba6", "max_stars_repo_licenses": ["MIT"], "m...
from numpy import empty import pandas as pd import re # This program is used to parse the pokedex.txt file and the gen8ou-1825.txt file. # From there it adds them to more organized DataFrames def usage_dataframe(): # File path for usage stats file = r'C:/Users/kingj/OneDrive/Desktop/python/pokemon/gen8ou-1825...
{"hexsha": "10203b6fa192c84347658d863cb6ba82ad06215d", "size": 1543, "ext": "py", "lang": "Python", "max_stars_repo_path": "pokemon_analysis.py", "max_stars_repo_name": "james051898/showdown_code", "max_stars_repo_head_hexsha": "c3eebbe1540218155102ef667f7b1569c270e283", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
import numpy as np #takes a torch matrix, and applies calculations to create single value aggregations def matrixCalculations(mat,prefix='',dictionary={}): if mat is None: for item in ['sum','avg','avgmax','prod','max']: dictionary[prefix+item] = '?' return dictionary dictionary[prefix+'sum'] =...
{"hexsha": "3ed8bffb556a7911b9b6367a2ef7d8fbc88377e2", "size": 4811, "ext": "py", "lang": "Python", "max_stars_repo_path": "pairwisePreprocess/PairwisePreprocessUtils.py", "max_stars_repo_name": "bmd2007/benchmark_eval", "max_stars_repo_head_hexsha": "aa42bb3369e79db4cb63e1963afcc8af6d8f5696", "max_stars_repo_licenses"...
[STATEMENT] lemma P23_invariant: shows "invariant (composition) P23" [PROOF STATE] proof (prove) goal (1 subgoal): 1. invariant composition P23 [PROOF STEP] proof (auto simp only:invariant_def) [PROOF STATE] proof (state) goal (1 subgoal): 1. \<And>a b. reachable composition (a, b) \<Longrightarrow> P23 (a, b) [PROOF...
{"llama_tokens": 4123, "file": "Abortable_Linearizable_Modules_Idempotence", "length": 50}
Require Import Merges.Tactics. Require Import Merges.Map. Require Import Merges.Machine. Require Import Merges.Fusion. Require Import Merges.Example.Base. Require Import Merges.Example.Combinators. Require Import Coq.Lists.List. Import ListNotations. Set Implicit Arguments. Require Import Coq.Logic.FunctionalExtensi...
{"author": "amosr", "repo": "merges", "sha": "bf8cb7bca2d859977d6fb8bf4a9d07ac780b7edd", "save_path": "github-repos/coq/amosr-merges", "path": "github-repos/coq/amosr-merges/merges-bf8cb7bca2d859977d6fb8bf4a9d07ac780b7edd/proof/Merges/Example/Eval/MapMap.v"}
import numpy as np import time from math import floor import multiprocessing as mp import scipy.special #Initialize parameters Num_of_sim_per_proc = 1 start_time = time.time() e = 5. alpha = 0.33 ntot = 100 na = int(ntot*alpha) nh = ntot - na height = 5 #height of the attack p=float(e)/float(1*ntot) unrealistic = 0 #d...
{"hexsha": "fa3b56e4a1b754b6421ee0737d4108a2bb149d0a", "size": 3856, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/vrf-chain-sim/find_pattern.py", "max_stars_repo_name": "filecoin-project/consensus", "max_stars_repo_head_hexsha": "8824ad5fb8948706995805692d594f6ccf199176", "max_stars_repo_licenses": ["Apa...
[STATEMENT] lemma just_cash_plus [simp]: "just_cash a + just_cash b = just_cash (a + b)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. just_cash a + just_cash b = just_cash (a + b) [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. just_cash a + just_cash b = just_cash (a + b) [PROOF STEP] { [PR...
{"llama_tokens": 1908, "file": "Risk_Free_Lending_Risk_Free_Lending", "length": 22}
/* * @file * @author University of Warwick * @version 1.0 * * @section LICENSE * * @section DESCRIPTION * */ #define BOOST_TEST_MODULE AllToAllMPI #include <boost/test/unit_test.hpp> #include <boost/test/output_test_stream.hpp> #include <stdexcept> #include "AllToAllMPI.h" #include "mpi.h" #include <iostream...
{"hexsha": "7c464ba96a013ec19c26fbc510db44aa224a7725", "size": 7487, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/comm/implementation/component/AllToAllMPITests.cpp", "max_stars_repo_name": "thorbenlouw/CUP-CFD", "max_stars_repo_head_hexsha": "d06f7673a1ed12bef24de4f1b828ef864fa45958", "max_stars_repo_lic...
import numba as nb import numpy as np from dmdlib.core.ALP import AlpDmd from dmdlib.randpatterns import utils from dmdlib.randpatterns import ephys_comms import os from dmdlib.randpatterns import saving from dmdlib.randpatterns.presenter import Presenter if os.name == 'nt': appdataroot = os.environ['APPDATA'] ...
{"hexsha": "0fd959f4faa7b6df08c47fc62f59e399a5749052", "size": 5209, "ext": "py", "lang": "Python", "max_stars_repo_path": "dmdlib/randpatterns/multisparse_obj.py", "max_stars_repo_name": "murselkaradas/DmdLib", "max_stars_repo_head_hexsha": "d1b46ffa54b9170c248e0c557b7080384aa8cf8a", "max_stars_repo_licenses": ["MIT"]...
import unittest import mock import numpy import cupy try: import cupy.cuda.cudnn as libcudnn cudnn_enabled = True modes = [ libcudnn.CUDNN_ACTIVATION_SIGMOID, libcudnn.CUDNN_ACTIVATION_RELU, libcudnn.CUDNN_ACTIVATION_TANH, ] import cupy.cudnn except ImportError: cudnn_e...
{"hexsha": "caecf77c7027af88bf7492f3d8eb08cfa27c37bf", "size": 3516, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/cupy_tests/test_cudnn.py", "max_stars_repo_name": "yukiito2/cupy", "max_stars_repo_head_hexsha": "7e707b8ccea13d79b9026c91c27143cb78014d4b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max...
using Clang.cindex using Base.Test top = cindex.parse_header("cxx/cxxbasic.h"; cplusplus = true) funcs = cindex.search(top, "func") @test length(funcs) == 1 f = funcs[1] #@test map(spelling, cindex.function_args(f)) == ASCIIString["Int", "Int"] @test map(spelling, cindex.function_args(f)) == ASCIIString["x", "y"] @t...
{"hexsha": "b59928b735f848b1c0797e35af19b24b469aba8d", "size": 572, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/functions.jl", "max_stars_repo_name": "jakebolewski/Clang.jl", "max_stars_repo_head_hexsha": "bb48537bf1e86edb94635704e84df4a1ea8b5bc5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n...
! RUN: %S/test_errors.sh %s %t %f18 ! Tests for the ASSOCIATED() and NULL() intrinsics subroutine assoc() abstract interface subroutine subrInt(i) integer :: i end subroutine subrInt integer function abstractIntFunc(x) integer, intent(in) :: x end function end interface contains i...
{"hexsha": "641b7d97d78af61c9668a3d094896fa2300d688e", "size": 7745, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "flang/test/Semantics/associated.f90", "max_stars_repo_name": "Machiry/checkedc-clang", "max_stars_repo_head_hexsha": "ab9360d8be0a737cb5e09051f3a0051adc4b3e47", "max_stars_repo_licenses": ["BSD-...
[STATEMENT] lemma dvd_PM_iff: "p dvd q \<longleftrightarrow> divides_ff (content_ff_ff p) (content_ff_ff q) \<and> map_poly to_fract p dvd map_poly to_fract q" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (p dvd q) = (divides_ff (content_ff (map_poly to_fract p)) (content_ff (map_poly to_fract q)) \<and> map_po...
{"llama_tokens": 7446, "file": "Berlekamp_Zassenhaus_Unique_Factorization_Poly", "length": 75}
C @(#)ext_gedcc.f 20.8 2/28/00 C**************************************************************** C C File: ext_gedcc.f C C Purpose: Routine to extract d-c converter data in GE format C C Input parameters: C C savfil - the logical unit opened C version - "23" or "24" C C Aut...
{"hexsha": "5ce50e80e5b6f5b7503d57db5912ca8560d9fbef", "size": 12938, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ipf/ext_gedcc.f", "max_stars_repo_name": "mbheinen/bpa-ipf-tsp", "max_stars_repo_head_hexsha": "bf07dd456bb7d40046c37f06bcd36b7207fa6d90", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1...
module dapr const _ProtoBuf_Top_ = @static isdefined(parentmodule(@__MODULE__), :_ProtoBuf_Top_) ? (parentmodule(@__MODULE__))._ProtoBuf_Top_ : parentmodule(@__MODULE__) module proto const _ProtoBuf_Top_ = @static isdefined(parentmodule(@__MODULE__), :_ProtoBuf_Top_) ? (parentmodule(@__MODULE__))._ProtoBuf_Top_...
{"hexsha": "6ea8bcfdc66f01f1c3ffc0990fb914e8fd419b73", "size": 1270, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/proto/src/generated/service_invocation/dapr.jl", "max_stars_repo_name": "oolong-dev/Dapr.jl", "max_stars_repo_head_hexsha": "133460f4ccf7c86313089c65e1efa7155afa4c91", "max_stars_repo_licenses"...
import numpy as np import os from glob import glob from skimage.io import imread, imsave from skimage.transform import resize from keras.preprocessing.image import ImageDataGenerator import argparse parser = argparse.ArgumentParser() parser.add_argument('--path', type=str, default='./banque_tableaux_par_artiste_resi...
{"hexsha": "864bcd2ed527371512584ce93156f1443d8a2072", "size": 2267, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/data_augmentation.py", "max_stars_repo_name": "SebastianPartarrieu/ThroughArtistsEyes", "max_stars_repo_head_hexsha": "8e195119cbb1d0edf054819f3d8e1d6ffd185abc", "max_stars_repo_licenses": [...
#include <boost/compute/interop/vtk.hpp>
{"hexsha": "f4cd6ac4d83082ed47c0f294071de6314eb60c3f", "size": 41, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_compute_interop_vtk.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0"]...
(******************************************************************** @name Coq declarations for metamodel: <ATOM> @date 2021/11/02 10:10:52 @description Automatically generated by Ecore2Coq transformation. ********************************************************************) (* Coq libraries *) Require Import S...
{"author": "atlanmod", "repo": "coqtl", "sha": "5daf5d915b66328ae5ec48f55c44731372563c87", "save_path": "github-repos/coq/atlanmod-coqtl", "path": "github-repos/coq/atlanmod-coqtl/coqtl-5daf5d915b66328ae5ec48f55c44731372563c87/transformations/RSS2ATOM/ATOMFlattened.v"}
# Simple Node import sys import random import numpy as np import pygame from data import * from gbls import * sys.path.append("../common/") from NodeBase import NodeBase class Node(NodeBase): def __init__(self, x, y, ss): # pass parameters to parent NodeBase.__init__(self, x, y, ss) # h...
{"hexsha": "82659292799c4c23a4dff14282a7f25a2e149104", "size": 4061, "ext": "py", "lang": "Python", "max_stars_repo_path": "aps/aps_dvh_node.py", "max_stars_repo_name": "Manewing/APS", "max_stars_repo_head_hexsha": "834c16555f52461c65fc39132653bb9d68f97cca", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ...
import torch from src.helper_functions.helper_functions import parse_args from src.loss_functions.losses import AsymmetricLoss, AsymmetricLossOptimized from src.models import create_model import argparse from PIL import Image import numpy as np from glob import glob from time import time parser = argparse.ArgumentPar...
{"hexsha": "cd07f9bfdf686209d4ed491c65cbac74487647c7", "size": 2211, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "MinliangLin/ASL", "max_stars_repo_head_hexsha": "beda0989a8e30ac51a7ce9f9e247a12bbe84ec96", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_star...
import pandas as pd import numpy as np from os import listdir from os.path import isfile, join import nltk from nltk.stem.porter import PorterStemmer # from krovetzstemmer import Stemmer as KrovetzStemmer #TODO: uncomment after installing the krovetz setmmer. import re import os, shutil def encode_id(topic_id, facet_...
{"hexsha": "70049f310e6e19f153ff3ea7347286e322d828b8", "size": 2292, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/utils/utils.py", "max_stars_repo_name": "aliannejadi/qulac", "max_stars_repo_head_hexsha": "d175f0179cb4084067f82a5b27d423bc2d9d8656", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 60...
c code modifications based on: 04/02/93 - analy.f cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc subroutine sort(expid,verbose,luverb,nnobs, 1 rlats,rlons,rlevs,kx,kt,del,sigU,sigO,sigF,tstamp, 1 maxreg,ktmax,iregbeg,ireglen,ityplen) c.... Sort data b...
{"hexsha": "56d8aa24ea70096c47b9fac69a0d832a905f97e8", "size": 7108, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/Shared/GMAO_Shared/GMAO_psas/sort.f", "max_stars_repo_name": "GEOS-ESM/AeroApps", "max_stars_repo_head_hexsha": "874dad6f34420c014d98eccbe81a061bdc0110cf", "max_stars_repo_licenses": ["NASA-1....
%Suggested order of slides % slides-cod.tex % slides-cod-examples.tex \subsection{Curse of Dimensionality} \includepdf[pages=-]{../slides-pdf/slides-cod.pdf} \subsection{Curse of Dimensionality - Examples} \includepdf[pages=-]{../slides-pdf/slides-cod-examples.pdf}
{"hexsha": "d902385a291e211c6d503e4c12d5104fe75cf2a0", "size": 270, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "slides/cod/chapter-order.tex", "max_stars_repo_name": "jukaje/lecture_i2ml", "max_stars_repo_head_hexsha": "cd4900f5190e9d319867b4c0eb9d8e19f659fb62", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_s...
/* * Operator.cpp * evaluate the expression graph * =======================================================*/ #include "Operator.hpp" #include "utils/utils.hpp" #include "utils/calcTime.hpp" #include "Kernel.hpp" #include "Jit_Driver.hpp" #include "Grid.hpp" #include <fstream> #include <sstream> #include <stdio.h> ...
{"hexsha": "43d1cb1e3fcc269cf6c86d4a66bbfb392ff534bf", "size": 40659, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Operator.cpp", "max_stars_repo_name": "hxmhuang/OpenArray_Dev", "max_stars_repo_head_hexsha": "863866a6b7accf21fa253567b0e66143c7506cdf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3.0,...
#define BOOST_TEST_MODULE #include <boost/test/unit_test.hpp> #include <util/test_macros.hpp> #include <string> #include <random> #include <set> #include <sstream> #include <vector> #include <algorithm> #include <util/cityhash_tc.hpp> // Eigen #include <Eigen/Core> #include <Eigen/SparseCore> // Constraints #include ...
{"hexsha": "c6546c4e7f15adb374605c043d2a95849ea0218a", "size": 3284, "ext": "cxx", "lang": "C++", "max_stars_repo_path": "test/optimization/constraint_interface.cxx", "max_stars_repo_name": "shreyasvj25/turicreate", "max_stars_repo_head_hexsha": "32e84ca16aef8d04aff3d49ae9984bd49326bffd", "max_stars_repo_licenses": ["B...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F ################################# # Models for federated learning # ################################# # McMahan et al., 2016; 199,210 parameters class TwoNN(nn.Module): def __init__(self, name, in_features, num_hiddens, num_clas...
{"hexsha": "dc6cf7ee5b9b145dd81a401628e0407528b7c256", "size": 3321, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models.py", "max_stars_repo_name": "vaseline555/Federated-Averaging-PyTorch", "max_stars_repo_head_hexsha": "eef9a4d2cfe7866bc0aec27a28d97486dbada4da", "max_stars_repo_licenses": ["MIT"], "max...
[STATEMENT] lemma (in semiring_0) last_linear_mul_lemma: "last ((a %* p) +++ (x # (b %* p))) = (if p = [] then x else b * last p)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. last (a %* p +++ (x # b %* p)) = (if p = [] then x else b * last p) [PROOF STEP] apply (induct p arbitrary: a x b) [PROOF STATE] proof (p...
{"llama_tokens": 1302, "file": null, "length": 9}
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # 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...
{"hexsha": "86d8a3b7cbbc8558e3eb51493c9348017966632f", "size": 8178, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensor2tensor/utils/optimize.py", "max_stars_repo_name": "sivaramakrishna7/tensor2tensor", "max_stars_repo_head_hexsha": "eb0118d3f459913133e3d68a96944480a928bff1", "max_stars_repo_licenses": ["Ap...
// $Id$ /*********************************************************************** Moses - factored phrase-based language decoder Copyright (C) 2006 University of Edinburgh This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by th...
{"hexsha": "7b370ff36195e906c6edb3bd4a9a9c980c7c2cc2", "size": 3412, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/decoder-phrasebased/src/native/decoder/moses/FactorCollection.cpp", "max_stars_repo_name": "ugermann/MMT", "max_stars_repo_head_hexsha": "715ad16b4467f44c8103e16165261d1391a69fb8", "max_stars_re...
import unittest import numpy as np import pandas as pd from mlots.utilities import from_pandas_dataframe class TestFPD(unittest.TestCase): def setUp(self) -> None: print("Starting a test in TestFPD..") data = { 1: [1, 2, 3, 4, 5], 2: [6, 7, 8, 9, 10], 3: [11, 1...
{"hexsha": "2cdb6c9638abb0671412b59c41d67e491025b5db", "size": 2931, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_FPD.py", "max_stars_repo_name": "I-Form/mlots", "max_stars_repo_head_hexsha": "afb1530e6cc3ad7c41f86ac66c3496106681334c", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":...
import numpy as np import cdflib from .DectoHHMM import DectoHHMM from .DateSplit import DateSplit def CDFEpoch(Date,ut): ''' Converts date and time to CDF Epoch - which is the number of milliseconds since 00000101 00:00 Inputs ====== Date : int Array of dates int he format yyyymmdd ut : float Array of t...
{"hexsha": "28e3fb19c32944d269da4f6cc2e7ee5ffeed59d2", "size": 674, "ext": "py", "lang": "Python", "max_stars_repo_path": "build/lib/DateTimeTools/CDFEpoch.py", "max_stars_repo_name": "pshustov/DateTimeTools", "max_stars_repo_head_hexsha": "e542fd3f0e3c5290faad09b7cf8a2751132d4dd3", "max_stars_repo_licenses": ["MIT"], ...
import os import numpy as np from demo_utils import plot_image import svmbir """ This file demonstrates the use of the proximal map function in svmbir. The phantom, sinogram, and reconstruction are then displayed. """ # Simulated image parameters num_rows_cols = 256 # Assumes a square image num_slices = 33 display...
{"hexsha": "e6eea09abdd8d1f4b20d681637a3cf1b92f6b65e", "size": 2110, "ext": "py", "lang": "Python", "max_stars_repo_path": "demo/demo_prox.py", "max_stars_repo_name": "Mohammad-Chowdhury-31/svmbir", "max_stars_repo_head_hexsha": "05665eb2a65b7aa951e26dd3691955e737f16c06", "max_stars_repo_licenses": ["BSD-3-Clause"], "m...
""" Utility functions """ import numpy as np import pandas as pd def path_boundaries(links: np.array) -> np.array: ''' boolean mask of links which have 0 as either upstream or downstream ''' # Links to 0 Bin indicate the beginning or end of a path. 0 Bin has no sequence return np.any(links == 0, axis=1)...
{"hexsha": "736adfd3eeeba351ffdfcf7c6a288c1ba7a7d47c", "size": 3198, "ext": "py", "lang": "Python", "max_stars_repo_path": "matrixcomponent/utils.py", "max_stars_repo_name": "dimatr/component_segmentation", "max_stars_repo_head_hexsha": "26e89579300f7653cd9e8a531f684cbc64a0cd17", "max_stars_repo_licenses": ["Apache-2.0...
########################################### # Concrete implementations of AbstractWord: # Word and SubWord # """ Word{T} <: AbstractWord{T} Word as written in an alphabet storing only pointers to letters of an Alphabet. Note that the negative values in `genptrs` field represent the inverse of letter. If type i...
{"hexsha": "19d414b63d6241e367225be73752b414b40d12f7", "size": 2290, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/words.jl", "max_stars_repo_name": "kalmarek/KnuthBendix.jl", "max_stars_repo_head_hexsha": "74f6bdbb804723f88cb8ed1b60bb27b3e839576b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 7, ...
#---------------------------------------------------------------------# #This code computes the element mass and differentiation matrices #Written by F.X. Giraldo on April 24, 2019 # Department of Applied Mathematics # Naval Postgraduate School # Monterey; CA 93943-5216 #------------------...
{"hexsha": "7ae998f05fb4229ebfca46b020a18bff787e2d3b", "size": 1444, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Projects/Project_06_2D_Wave/For_Instructors/julia/element_matrices.jl", "max_stars_repo_name": "fxgiraldo/Element-based-Galerkin-Methods", "max_stars_repo_head_hexsha": "3e7cd28b5d6000a95b00710f15a...
import zlib import numpy as np import tensorflow.compat.v2 as tf from pyquaternion import Quaternion from waymo_open_dataset import dataset_pb2 from waymo_open_dataset.utils import range_image_utils from waymo_open_dataset.utils import transform_utils tf.enable_v2_behavior() def decode_frame(frame, frame_id): ...
{"hexsha": "0fcb1f7016845cdbb417522bdf501b605cd5cb6e", "size": 8259, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/preprocess/waymo_decoder.py", "max_stars_repo_name": "eladb3/BoxeR", "max_stars_repo_head_hexsha": "995a38b67e3f84b5d6ea6fedbcb16896c4b1d020", "max_stars_repo_licenses": ["MIT"], "max_stars_...
module TestCat using Base.Test using DataTables # # hcat # nvint = NullableArray(Nullable{Int}[1, 2, Nullable(), 4]) nvstr = NullableArray(Nullable{String}["one", "two", Nullable(), "four"]) dt2 = DataTable(Any[nvint, nvstr]) dt3 = DataTable(Any[nvint]) dt4 = convert(DataTable...
{"hexsha": "52c230a86192beefd1cdc2c148148694803f531b", "size": 12557, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/cat.jl", "max_stars_repo_name": "UnofficialJuliaMirror/DataTables.jl-933ac57d-ae2c-5684-854b-0ea345a8088a", "max_stars_repo_head_hexsha": "5199293f36e13d29819f7bd0259ca6be0f4195e2", "max_star...
*dk,vorpoint subroutine vorpoint(n1,n2,n3,n4,xv,yv,zv,distsq) implicit real*8 (a-h,o-z) C C ##################################################################### C C PURPOSE - C C This routine calculates the 3-D voronoi point C C INPUT ARGUMENTS - C C n1-n4 - the points in the tetrah...
{"hexsha": "c12dc0dfe34c968f9d9eca01f1107d2a349be9fd", "size": 3106, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/vorpoint.f", "max_stars_repo_name": "millerta/LaGriT-1", "max_stars_repo_head_hexsha": "511ef22f3b7e839c7e0484604cd7f6a2278ae6b9", "max_stars_repo_licenses": ["CNRI-Python"], "max_stars_count"...
import discord from pymongo import MongoClient from discord.ext import commands import matplotlib.pyplot as plt import numpy as np import pprint collection = MongoClient('localhost', 27017).maindb.VCJoins pipeline = [{'$match': {'$and': [{'guildId': 802298523214938153}, {'time': {'gt': 1638996791.4233649}}]}}, {'$gr...
{"hexsha": "f6a136d889b4ffc0584b2d1325441f48d15c50dc", "size": 603, "ext": "py", "lang": "Python", "max_stars_repo_path": "documentation/statsAggregate.py", "max_stars_repo_name": "XFazze/discordbot", "max_stars_repo_head_hexsha": "6b4201a6d6ff1bed5f65de4b4d30738b4d51e223", "max_stars_repo_licenses": ["MIT"], "max_star...
const ϵ = 1.0e-6 function decibel(value::Real) return 10 * log10(value) end # Test odd-length signal @testset "summarize PSD" begin N = 90000 fs = 100. num_segments = 13 smoothing_width_factor = 2. T = Float64 data = Array{T, 2}(undef, num_segments, N) for i in 1:num_segments f...
{"hexsha": "72703da9b26b5b2cb613529a624fe9e44c87eda1", "size": 1480, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_summarize_psd.jl", "max_stars_repo_name": "Cuda-Chen/SeisPDF.jl", "max_stars_repo_head_hexsha": "fd8a865c19ea1b9caef71ef7bae900d3cc99b070", "max_stars_repo_licenses": ["MIT"], "max_stars_...
# -*- coding: utf-8 -*- """ Medoto di newton modificato """ import numpy as np # L'unica differenza che c'e rispetto al metodo di newton e che # l'incremento d viene moltiplicato per m def newton_modificato(func, dfunc, x0, m, tolx, tolf, max_iterazioni): xks = [] it = 0 if not (abs(dfunc(x0) > np.spacing(...
{"hexsha": "1d45efa8aa92a40a6bb9b00a6e9770f53f0a0518", "size": 983, "ext": "py", "lang": "Python", "max_stars_repo_path": "zeri_di_funzioni/newton_modificato.py", "max_stars_repo_name": "Ro0t-set/metodi-numerici", "max_stars_repo_head_hexsha": "d586bce78f94f1aa6736218c9123064a57cb87ec", "max_stars_repo_licenses": ["MIT...
if (1 == 0){ probs10 <- read.table("D:/DATASETS/UKTraffic/probs/recprobs10.txt", header = F) plot(probs10$V1, type = 'b', cex = 0.4, xlim = c(0, 2000)) abline(h = 0.003) abline(h = 0.004) } # Prepare figures for the paper #### ### 1) Plot improvement vs delay fractions two_plots_traffic <- function(perf1, perf2, o...
{"hexsha": "eef7ad0ffc2d54008a657710f6d56a1478d8892a", "size": 4256, "ext": "r", "lang": "R", "max_stars_repo_path": "v.1.0_clojure/src/r-code/4.1PublicDataPlots.r", "max_stars_repo_name": "av-maslov/Recurrency", "max_stars_repo_head_hexsha": "620a34badc66247e348a47b76828ed5a562246c4", "max_stars_repo_licenses": ["MIT"...
from gsitk.datasets.datasets import DatasetManager from nltk.corpus import opinion_lexicon from collections import Counter def prepare_lexicon(process=True, dim=250, save=False): if process: dm = DatasetManager() data = dm.prepare_datasets() nega = set(opinion_lexicon.negative()) p...
{"hexsha": "e20c8f68dea990bc4c32367fa6b8c1733c2c1da3", "size": 9726, "ext": "py", "lang": "Python", "max_stars_repo_path": "sematch/classify.py", "max_stars_repo_name": "dhimmel/sematch", "max_stars_repo_head_hexsha": "7e92b171c27a8b25e844a467554fe4bb2adfb883", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun...
import numpy as np import pytest from nlp_profiler.constants import NaN from nlp_profiler.granular_features.letters \ import gather_repeated_letters, count_repeated_letters # noqa text_with_repeated_letters1 = '2833047 people live in this aaaaa area' text_with_repeated_letters2 = '2833047 people live in this aaa...
{"hexsha": "820bc8cc06a7447de95919c4819aab1cebf571e7", "size": 2493, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/granular/test_repeated_letters.py", "max_stars_repo_name": "neomatrix369/nlp_profiler", "max_stars_repo_head_hexsha": "db094b9a9fe02b9840d266f0d522978df6ca0c51", "max_stars_repo_licenses": [...
! { dg-do compile } ! PR fortran/66725 ! program foo open(unit=1,access = 999) ! { dg-error "ACCESS requires" } open(unit=1,action = 999) ! { dg-error "ACTION requires" } open(unit=1,asynchronous = 999) ! { dg-error "ASYNCHRONOUS requires" } open(unit=1,blank = 999) ! { dg-error "BLA...
{"hexsha": "8ad97f7e18de3881f3479180f491bfeb416f3ceb", "size": 1523, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "validation_tests/llvm/f18/gfortran.dg/pr66725.f90", "max_stars_repo_name": "brugger1/testsuite", "max_stars_repo_head_hexsha": "9b504db668cdeaf7c561f15b76c95d05bfdd1517", "max_stars_repo_license...
function [f,g] = autoGrad(x,useComplex,funObj,varargin) % [f,g] = autoGrad(x,useComplex,funObj,varargin) % % Numerically compute gradient of objective function from function values p = length(x); mu = 1e-150; if useComplex % Use Complex Differentials diff = zeros(p,1); for j = 1:p e_j = zeros(p,1); ...
{"author": "rbgirshick", "repo": "voc-dpm", "sha": "c0b88564bd668bcc6216bbffe96cb061613be768", "save_path": "github-repos/MATLAB/rbgirshick-voc-dpm", "path": "github-repos/MATLAB/rbgirshick-voc-dpm/voc-dpm-c0b88564bd668bcc6216bbffe96cb061613be768/external/minConf/minFunc/autoGrad.m"}
import vaex import numpy as np from common import * # def test_count_multiple_selections(): def test_sum(df, ds_trimmed): df.select("x < 5") np.testing.assert_array_almost_equal(df.sum("x", selection=None), np.nansum(ds_trimmed.data.x)) np.testing.assert_array_almost_equal(df.sum("x", selection=True), np....
{"hexsha": "2a1e37c4d2fa20219ea664a657e21e7979cb8c43", "size": 9229, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/agg_test.py", "max_stars_repo_name": "skywalk163/vaex", "max_stars_repo_head_hexsha": "f5e38f1fa448ef78936e2cb6b3d026fda1f2a1c5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,...
/* * Copyright (c) 2017, Ben Smith * All rights reserved. * */ #include <vector> #include <boost/format.hpp> #include "flow_collector.hpp" #include "logger.hpp" using namespace std; using namespace Tins; using namespace boost; void FlowsCollector::collect(time_t current_time, const PDU &pdu) { const EthernetI...
{"hexsha": "f435e21f6355231a179e10962d0dd36c99e8ae79", "size": 4603, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "flow_collector.cpp", "max_stars_repo_name": "benhsmith/netwhere", "max_stars_repo_head_hexsha": "94ae228fd38b2f0c8b00a29af67f72e47bc9f188", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2.0...
import logging #logging.basicConfig(level=logging.DEBUG) from pymothoa.jit import default_module, function from pymothoa.types import * from pymothoa.dialect import * @function(ret=Int) def test_constant(): var ( A = Int, B = Int, C = Int, ) A = (123 + 321)*2 B = 9 C = A...
{"hexsha": "e4776effac134c539dba6d807d7325cb19c1dee1", "size": 4523, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/testbasic.py", "max_stars_repo_name": "sklam/pymothoa", "max_stars_repo_head_hexsha": "330bd70666ccf761f39c75f3acb70aa7e0a92ac6", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count...
#!/usr/bin/env python3 """ An implementation of the Libet clock as a QtWidget. This is a heavily modified version of the Qt5 example forked from: # forked from https://github.com/baoboa/pyqt5/blob/master/examples/widgets/analogclock.py The original license is copied below """ #######################################...
{"hexsha": "bb5e0a5b7a8663bfc08906562d82935a5c739d75", "size": 11647, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/spike_recorder/experiments/libet/clock.py", "max_stars_repo_name": "gitter-badger/py-spike-recorder", "max_stars_repo_head_hexsha": "3dad322ef753570293e42968a435453cfa389ac3", "max_stars_repo...
import os import argparse import glob import h5py import numpy as np from PIL import Image from dgl.data.utils import load_graphs from histocartography.visualization import OverlayGraphVisualization, InstanceImageVisualization def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument( ...
{"hexsha": "b98410027da16e372107ffb9fd842487714616a1", "size": 2406, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/visualize_explanations.py", "max_stars_repo_name": "histocartography/patho-quant-explainer", "max_stars_repo_head_hexsha": "010533cf231c4394645111c3356b9b41636233fe", "max_stars_repo_licenses...
import numpy as np from lsb import LSB from PIL import Image class PNG(LSB): """ Реализация алгоритма LSB для файлов формата PNG. """ def __init__(self, file_name: str, message: bytes = None) -> None: """ Возвращает простой PNG кодер, принимает на вход имя файла и сообщение. ...
{"hexsha": "701439c3ba26447ea3f1ab92344cc601d85547d8", "size": 1895, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/png.py", "max_stars_repo_name": "neoksei/Thesis", "max_stars_repo_head_hexsha": "efb41eee8482da9d7bd192e447a14c26161d6c11", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": null, ...
#!/usr/bin/env python """Get nearest alerts""" # *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* # ** Copyright UCAR (c) 1992 - 2015 # ** University Corporation for Atmospheric Research(UCAR) # ** National Center for Atmospheric Research(NCAR) # ** Research Applications Laboratory(RAL) ...
{"hexsha": "48f6728243478ab13987195f5a00161e518e9291", "size": 5886, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/python/backend_server/wsgi/maw_alert_test.py", "max_stars_repo_name": "OSADP/Pikalert-Vehicle-Data-Translator-", "max_stars_repo_head_hexsha": "295da604408f6f13af0301b55476a81311459386", "...
"""Plotting methods""" from __future__ import unicode_literals import matplotlib.pyplot as plt import numpy as np from .plot_sweep import assign_axes from .. import GPCOLORS def compare(models, sweeps, posys, tol=0.001): """Compares the values of posys over a sweep of several models. If posys is of the same ...
{"hexsha": "677e3bb82c27e798ef97aeb7b59fa708b41dc921", "size": 2115, "ext": "py", "lang": "Python", "max_stars_repo_path": "gpkit/interactive/plotting.py", "max_stars_repo_name": "giserh/gpkit", "max_stars_repo_head_hexsha": "71b953fcac8f67f148b67b54b6e8cd4182dc0b3b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
"""Scatter layer controls""" from typing import TYPE_CHECKING import numpy as np from napari._qt.utils import disable_with_opacity, qt_signals_blocked from napari._qt.widgets.qt_color_swatch import QColorSwatch from napari.layers.points._points_constants import SYMBOL_TRANSLATION from napari.utils.events import discon...
{"hexsha": "a9f328d4a5eec332b51fa99acfd8fb94374112bf", "size": 10159, "ext": "py", "lang": "Python", "max_stars_repo_path": "napari_plot/_qt/layer_controls/qt_scatter_controls.py", "max_stars_repo_name": "lukasz-migas/napari-1d", "max_stars_repo_head_hexsha": "b0f081a8711ae941b3e4b5c58c3aea56bd0e3277", "max_stars_repo_...
import numpy as np import pandas as pd #Check a dataframe for nulls, print/report them in a nice "pretty" format def check_nulls(my_df): new_df = my_df.copy() return new_df.isna() if __name__ == "__main__": #Creating a dictionary dict = {'Name': ['John', 'Peter', 'Sam', np.nan], ...
{"hexsha": "4baa1adca9544110b54ece5dac525e18d200bd59", "size": 573, "ext": "py", "lang": "Python", "max_stars_repo_path": "my_lambdata/nulls_func.py", "max_stars_repo_name": "Khislatz/lambdata-khislatz", "max_stars_repo_head_hexsha": "8df039e2f3ed1309e7b9ac4b53cb0a770ccf0420", "max_stars_repo_licenses": ["MIT"], "max_s...