text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
(* Copyright 2021 (C) Mihails Milehins *) section\<open>Category\<close> theory CZH_ECAT_Category imports CZH_ECAT_Introduction CZH_Foundations.CZH_SMC_Semicategory begin subsection\<open>Background\<close> lemmas [cat_cs_simps] = dg_shared_cs_simps lemmas [cat_cs_intros] = dg_shared_cs_intros definiti...
{"author": "isabelle-prover", "repo": "mirror-afp-devel", "sha": "c84055551f07621736c3eb6a1ef4fb7e8cc57dd1", "save_path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel", "path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel/mirror-afp-devel-c84055551f07621736c3eb6a1ef4fb7e8cc57dd1/thys/CZH_Elementar...
# Import libraries import os import sys # cpu_count returns the number of CPUs in the system. from multiprocessing import cpu_count import numpy as np import pandas as pd # Import metrics from sklearn.metrics import accuracy_score from sklearn.metrics import roc_auc_score from sklearn.metrics import roc_curve # I...
{"hexsha": "d8ecfa1c4cd84d80e470339bbbe25acb6dcff990", "size": 9844, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/train_model.py", "max_stars_repo_name": "zkneupper/Default-Prediction-Capstone", "max_stars_repo_head_hexsha": "0d50c6c7d2a84547dab21975447c89016fbfe0bd", "max_stars_repo_licenses": ["M...
from collections import defaultdict import json import os import random import numpy as np from argparse import ArgumentParser K=10 TRAIN_ON=['act','resp'][0] GAMMA_GLOBAL = 0.0 USE_R_AS_G = True METRIC=['soft', 'hard'][0] def get_turn_state(full_state,turn_domain): all_domain = ['[police]', '[taxi]', '[restaur...
{"hexsha": "11f9a014e978c22dfb1f5385ae0113de4eba0c50", "size": 10138, "ext": "py", "lang": "Python", "max_stars_repo_path": "EstimateBehaviorPolicy.py", "max_stars_repo_name": "salesforce/CASPI", "max_stars_repo_head_hexsha": "3e4cd23f4f3d1fa7132ba89805366472c9fe5983", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_...
import gc import numpy as np import pandas as pd from tqdm import tqdm from typing import List from datetime import datetime from itertools import product from multiprocessing import Pool from vnpy.trader.constant import Interval, Exchange from vnpy_ctastrategy.base import BacktestingMode from vnpy_ctastrategy.backte...
{"hexsha": "7363485d707f6de96057a16a316668c4e83c85b8", "size": 4108, "ext": "py", "lang": "Python", "max_stars_repo_path": "optimization.py", "max_stars_repo_name": "YeDonggua/VNPY", "max_stars_repo_head_hexsha": "9da2a1b499f1cbd85e1b86938b5e77e43a271c5b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m...
""" ``` cutoffdistances!(cutoff::Float64, x_solute::AbstractVector{T}, x_solvent::Vector{T}, lc_solvent::LinkedCells, box::Box, dc::CutoffDistances) where T ``` This routine that returns a list of the distances between atoms that a...
{"hexsha": "c22bef0a4114352d7fb4a06ae2f49368d4a1fb86", "size": 1585, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/cutoffdistances.jl", "max_stars_repo_name": "m3g/MDDF", "max_stars_repo_head_hexsha": "efbc8e0dcf426c9b2246217eb9edaf4605318e84", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_...
""" The MIT License Copyright (c) 2017-2020 Mark Douthwaite """ import numpy as np from .factor import DiscreteFactor class ClassifierFactor(DiscreteFactor): def __init__(self, scope, cards, estimator, **kwargs): self.estimator = estimator(**kwargs) super().__init__(scope, cards) def fit(s...
{"hexsha": "89a8d971aae2287c469b2893595fa973b4cc5bd1", "size": 660, "ext": "py", "lang": "Python", "max_stars_repo_path": "apogee/factors/discrete/estimator.py", "max_stars_repo_name": "markdouthwaite/apogee", "max_stars_repo_head_hexsha": "2e8f58809b2af76137793215f4e7853b047d9183", "max_stars_repo_licenses": ["MIT"], ...
import asyncio import cv2 import paddlehub as hub import numpy as np # 模型加载 # use_gpu:是否使用GPU进行预测 model = hub.Module(name='MiDaS_Small', use_gpu=False) # 模型预测 def predict(images): return model.depth_estimation(images=images) def get_depth_map(depth, bits=1): depth_min = depth.min() depth_max = depth.max(...
{"hexsha": "48c30981ae6e697553fa922c1397ffc6f1debd99", "size": 2026, "ext": "py", "lang": "Python", "max_stars_repo_path": "server/camera.py", "max_stars_repo_name": "shadowcz007/-PK-AI-mixlab-", "max_stars_repo_head_hexsha": "40ef9472b3ef506e69171b746c5b52629a0ec586", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
import os import sys import importlib import itertools import numpy as np #-------------------------------------------------------------------------------------------------------- import inspect def location(): frame = inspect.currentframe().f_back return ('Line: %d, File: %s, Function: %s' % (frame.f_linen...
{"hexsha": "57bdb4b8f29fa5d2c2a086823689ed29c29e627d", "size": 29324, "ext": "py", "lang": "Python", "max_stars_repo_path": "sstd/src/c2py.py", "max_stars_repo_name": "admiswalker/SubStandardLibrary-SSTD-", "max_stars_repo_head_hexsha": "d0e7c754f4437fc57e8c4ab56fbbf2aa871b00ff", "max_stars_repo_licenses": ["MIT"], "ma...
import numpy as np from pyspedas import time_string, time_double import os from datetime import datetime def dailynames(directory='', trange=None, res=24*3600., hour_res=False, file_format='%Y%m%d', prefix='', suffix=''): if trange == None: print('No trange specified') return if hour_res == ...
{"hexsha": "0c5f304c78aacf354674e5eeeea3607bac70103c", "size": 1342, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyspedas/utilities/dailynames.py", "max_stars_repo_name": "MAVENSDC/pyspedas", "max_stars_repo_head_hexsha": "05ede2603acb514bc7803be054016142c0851685", "max_stars_repo_licenses": ["MIT"], "max_st...
\chapter{Classical Logic} \begin{definition*}[Formulae] A \textit{formula} within classical logic is constructed as follows: \begin{align*} A, B, C \quad &\defeq \quad \top \,|\, \bot \,|\, a \,|\, \neg\, a \,|\, A \vee B \,|\, A \wedge B \\ \Gamma, \Delta, \S...
{"hexsha": "886607a9527435c0e451e4a063b5d24ab7c55702", "size": 16771, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tex/classical-logic.tex", "max_stars_repo_name": "AdamLassiter/petri-nets", "max_stars_repo_head_hexsha": "a13b6df797d7d2b69a397da5939e757a9e35a127", "max_stars_repo_licenses": ["MIT"], "max_stars_...
#pragma once #include <vector> #include <boost/gil/typedefs.hpp> #include "common.hpp" class ClipBuffer { public: ClipBuffer(int width, int height); ClipBuffer(ClipBuffer const & src); boost::gil::gray8c_view_t gilView() const; void intersectClipRect(transform_t const & transform, number_t x, number_t y, nu...
{"hexsha": "e736ee96c9bc2b0abc635125c061dab44f1ad47d", "size": 541, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/demo/render/clip_buffer.hpp", "max_stars_repo_name": "RichardCory/svgpp", "max_stars_repo_head_hexsha": "801e0142c61c88cf2898da157fb96dc04af1b8b0", "max_stars_repo_licenses": ["BSL-1.0"], "max_st...
''' This file contains implementations of various NN components, including -- Dropout -- Feedforward layer (with custom activations) -- RNN (with customizable activations) -- LSTM -- GRU -- CNN Each instance has a forward() method which takes x as input and return the po...
{"hexsha": "b926c687858f3861f7a4b4cabacde5e6f22007c9", "size": 19077, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/nn/basic.py", "max_stars_repo_name": "serced/rcnn", "max_stars_repo_head_hexsha": "1c5949c7ae5652a342b359e9defa72b2a6a6666b", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 37...
@testset "SHIPs Descriptor" begin @info("-------- TEST 🚢 DESCRIPTOR ---------") @info("I'm really just checking that the constructor and evaluator run ok") using SHIPs, JuLIP, Test, ASE using SHIPs.Descriptors try desc = SHIPDescriptor(:Si, deg = 5, rcut = 5.0) at = bulk("Si", cubic=true) * 2 B1 = descrip...
{"hexsha": "4629dad83a2a7601d7a81f82927a6c29b9a5fc59", "size": 396, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_descriptor.jl", "max_stars_repo_name": "cortner/SHIPs", "max_stars_repo_head_hexsha": "77f994c47d50f268968c8b41f412594122c66adc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, ...
using Printf using Plots using DistCtrl4DistMan: ActuatorArray, genRandomPositions, initAgents, resolveNeighbrRelations!, averageActuatorCommands, calcDEPForce, ConvAnalysis_Data, showPlots, savePlots, admm, DEP_params, AgentCtrlDEP, RegulatorP, CircularTrajectoryGenerator, simulate!, control_law, generate_referenc...
{"hexsha": "0325d9e2238712ef7bfe5e0b68d220e3ee82876e", "size": 4090, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "utilities/simulate_DEP.jl", "max_stars_repo_name": "martingurtner/DistCtrl4DistMan.jl", "max_stars_repo_head_hexsha": "c89694ab74b6cd92d1c9fef695d96d16c7cb5e34", "max_stars_repo_licenses": ["MIT"],...
import nengo import numpy as np from . import windows from operator import itemgetter, attrgetter class Xbox(nengo.Network): axis_names = ['l_thumb_x', 'l_thumb_y', 'r_thumb_x', 'r_thumb_y', 'left_trigger', 'right_trigger'] def __init__(self, label=None, index=0): ...
{"hexsha": "f3656fca10a84f919ce8983901286411b6e27862", "size": 1357, "ext": "py", "lang": "Python", "max_stars_repo_path": "nengo_xbox/winnode.py", "max_stars_repo_name": "tcstewar/nengo_xbox", "max_stars_repo_head_hexsha": "eaf87329a2f678a37e8db13a5385c1898c47bcd4", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import operator import math import numpy as np from rtlsdr import RtlSdr import matplotlib.pyplot as plt # Available sample rates ''' 3200000Hz 2800000Hz 2560000Hz 2400000Hz 2048000Hz 1920000Hz 1800000Hz 1400000Hz 1024000Hz 900001Hz 250000Hz ''' # Receiver class. This needs receiving parameters and will receive data ...
{"hexsha": "36fe074ad6309ca010b43b55f5d608d848e7e085", "size": 3431, "ext": "py", "lang": "Python", "max_stars_repo_path": "Receive.py", "max_stars_repo_name": "jackSN8/Jack_Hydrogen_line_software", "max_stars_repo_head_hexsha": "a8c7f8fdca092402447d5aa6697e8b4f8f703e57", "max_stars_repo_licenses": ["MIT"], "max_stars_...
import numpy as np def flag_na_rows_in_columns(df): has_na_rows = df.isna() column_names_with_na_rows = df.columns[has_na_rows.any()].to_list() return has_na_rows[column_names_with_na_rows].rename(columns=lambda c: c + "_isna") def _get_column_average(column): if np.issubdtype(column.dtype, np.numbe...
{"hexsha": "455ea7b12976d8ad8f2828a48748e3a5d6f7f8a8", "size": 554, "ext": "py", "lang": "Python", "max_stars_repo_path": "ber_public/archetype.py", "max_stars_repo_name": "rdmolony/berpublicsearch", "max_stars_repo_head_hexsha": "0daaeec8f5644b7495fbae6c88878815ac50f8b1", "max_stars_repo_licenses": ["MIT"], "max_stars...
import numpy as np import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import sys name = ["feng","syy","fgru","jjx","lab"] color = ["red","black","green","blue","yellow"] def test...
{"hexsha": "3285efcb333e5896eb107c3f8a78f2dcd7362258", "size": 2543, "ext": "py", "lang": "Python", "max_stars_repo_path": "Lab1/test/plots.py", "max_stars_repo_name": "CynricFeng/Cloud-Computing-Labs-2020", "max_stars_repo_head_hexsha": "e71897a10a4b76a4f856f3547b026897c0354947", "max_stars_repo_licenses": ["MIT"], "m...
import spacy import json import os import re import torch import numpy as np import sys from tqdm import tqdm from collections import Counter assert len(sys.argv) == 6 raw_data = json.load(open(sys.argv[1], 'r')) doc_link_data = json.load(open(sys.argv[2], 'r')) ent_data = json.load(open(sys.argv[3], 'r')) para_data...
{"hexsha": "c58fe6fad8cf025303d2df58aa7b15d122305444", "size": 6648, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/4_multihop_ps.py", "max_stars_repo_name": "tengxiaoliu/HGN", "max_stars_repo_head_hexsha": "49e1190a34ba7cfc2c62ed101908746c1e468541", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
"""Plot isentropic relations.""" import numpy as np from matplotlib import pyplot as plt from proptools import isentropic M = np.logspace(-1, 1) gamma = 1.2 plt.loglog(M, 1 / isentropic.stag_temperature_ratio(M, gamma), label='$T / T_0$') plt.loglog(M, 1 / isentropic.stag_pressure_ratio(M, gamma), label='$p / p_0$') ...
{"hexsha": "7ebd6cd851873b18d8dd0be7c1f5a9be6b6c8b5a", "size": 672, "ext": "py", "lang": "Python", "max_stars_repo_path": "docs/source/examples/plots/isentropic_relations.py", "max_stars_repo_name": "mvernacc/proptools", "max_stars_repo_head_hexsha": "1a1b041ee1dd7b0d425419bc00a5cb19bfa516b9", "max_stars_repo_licenses"...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from pandas_datareader import data as wb def getStocks(companies, start, end): df = pd.DataFrame() for a in companies: df[a] = wb.DataReader(a, data_source='yahoo', start=start, end=end)['Adj Close'] return df def getRetur...
{"hexsha": "773b55028ae32c56e31cb7a67e22769f4113dc38", "size": 3736, "ext": "py", "lang": "Python", "max_stars_repo_path": "applications_notebooks/portfolio_optimization/utils_finance.py", "max_stars_repo_name": "orcacomputing/quantumqubo", "max_stars_repo_head_hexsha": "96e72019f9dab9cbd61e6a402bdbc398d1edfd23", "max_...
################################################################################ # # convenience ... # ################################################################################ #CF: we have to "extend" AnticNumberField as NumberField is just defined by # NumberField = AnticNumberField in Nemo. # Possibly ...
{"hexsha": "63df459d84c5c20acb6970d8fc54f9c71fb45366", "size": 21920, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Misc/NumberField.jl", "max_stars_repo_name": "JuliaPackageMirrors/Hecke.jl", "max_stars_repo_head_hexsha": "6994ebbc4a9007608e432319b02d09b1bcbd9cb1", "max_stars_repo_licenses": ["BSD-2-Clause...
"""Evaluation measures at the level of document orderings.""" from repro_eval.config import TRIM_THRESH, PHI from scipy.stats.stats import kendalltau from tqdm import tqdm from repro_eval.measure.external.rbo import rbo from repro_eval.util import break_ties def _rbo(run, ideal, p, depth): # Implementation taken...
{"hexsha": "937f1b097cc1a7f239fff12e2a5199c53217239c", "size": 5478, "ext": "py", "lang": "Python", "max_stars_repo_path": "repro_eval/measure/document_order.py", "max_stars_repo_name": "irgroup/repro_eval", "max_stars_repo_head_hexsha": "35a4cf083dbb5f4b29d6ef602a604f0686a537c9", "max_stars_repo_licenses": ["MIT"], "m...
# -*- coding: utf-8 -*- """ Created on Fri Feb 26 14:30:37 2016 @author: kayhan """ #%% ---- imports import os import sys print("Hello ...") sys.path.append('/Users/kayhan/Projects/clean_sHDP/') from core import models from core import distributions #from pyhsmm.util.general import sgd_passes #from pyhsmm.util.te...
{"hexsha": "d08cbf947d42288260178e87537ffb66ac5683e8", "size": 4404, "ext": "py", "lang": "Python", "max_stars_repo_path": "testingMixtureVMF.py", "max_stars_repo_name": "Ardavans/sHDP", "max_stars_repo_head_hexsha": "4fc18a86668b1c1eebd416857184d60079db2ed6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 74, ...
import jax.numpy as np import matplotlib.pyplot as plt def plot(vi, X, target='vanishing', n=1000, scale=1.5, x_max=1.0, y_max=1.0, z_func=lambda x_, y_: 0.0, show=False, splitshow=False): nvars = X.shape[-1] if nvars == 2: _plot2d(vi, X, target=target, n=n, scale=s...
{"hexsha": "7913179f368e27dbaa2d116839f327fa1b424800", "size": 3803, "ext": "py", "lang": "Python", "max_stars_repo_path": "mavi/jax/util/plot.py", "max_stars_repo_name": "HiroshiKERA/monomial-agnostic-vanishing-ideal", "max_stars_repo_head_hexsha": "ddfb53ded0ee87f129ec029603e8245565f653d2", "max_stars_repo_licenses":...
/* // Copyright (c) 2000-2009, Texas Engineering Experiment Station (TEES), a // component of the Texas A&M University System. // All rights reserved. // The information and source code contained herein is the exclusive // property of TEES and may not be disclosed, examined or reproduced // in whole or in part withou...
{"hexsha": "c4323625c4924b481d727c2213761f1fc73865b1", "size": 2474, "ext": "cc", "lang": "C++", "max_stars_repo_path": "stapl_release/src/runtime/collective.cc", "max_stars_repo_name": "parasol-ppl/PPL_utils", "max_stars_repo_head_hexsha": "92728bb89692fda1705a0dee436592d97922a6cb", "max_stars_repo_licenses": ["BSD-3-...
import pytest from arrayviews import numpy_ndarray_as np = pytest.importorskip("numpy") try: import pyarrow as pa except ImportError: pa = None try: import pandas as pd except ImportError: pd = None try: import xnd except ImportError: xnd = None pyarrowtest = pytest.mark.skipif( pa is No...
{"hexsha": "9f7020b2ff944534ec0ffc919d61867cf82ca294", "size": 2770, "ext": "py", "lang": "Python", "max_stars_repo_path": "arrayviews/tests/test_numpy_ndarray_as.py", "max_stars_repo_name": "plures/arrayviews", "max_stars_repo_head_hexsha": "14132bfd68880b8ee75706b2e3f1c1f95a971bf1", "max_stars_repo_licenses": ["BSD-3...
"""Random number generation.""" import time import numpy as np def set_seed(sd="clock"): """Essentially ``np.random.seed(sd)``, but also returning ``sd``. The disadvantage of ``np.random.seed()`` is that it produces a RandomState that cannot be represented by a simple seed (the mapping seed-->state...
{"hexsha": "84131b0d8790887a24ff8a5ba87aec1e826372e0", "size": 1966, "ext": "py", "lang": "Python", "max_stars_repo_path": "dapper/tools/seeding.py", "max_stars_repo_name": "myying/DAPPER", "max_stars_repo_head_hexsha": "2f92fcb5610f9b2d44bb077ac5ed5438ac5fd6b3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1...
[STATEMENT] lemma tinc_correct_pre: assumes layout: "ly = layout_of ap" and inv_start: "inv_locate_a (as, lm) (n, l, r) ires" and lm': "lm' = abc_lm_s lm n (Suc (abc_lm_v lm n))" and f: "f = steps (Suc 0, l, r) (tinc_b, 0)" and P: "P = (\<lambda> (s, l, r). s = 10)" and Q: "Q = (\<lambda> (s, l, r...
{"llama_tokens": 9282, "file": "Universal_Turing_Machine_Abacus", "length": 29}
# coding: utf-8 import torch from torch import nn import math import numpy as np from torch.nn import functional as F from fairseq.models.fconv import Linear, LinearizedConvolution def position_encoding_init(n_position, d_pos_vec, position_rate=1.0): ''' Init the sinusoid position encoding table ''' # keep ...
{"hexsha": "f7956b4fd22f3b3555ff668fee056864eca88b57", "size": 4997, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepvoice3_pytorch/modules.py", "max_stars_repo_name": "gowthambalusamy/pytorch_text2speech", "max_stars_repo_head_hexsha": "7637a3542799b9f6503a203ed1e4990245402cc0", "max_stars_repo_licenses": [...
import cv2 import os import numpy as np input_img_folder = 'VisDrone2019-DET-train/images' input_ann_folder = 'VisDrone2019-DET-train/annotations' output_ann_folder = 'VisDrone2019-DET-train/annotations_new' output_img_folder = 'VisDrone2019-DET-train/images_new' os.makedirs(output_img_folder, exist_ok=True) os.make...
{"hexsha": "0f0477115aa00f3ed7ff1b66a1fed653d18febb2", "size": 2713, "ext": "py", "lang": "Python", "max_stars_repo_path": "convertVis_to_xml.py", "max_stars_repo_name": "KevinShek/VisDrone-dataset-python-toolkit", "max_stars_repo_head_hexsha": "53c5b4253baafb493379c99e1a9a48850246704e", "max_stars_repo_licenses": ["MI...
#include "ValueWithError.hpp" #include "precompiled.hpp" #include "common.hpp" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wglobal-constructors" #endif // __clang__ #if defined __GNUC__ \ && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) ) \ && !...
{"hexsha": "b49ca53c517a3dfd8b68f9b3a7507f646eb4c632", "size": 1597, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/Test_ValueWithError_cpp98.cpp", "max_stars_repo_name": "t-b/value-with-error", "max_stars_repo_head_hexsha": "ede8325d3572ac53601d0d7aabc09518850c8455", "max_stars_repo_licenses": ["BSL-1.0"],...
[STATEMENT] lemma normal_form_zero_iff: "normal_form F p = 0 \<longleftrightarrow> p \<in> ideal F" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (normal_form F p = 0) = (p \<in> ideal F) [PROOF STEP] proof [PROOF STATE] proof (state) goal (2 subgoals): 1. normal_form F p = 0 \<Longrightarrow> p \<in> ideal F 2. ...
{"llama_tokens": 3416, "file": "Groebner_Macaulay_Cone_Decomposition", "length": 43}
import cv2 from subprocess import Popen, PIPE from PIL import Image import numpy as np import argparse from enum import IntEnum, auto import sys, math, os, time import threading import queue from keras.models import load_model import tensorflow as tf sys.path.append(os.path.join(os.path.dirname(__file__), 'UGATIT'))...
{"hexsha": "e6a58aa09c4c97fdabcdadeaa01fb5c336404af6", "size": 18225, "ext": "py", "lang": "Python", "max_stars_repo_path": "webcamhooker.py", "max_stars_repo_name": "w-okada/WebCamHooker", "max_stars_repo_head_hexsha": "9f072486caf20a7be52ea2904ddb154117049e6b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3...
import numpy as np from hmf.cosmology import growth_factor from astropy.cosmology import Planck13 import pytest @pytest.fixture(scope="module") def gf(): return growth_factor.GrowthFactor(Planck13) @pytest.fixture(scope="module") def genf(): return growth_factor.GenMFGrowth(Planck13, zmax=10.0) @pytest.ma...
{"hexsha": "6adb2114d183d4a8592e6f39b382a890527a36c8", "size": 1632, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_growth.py", "max_stars_repo_name": "liuxx479/hmf-1", "max_stars_repo_head_hexsha": "8b24f5df42cdf73d507ffc4a7c6138573769bb2c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
import kenlm import math import numpy as np import os from sklearn.base import BaseEstimator, TransformerMixin class LangModels (TransformerMixin, BaseEstimator): """ This Transform class accepts a line of text, and passes it to a number of kenlm language models, adding a probability estimate ...
{"hexsha": "de97431c9d77e6b4b58bbfc5cfa0406c5779792b", "size": 4340, "ext": "py", "lang": "Python", "max_stars_repo_path": "subtask-2/LangMod.py", "max_stars_repo_name": "StephenETaylor/Madar-2019", "max_stars_repo_head_hexsha": "5186d121099408d1ff00c5597cdd34bead89669d", "max_stars_repo_licenses": ["MIT"], "max_stars_...
from __future__ import print_function, absolute_import, division import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt from IPython.core.pylabtools import figsize figsize(12, 4) import os import sys os.environ['THEANO_FLAGS'] = "device=cpu,optimizer=fast_run" DATA_DIR = os.path.join('/res', 'dat...
{"hexsha": "4e6cc9357ee10779de40a43159d6fa2ee2c44ab7", "size": 4907, "ext": "py", "lang": "Python", "max_stars_repo_path": "ex1_construct_dnn.py", "max_stars_repo_name": "trungnt13/uef-summerschool2016", "max_stars_repo_head_hexsha": "9578e0427f665237011ee2f40110e516f8710d61", "max_stars_repo_licenses": ["MIT"], "max_s...
import numpy as np def g(l, u, s, r): return (np.random.randint(u - l, size=s) + l) / r def p(f, a): s = len(a) fs = f * s return fs.format(*a)[:-2] def d(): l1 = "tes_list : '{}'".format(p("{:5.0f}, ", g(20, 40, 8, 1))) l2 = "psc_beta_list: '{}'".format(p("{:5.3f}, ", g(18, 22, 8, 1000))) l3 = "ps...
{"hexsha": "63bb7584ca60fa0b94c8d3646a7ca2525257c863", "size": 537, "ext": "py", "lang": "Python", "max_stars_repo_path": "sample-yamls/gen-param.py", "max_stars_repo_name": "ahavenoname/async_deep_reinforce", "max_stars_repo_head_hexsha": "8619c72395536c26899f31e0c8d1930889d04ba6", "max_stars_repo_licenses": ["Apache-...
import argparse import matplotlib.pyplot as plt import numpy as np import pandas as pd def read_csv(gpu, mode, seq_len, batch_size): return pd.read_csv( './gru-epoch-latency-{}/{}-IRMASmfcc_{}-batch_size_{}.csv'.format( gpu, mode, seq_len, batch_size), index_col=0) def plot_runtime_b...
{"hexsha": "8fdcc7dd6ff36f85a3fc10d6bd96e55e6b39e189", "size": 5979, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/plot_gru_results.py", "max_stars_repo_name": "UofT-EcoSystem/BPPSA-open", "max_stars_repo_head_hexsha": "100c2f15ff956c1a96c13047bcf05582593e37e2", "max_stars_repo_licenses": ["MIT"], "max_st...
# 2022-03-28 Gradient Descent ## Last time * Assumptions of linear models * Look at your data! * Partial derivatives * Loss functions ## Today * Discuss projects * Gradient-based optimization for linear models * Nonlinear models ```julia using LinearAlgebra using Plots default(linewidth=4, legendfontsize=12) fun...
{"hexsha": "4a42def7c54f70b9845f10a7ded5a3cf8cbde95b", "size": 262716, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "slides/2022-03-28-gradient-descent.ipynb", "max_stars_repo_name": "cu-numcomp/spring22", "max_stars_repo_head_hexsha": "f4c1f9287bff2c10645809e65c21829064493a66", "max_stars_repo_li...
import numpy as np from qmsolve import visualization from qmsolve import Hamiltonian, SingleParticle, Eigenstates #interaction potential def harmonic_oscillator(particle): kx, ky, kz = [2]*3 # measured in eV / (Å**2) return 0.500 * kx * particle.x**2 +\ 0.51 * ky * particle.y**2 +\ 0.52 * kz * particle.z...
{"hexsha": "7d00543a5075da920eaec05e86460a7d162c984a", "size": 689, "ext": "py", "lang": "Python", "max_stars_repo_path": "3D_harmonic_oscillator.py", "max_stars_repo_name": "zeroegg/qmsolve", "max_stars_repo_head_hexsha": "f7d3412ce3b7c523abad0870f34f8d55c6654049", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta...
#= utilities for real polynomial interpolation =# """ $(SIGNATURES) Compute interpolation data for a real weighted sum-of-squares conic constraint on a domain. """ function interpolate( dom::Domain{T}, d::Int; constraint_degs::Vector{Int} = Int[], calc_V::Bool = false, get_quadr::Bool = false, ...
{"hexsha": "df6f90fecdd940f1d8b8501df580928fde6edfdb", "size": 12359, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/PolyUtils/realinterp.jl", "max_stars_repo_name": "projekter/Hypatia.jl", "max_stars_repo_head_hexsha": "674a9db8dfb69fc70b10b9a3cd642546c8d47441", "max_stars_repo_licenses": ["MIT"], "max_star...
import os import numpy as np from surfclass.rasterio import RasterReader, write_to_file def test_writer(tmp_path): data = np.arange(1500).astype("float32").reshape((30, 50)) origin = (550000, 6150000) resolution = 1 epsg = 25832 outfile = os.path.join(tmp_path, "test_writer.tif") write_to_file...
{"hexsha": "cda2fdc44cb18c8242449b26056f1fc96b52925b", "size": 2349, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_rasterwriter.py", "max_stars_repo_name": "plimkilde/surfclass", "max_stars_repo_head_hexsha": "0534d6400f0e3636150079ac3bb2cf676f472233", "max_stars_repo_licenses": ["MIT"], "max_stars_...
"""Extract character features.""" # Core Library modules import logging import os import pickle from collections import Counter, defaultdict from typing import Any, Dict, List, Optional, Set # Third party modules import numpy as np import progressbar # First party modules import lidtk.utils logger = logging.getLogg...
{"hexsha": "156bb78b5a2ee7f9a5605830659e0f0a07df45e1", "size": 6509, "ext": "py", "lang": "Python", "max_stars_repo_path": "lidtk/classifiers/char_features.py", "max_stars_repo_name": "Priyansh2/lidtk", "max_stars_repo_head_hexsha": "a48f9679a5b6ec5167f4b9ad18a20682dfc08345", "max_stars_repo_licenses": ["MIT"], "max_st...
[STATEMENT] lemma map_eq_consE: "\<lbrakk>map f ls = fa#fl; !!a l. \<lbrakk> ls=a#l; f a=fa; map f l = fl \<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>map f ls = fa # fl; \<And>a l. \<lbrakk>ls = a # l; f a = fa; map f l = fl\<rbrakk> \<Longright...
{"llama_tokens": 163, "file": "Automatic_Refinement_Lib_Misc", "length": 1}
[STATEMENT] lemma fst_diag_id: "(fst \<circ> (\<lambda>x. (x, x))) z = id z" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (fst \<circ> (\<lambda>x. (x, x))) z = id z [PROOF STEP] by simp
{"llama_tokens": 90, "file": null, "length": 1}
import numpy as np import matplotlib.pyplot as plt d = np.load("data/left/1572814991.npy") for channel in d[175]: plt.plot(channel) plt.show()
{"hexsha": "cdc4958b3830af5ebc1b115ffe3400f33ca5c973", "size": 148, "ext": "py", "lang": "Python", "max_stars_repo_path": "1.py", "max_stars_repo_name": "atulb07/Dishathon", "max_stars_repo_head_hexsha": "9aae85e3d01dcaf85249daee1f12d785b322d11e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_...
""" Nearest neighbor accuracy. """ import os import torch import numpy as np from tqdm import tqdm from copy import deepcopy from dotmap import DotMap from src.utils import utils from torchvision import transforms import torch.nn.functional as F from torch.utils.data import DataLoader from src.systems.simclr import Sim...
{"hexsha": "2bacc438a602edda92c3b4335b5c80c6ffff2cb0", "size": 5018, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/knn.py", "max_stars_repo_name": "mhw32/temperature-as-uncertainty-public", "max_stars_repo_head_hexsha": "d6c6f05dc217b6169f31ba25385cb4bcdd28ab6a", "max_stars_repo_licenses": ["MIT"], "ma...
import numpy as np from scipy.linalg import expm def ST_step(delta, twosite, onesite=None): """ SUZUKI-TROTTER EVOLUTION: single step Construct evolution operator for two sites Inputs: delta (real for GS or imaginary for evolution) list of triplets (coupling, op1, op2) -> acting on two si...
{"hexsha": "f62139eca79c0f390b04b5b4392ccf5035ce2134", "size": 2460, "ext": "py", "lang": "Python", "max_stars_repo_path": "trotter.py", "max_stars_repo_name": "suracefm/iTEBD", "max_stars_repo_head_hexsha": "fc7610d4ee05cc73723c803c2c521e7d0f7d3a1c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_stars...
Require Import POCS. Record State := mkState { stateDisk : disk; stateBadBlock : addr; }. Definition read_spec a : Specification _ block unit State := fun (_ : unit) state => {| pre := True; post := fun r state' => state' = state /\ (a <> stateBadBlock state -> diskGet (stateDisk sta...
{"author": "mit-pdos", "repo": "6.826-2017-labs", "sha": "5b9fdc9bf92c35e9f9a836d2b92cc0f2287a645c", "save_path": "github-repos/coq/mit-pdos-6.826-2017-labs", "path": "github-repos/coq/mit-pdos-6.826-2017-labs/6.826-2017-labs-5b9fdc9bf92c35e9f9a836d2b92cc0f2287a645c/src/Lab2/BadBlockAPI.v"}
#!/usr/bin/python # -*- coding: utf-8 -*- # This script converts .seq files into .jpg files, .vbb files into .pkl files # from Caltech Pedestrian Dataset # Based on Python 2.7 # Author: Peng Zhang # E-mail: hizhangp@gmail.com # Caltech Pedestrian Dataset: # http://www.vision.caltech.edu/Image_Datasets/CaltechPedestria...
{"hexsha": "76ce418087862c8d219af28c4bf23f02a2a2eab1", "size": 5873, "ext": "py", "lang": "Python", "max_stars_repo_path": "converter.py", "max_stars_repo_name": "hizhangp/caltech-pedestrian-converter", "max_stars_repo_head_hexsha": "0f2fbdd950046448b6b6f9cdf49a4713088b0611", "max_stars_repo_licenses": ["Apache-2.0"], ...
import numpy as np import os import pickle import gzip # np.seterr(all='raise') import matplotlib.pyplot as plt from sklearn.metrics import adjusted_mutual_info_score, \ adjusted_rand_score, roc_auc_score from pyhawkes.internals.network import StochasticBlockModel from pyhawkes.models import \ DiscreteTime...
{"hexsha": "0a3682e5e2cf5fce740d67ccb240df88b8ac59a2", "size": 8978, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/inference/gibbs_ss_demo.py", "max_stars_repo_name": "nticea/superhawkes", "max_stars_repo_head_hexsha": "cbaec7c4aae7ced71ec68f6d69cc516bc19ace5a", "max_stars_repo_licenses": ["MIT"], "ma...
@testset "Krylov Trust Region" begin @testset "Toy test problem 1" begin # Test on actual optimization problems. function f(x::Vector) (x[1] - 5.0)^4 end function fg!(g, x) g[1] = 4.0 * (x[1] - 5.0)^3 f(x) end function fg2!(_f, g, x) g === nothing || (g[1] = 4...
{"hexsha": "10c3fbc1b38e7463cec470ec8ca182a274c8f632", "size": 2223, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/multivariate/solvers/second_order/krylov_trust_region.jl", "max_stars_repo_name": "chriselrod/Optim.jl", "max_stars_repo_head_hexsha": "1379eb2480c7da29a0083c1ae14d182d1591e912", "max_stars_re...
#include <boost/test/output/xml_report_formatter.hpp>
{"hexsha": "2f5fc64752d7d2375bd64e1c36a7b7ea9d0f04ce", "size": 54, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_test_output_xml_report_formatter.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses"...
[STATEMENT] lemma carrier_singleton_group [simp]: "carrier (singleton_group a) = {a}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. carrier (singleton_group a) = {a} [PROOF STEP] by (auto simp: singleton_group_def)
{"llama_tokens": 87, "file": null, "length": 1}
from pdb import set_trace as T import numpy as np import torch from torch import nn class BatchFirstLSTM(nn.LSTM): def __init__(self, *args, **kwargs): super().__init__(*args, batch_first=True, **kwargs) def forward(self, input, hx): h, c = hx h = h.transpose(0, 1) c ...
{"hexsha": "0220cba04ab8d28491a84cee43f80220b8eb1898", "size": 526, "ext": "py", "lang": "Python", "max_stars_repo_path": "neural_mmo/forge/ethyr/torch/policy/recurrent.py", "max_stars_repo_name": "fangqyi/sandbox-society", "max_stars_repo_head_hexsha": "39a539994f47f4937ec3ff698f8ed08a5161e14a", "max_stars_repo_licens...
"""mpc module runs the control strategy MPC """ from gekko import GEKKO import numpy as np import matplotlib.pyplot as plt from progressbar import Bar, ETA, Percentage, ProgressBar, RotatingMarker import pickle import os import initialise_classes import inputs import tools class Scheduler(object):...
{"hexsha": "bdce66b105af3f15eecff7175c58e5b19ef516fb", "size": 41194, "ext": "py", "lang": "Python", "max_stars_repo_path": "PyLESA/mpc.py", "max_stars_repo_name": "andrewlyden/PyLESA", "max_stars_repo_head_hexsha": "dac052764d6d6f77c8e8c12077520e50ea0ad2f5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6, "m...
from pearce.emulator import OriginalRecipe, ExtraCrispy, SpicyBuffalo from pearce.inference import run_mcmc_iterator import numpy as np from os import path import cPickle as pickle #training_file = '/u/ki/swmclau2/des/xi_cosmo_trainer/PearceRedMagicXiCosmoFixedNd.hdf5' training_file = '/scratch/users/swmclau2/xi_gm_co...
{"hexsha": "50b66bf0bd875f3514f013524984cf40b0edf559", "size": 2385, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/mcmc/pearce_mcmc_xigm_hod_emu2_jk.py", "max_stars_repo_name": "mclaughlin6464/pearce", "max_stars_repo_head_hexsha": "746f2bf4bf45e904d66996e003043661a01423ba", "max_stars_repo_licenses": ["MI...
[STATEMENT] lemma is_2sat_simps [simp]: "is_2sat {}" "is_2sat (insert cl cnf) \<longleftrightarrow> proper_uprod cl \<and> is_2sat cnf" [PROOF STATE] proof (prove) goal (1 subgoal): 1. is_2sat {} &&& is_2sat (insert cl cnf) = (proper_uprod cl \<and> is_2sat cnf) [PROOF STEP] by(simp_all add: is_2sat_def)
{"llama_tokens": 148, "file": "Containers_Examples_TwoSat_Ex", "length": 1}
import numpy as np def binary_classification_metrics(prediction, ground_truth): ''' Computes metrics for binary classification Arguments: prediction, np array of bool (num_samples) - model predictions ground_truth, np array of bool (num_samples) - true labels Returns: precision, recall, f1...
{"hexsha": "f7ef4c16c54aed59d5d19e8f8c8163f8e3d54173", "size": 1467, "ext": "py", "lang": "Python", "max_stars_repo_path": "assignments/assignment1/metrics.py", "max_stars_repo_name": "veras222/cs231n-assignment", "max_stars_repo_head_hexsha": "c94bf669011b1dc3f237b867a90b071ac16f8ce5", "max_stars_repo_licenses": ["MIT...
# -*- coding: utf-8 -* """ pyHRV - Frequency Domain Module -------------------------------- This module provides function to compute frequency domain HRV parameters using R-peak locations or NN intervals extracted from an ECG lead I-like signal. The implemented Power Spectral Estimation (PSD) estimation methods are: ...
{"hexsha": "02acd47040539e92b182010d154044c94ff48aa7", "size": 73093, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyhrv/frequency_domain.py", "max_stars_repo_name": "RuWander/pyhrv", "max_stars_repo_head_hexsha": "61b233e907a0223e2a2bf1a5962ee2e9ae8ed36c", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st...
from pyecharts import options as opts from pyecharts.charts import WordCloud from pyecharts.globals import SymbolType from pyecharts.globals import CurrentConfig, NotebookType import pandas as pd from pyecharts.charts import Line from pyecharts.commons.utils import JsCode def generateData(): import psycopg2 c...
{"hexsha": "f603f30b83dd4d961bccf36cd7040a1661fd7ac7", "size": 4761, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/weiboAnalyse.py", "max_stars_repo_name": "yunwei37/COVID-19-NLP-vis", "max_stars_repo_head_hexsha": "b290413f5735d6155f6b544568c4684f6dc398b2", "max_stars_repo_licenses": ["MIT"], "max_sta...
// This file is part of CRAAM, a C++ library for solving plain // and robust Markov decision processes. // // MIT License // // 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 restric...
{"hexsha": "c35312447d58c15451ba124dc74e78f402aa9094", "size": 18164, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "test/simulation_tests.hpp", "max_stars_repo_name": "marekpetrik/craam2", "max_stars_repo_head_hexsha": "b07f4547d578626c698cbc660495dbf6f179a672", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
module MOD_PLOTPOP contains C********** MODULNAME: PLOTPOP ******* 24/03/87 21.22.07.****** 54 KARTEN SUBROUTINE PLOTPOP (LEVELPL,N,ND,LEVEL,ENTOT,POPNUM,MODHEAD, $ JOBNUM ) C*** DIRECT TRANSFER OF POPNUMBER PLOT USE MOD_PLOTCON use MOD_PLOTANF implicit ...
{"hexsha": "2fbb086315b89acbcbd7a29e46a920fcbc30aa38", "size": 1920, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "src/plotpop.for", "max_stars_repo_name": "rtagirov/nessy", "max_stars_repo_head_hexsha": "aa6c26243e6231f267b42763e020866da962fdfb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ...
#!/usr/bin/env python # coding: utf-8 # In[55]: import numpy as np import pandas as pd import os import pdb import math # In[ ]: # In[56]: #pcawg dir --> new pcawg directory pcawg_dir = 'G:/experiment/data/new24classes/' #output dir --> to projectdir/dataset_utils output_dir = '.....
{"hexsha": "b54840fab1b5935d251f2a5d4f8f93e14ceebad1", "size": 1000, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocessing/create_PCAWG_class_info.py", "max_stars_repo_name": "primasanjaya/muat-github", "max_stars_repo_head_hexsha": "4603c6c960188643fb38d8dba82e0dcc1ba00b40", "max_stars_repo_licenses": [...
#if defined __GNUC__ \ && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) ) \ && !defined __clang__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedefs" #endif #include <boost/type_traits.hpp> #include <boost/timer/timer.hpp> #include <boost/math/special...
{"hexsha": "5c6b36dbaaff8ee6832adaf91f42191a3c364c18", "size": 979, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "tests/precompiled.hpp", "max_stars_repo_name": "t-b/value-with-error", "max_stars_repo_head_hexsha": "ede8325d3572ac53601d0d7aabc09518850c8455", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_cou...
SUBROUTINE FDUMP C***BEGIN PROLOGUE FDUMP C***DATE WRITTEN 790801 (YYMMDD) C***REVISION DATE 820801 (YYMMDD) C***CATEGORY NO. Z C***KEYWORDS ERROR,XERROR PACKAGE C***AUTHOR JONES, R. E., (SNLA) C***PURPOSE Symbolic dump (should be locally written). C***DESCRIPTION C ***Note*** Machine Dependent...
{"hexsha": "644e933fdbd823fd74284799607364c56c2361b1", "size": 934, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/f2cl/packages/quadpack/Fortran/fdump.f", "max_stars_repo_name": "sbwhitecap/clocc-hg", "max_stars_repo_head_hexsha": "f6cf2591ceef8a3a80e04da9b414cdf60a25a90f", "max_stars_repo_licenses": ["MIT...
#include <boost/bimap/relation/support/value_type_of.hpp>
{"hexsha": "032b81e33427072fc283be43564543b93a52aabd", "size": 58, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_bimap_relation_support_value_type_of.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licen...
r""" Sage's IPython Configuration TESTS: We check that Sage stdin can be piped in even if stdout is a tty; In that case the IPython simple prompt is being used:: sage: cmd = 'print([sys.stdin.isatty(), sys.stdout.isatty()])' sage: import pexpect sage: output = pexpect.run( ....: 'bash -c \'echo "...
{"hexsha": "1c2c6d144c9c98ed224fc1dcd860aa913fbc7268", "size": 5400, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sage/repl/configuration.py", "max_stars_repo_name": "fchapoton/sage", "max_stars_repo_head_hexsha": "765c5cb3e24dd134708eca97e4c52e0221cd94ba", "max_stars_repo_licenses": ["BSL-1.0"], "max_sta...
# -*- coding: utf-8 -*- """SHAP value calculation.""" import logging import sys import warnings from collections import defaultdict from operator import attrgetter from pathlib import Path from pprint import pprint import matplotlib as mpl import numpy as np import pandas as pd from loguru import logger as loguru_logg...
{"hexsha": "15e7b4c0cf0e7f476501ca7c6cd437b77f39b312", "size": 6493, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/calculate_shap_values.py", "max_stars_repo_name": "akuhnregnier/empirical-fire-modelling", "max_stars_repo_head_hexsha": "4187f5bfce0595d98361a9264793c25607043047", "max_stars_repo_licens...
import numpy as np import pdb from data import data from utils import print_table, print_vars, canonicalize, \ update_basis, update_vars, final_print a = np.asarray(data["a"], dtype="float") # contraint coefficients b = np.asarray(data["b"], dtype="float") # value of constraints c = np.asarray(data["c"], dtype="...
{"hexsha": "ec522c8cced99762d1319b33366a7872d13750ce", "size": 2609, "ext": "py", "lang": "Python", "max_stars_repo_path": "simplex-method/simplex.py", "max_stars_repo_name": "pyaf/operations-research", "max_stars_repo_head_hexsha": "f44bcd5910f57f3d0f8aa97e7e5658fd3a5ac565", "max_stars_repo_licenses": ["MIT"], "max_st...
""" The code is based on the code from the whitespace_perturbation task, created by Xinyi Wu: https://github.com/GEM-benchmark/NL-Augmenter/tree/main/transformations/whitespace_perturbation """ import string import numpy as np from interfaces.SentenceOperation import SentenceOperation from tasks.TaskTypes import TaskT...
{"hexsha": "07bcd294e610b75cea891bc8b670e1659abb5da4", "size": 30119, "ext": "py", "lang": "Python", "max_stars_repo_path": "transformations/writing_system_replacement/transformation.py", "max_stars_repo_name": "raft001/NL-Augmenter", "max_stars_repo_head_hexsha": "147932f311bafe429a23b69c4cd4fd3f4e02bbf1", "max_stars_...
/** @file * @brief NPDE OutputImpedanceBVP * @author Erick Schulz * @date 12/07/2019 * @copyright Developed at ETH Zurich */ #include "outputimpedancebvp.h" #include <lf/assemble/assemble.h> #include <lf/geometry/geometry.h> #include <lf/mesh/utils/utils.h> #include <lf/uscalfe/uscalfe.h> #include <Eigen/Dense>...
{"hexsha": "6499ff277cbcf71ed9e11d2b33d29e04dc11e86d", "size": 4199, "ext": "cc", "lang": "C++", "max_stars_repo_path": "homeworks/OutputImpedanceBVP/templates/outputimpedancebvp.cc", "max_stars_repo_name": "padomu/NPDECODES", "max_stars_repo_head_hexsha": "d2bc5b0d2d5e76e4d5b8ab6948c82f902211182e", "max_stars_repo_lic...
! Modified EVP dynamics of ice module (Bouillon 2013) subroutine ice_mevp use schism_glbl,only: rkind,time_stamp,eta2,np,npa,ne,nea,dldxy,elnode,i34,cori, & &grav,isbnd,nne,indel,area,iself,time_stamp,rnday,fdb,lfdb,xnd,ynd,iplg,ielg, & &elside,mnei,rho0,idry,errmsg use schism_msgp, only: myrank,npro...
{"hexsha": "beccc0f7632630ea8cde9d5e4bd9bb19c210659b", "size": 8124, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/Multi_ice/mice_mevp.f90", "max_stars_repo_name": "wangqian2284/schism", "max_stars_repo_head_hexsha": "836890dead1aa64ea20df9bff32b2dbe8a7fe682", "max_stars_repo_licenses": ["Apache-2.0"], "...
import os import torch import torchvision from torchsummary import summary from matplotlib import pyplot as plt from torch.utils.data import DataLoader as dataloader from tensorboardX import SummaryWriter from torch.autograd import Variable import torch.nn.functional as F import torch.optim as optim import torch.nn as ...
{"hexsha": "48a018e0c3592c1059b6ba339cb166180c57739e", "size": 6311, "ext": "py", "lang": "Python", "max_stars_repo_path": "mnist_torch.py", "max_stars_repo_name": "nin-yu/MNIST-with-PyTorch", "max_stars_repo_head_hexsha": "32c940b1991fa4de1a2e3c564c8ff21d711e8095", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars...
import MyNat.Definition import MyNat.Addition -- add_zero import MyNat.Inequality -- le_iff_exists_add import Mathlib.Tactic.Use -- use tactic import Mathlib.Tactic.Relation.Rfl -- rfl tactic import AdditionWorld.Level4 -- add_comm namespace MyNat open MyNat /-! # Inequality world. Here's a nice easy one. ## Level 2...
{"author": "leanprover", "repo": "lean4-samples", "sha": "5c0db5f1e952e7ebada506ba3a390040972293a9", "save_path": "github-repos/lean/leanprover-lean4-samples", "path": "github-repos/lean/leanprover-lean4-samples/lean4-samples-5c0db5f1e952e7ebada506ba3a390040972293a9/NaturalNumbers/InequalityWorld/Level2.lean"}
import operator import numpy as np import pandas as pd import pytest @pytest.mark.notimpl( [ "clickhouse", "dask", "datafusion", "duckdb", "impala", "mysql", "pandas", "postgres", "pyspark", ] ) def test_rowid(con): t = con.table('fu...
{"hexsha": "69b8883c3647a3d7f70077e8b7b6d21537d7553c", "size": 2024, "ext": "py", "lang": "Python", "max_stars_repo_path": "ibis/backends/tests/test_column.py", "max_stars_repo_name": "rtpsw/ibis", "max_stars_repo_head_hexsha": "d7318fdf87121cd8fadbcf0369a2b217aab3053a", "max_stars_repo_licenses": ["Apache-2.0"], "max_...
import tensorflow as tf import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np import math from swarm.optimizers.pso import pso from swarm.utils import multilayer_perceptron np.random.seed(1234) tf.random.set_seed(1234) uxn = 256 + 2 xlo = 0 xhi = 1 ux = tf.reshape(tf.Variable...
{"hexsha": "8c60616c4618478f1cacc2b5f14d7ee2e9511b0a", "size": 3995, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/PINN/poisson/poisson_ani.py", "max_stars_repo_name": "caio-davi/PSO-PINN", "max_stars_repo_head_hexsha": "f26e8125ee8dcce434cfd917c42baad27bb110f4", "max_stars_repo_licenses": ["MIT"], "m...
!BSD 3-Clause License ! !Copyright (c) 2021, Kiyle Winborne !All rights reserved. ! !Redistribution and use in source and binary forms, with or without !modification, are permitted provided that the following conditions are met: ! !1. Redistributions of source code must retain the above copyright notice, this ...
{"hexsha": "851b8e13fdfd20fa377beff803768d41ff89c115", "size": 6505, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Singly Linked List/src/list.f90", "max_stars_repo_name": "kwinborne/Fortran-Structures", "max_stars_repo_head_hexsha": "d9b3728f3c1c203d6b76f9cf6656fc3bfce32757", "max_stars_repo_licenses": ["BS...
import cv2 import numpy as np from functions import * import scipy.ndimage from params import * import os import shutil import scipy.signal import time #http://docs.opencv.org/3.1.0/d3/d14/tutorial_ximgproc_disparity_filtering.html#gsc.tab=0 def generate_disparity_map_from_pair(pair_filenames, pair_id): generate_...
{"hexsha": "40531fe4b4bd7bebda557f6f42572e1af03727ff", "size": 12894, "ext": "py", "lang": "Python", "max_stars_repo_path": "functions_disparity_map.py", "max_stars_repo_name": "sebasmurphy/iarpa", "max_stars_repo_head_hexsha": "aca39cc5390a153a9779a636ab2523e65cb6d3b0", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
#include "help.h" #include <iostream> #include <boost/program_options.hpp> extern "C" { #include "util/log.h" }; namespace po = boost::program_options; namespace oonalysis::cli { typedef enum subcmd_t { PARSE, LIST, HELP } subcmd_t; static subcmd_t determine_cmd(const std::string& cmd) { LOG(DEBUG, "Determi...
{"hexsha": "fc4e9266cb7cb97729d5cacf68855eee14467618", "size": 1701, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/cli/help.cpp", "max_stars_repo_name": "jeresch/oonalysis", "max_stars_repo_head_hexsha": "09b49dcd57616e56ff9abcd8989ef18be1489b9a", "max_stars_repo_licenses": ["BSD-Source-Code"], "max_stars_co...
""" Display scores with violin plots """ import itertools import os import matplotlib.pyplot as plt import numpy as np import seaborn as sns from data import * __author__ = "Nejc Ilc" __copyright__ = "Copyright 2020, Nejc Ilc" __license__ = "GPL" __version__ = "0.9" __email__ = "nejc.ilc@gmail.com" __status__ = "Expe...
{"hexsha": "60ffb51bd5f60d175e96d9f50493feaa08d641a2", "size": 5018, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiment/plotViolins.py", "max_stars_repo_name": "nejci/PRAr", "max_stars_repo_head_hexsha": "5eae71e248b35dfc025fc3825410fc2959673f67", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2,...
using PowerSimulationsDynamics using Sundials """ Case 24: This case study a 15-state grid following inverter against an infinite bus located at bus 1, with the inverter located at bus 2. The perturbation increase the reference power (analogy for mechanical power) from 0.5 to 0.7. """ ################################...
{"hexsha": "c2f30e301a831667002a9e464e37a518eb11d12d", "size": 5141, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_case24_gridfollowing.jl", "max_stars_repo_name": "tavovalmo/PowerSimulationsDynamics.jl", "max_stars_repo_head_hexsha": "61ba0433ab89caa37f9cf2caedaa2bcc2566591c", "max_stars_repo_license...
import matplotlib #matplotlib.use('TkAgg') import os from copy import deepcopy from subprocess import Popen import matplotlib.pyplot as plt import numpy as np from IPython import embed import logging import math from imageio import imwrite import shutil import torch import torch.nn.functional as F from torch.utils.data...
{"hexsha": "2f21594d88de1e714364e81562e8372632fec453", "size": 25115, "ext": "py", "lang": "Python", "max_stars_repo_path": "trajectories/road.py", "max_stars_repo_name": "johannah/trajectories", "max_stars_repo_head_hexsha": "282a5bcb5c33e0c75251397f778abac1d5aa1cb6", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
""" abstract type StructOfConstraints <: MOI.ModelLike end A struct storing a subfields other structs storing constraints of different types. See [`Utilities.@struct_of_constraints_by_function_types`](@ref) and [`Utilities.@struct_of_constraints_by_set_types`](@ref). """ abstract type StructOfConstraints <: MOI.M...
{"hexsha": "6b8a9a336f258a6ee2d8d6bb3e04ff45b15facd1", "size": 12687, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Utilities/struct_of_constraints.jl", "max_stars_repo_name": "goulart-paul/MathOptInterface.jl", "max_stars_repo_head_hexsha": "f96f7cb7947af4546d0f1aa1d18c482024aaf9fc", "max_stars_repo_licens...
#!/usr/bin/env python # coding: utf-8 # In[ ]: get_ipython().run_line_magic('matplotlib', 'inline') import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt from datetime import datetime, date, time from sklearn.metrics import r2_score # In[ ]: # data pre-processing data = pd.read...
{"hexsha": "4f4f2db95e01403733214811f2457ec5c881980f", "size": 4130, "ext": "py", "lang": "Python", "max_stars_repo_path": "downloaded_kernels/house_sales/parsed_kernels/kernel_221.py", "max_stars_repo_name": "josepablocam/common-code-extraction", "max_stars_repo_head_hexsha": "a6978fae73eee8ece6f1db09f2f38cf92f03b3ad"...
[STATEMENT] lemma confT_widen [intro?, trans]: "\<lbrakk> P,h \<turnstile> x :\<le>\<^sub>\<top> T; P \<turnstile> T \<le>\<^sub>\<top> T' \<rbrakk> \<Longrightarrow> P,h \<turnstile> x :\<le>\<^sub>\<top> T'" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>P,h \<turnstile> x :\<le>\<^sub>\<top> T; P \<tur...
{"llama_tokens": 198, "file": "JinjaDCI_BV_BVConform", "length": 1}
import numpy as np import torch from typing import Union class Color: """ Colors class for use with terminal. """ HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' ...
{"hexsha": "6ec9d2f8bccfc815ca29ce826ffdaeb2b5bd923b", "size": 9336, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "e259f381/RTG", "max_stars_repo_head_hexsha": "8282c573d4cf0e83c001b4c1357ff1c4c897fbd7", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 1, "max_st...
import pandas as pd import numpy as np import colorama from colorama import Fore, Style from tabulate import tabulate def meta(train,test,missing_values = -1,cols_ignore_missing = []): df = pd.concat([train,test]).reset_index(drop=True).fillna('未知') data = [] for col in df.columns: # 定义role ...
{"hexsha": "38c73f0faeb89d64de451b43a54dff910944ffdb", "size": 7279, "ext": "py", "lang": "Python", "max_stars_repo_path": "porto-seguro-safe-driver-prediction/Phase2/Exe&Sol/data_management.py", "max_stars_repo_name": "datoujinggzj/WhaleDataScience", "max_stars_repo_head_hexsha": "ef27a54a89a11d6e425addd1a8278d54db1b3...
// root_finding_example.cpp // Copyright Paul A. Bristow 2010, 2015 // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) // Example of finding roots using Newton-Raphson, Halley. ...
{"hexsha": "9cbfd237ed79d468bca9654e2651c76cf946e565", "size": 20987, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "3rdParty/boost/1.71.0/libs/math/example/root_finding_example.cpp", "max_stars_repo_name": "rajeev02101987/arangodb", "max_stars_repo_head_hexsha": "817e6c04cb82777d266f3b444494140676da98e2", "max_s...
import numpy as np import torch from ddpg import DDPGAgent from utilities import soft_update, transpose_to_tensor, transpose_list device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class MADDPG: """policy + critic updates""" def __init__(self, discount_factor=0.95, tau=0.02): su...
{"hexsha": "798fbb2e3b5de1f6c325cd4a3b0013a11c2d7888", "size": 6028, "ext": "py", "lang": "Python", "max_stars_repo_path": "p3_collab-compet/maddpg.py", "max_stars_repo_name": "anguillanneuf/deep-reinforcement-learning", "max_stars_repo_head_hexsha": "9284bdfa2ba6cd136536ebd5d04e6c9fb9e492f8", "max_stars_repo_licenses"...
import numpy as np import pytest import norbert @pytest.fixture(params=[8, 11, 33]) def nb_frames(request): return int(request.param) @pytest.fixture(params=[8, 11, 33]) def nb_bins(request): return request.param @pytest.fixture(params=[1, 2, 3]) def nb_channels(request): return request.param @pytes...
{"hexsha": "37d112cd6093c58c58d9ff0fb55770f2f88ed585", "size": 2217, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_gaussian.py", "max_stars_repo_name": "AppleHolic/norbert", "max_stars_repo_head_hexsha": "cceaa24bce625bcba3146198271a20e4c265f2c8", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
#!/usr/bin/env python """ xml2mask.py Generate masks from xml files, which are from LabelMe http://labelme.csail.mit.edu/ Zhiang Chen, Nov 2018 Harish Hanand Copyright (c) 2018 Distributed Robotic Exploration and Mapping Systems Laboratory, ASU """ import os from lxml import etree import numpy as np from PIL import ...
{"hexsha": "15350caf8aef43dd562c3fb34e136c0b69f3965d", "size": 6028, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_augmentor/xml2mask.py", "max_stars_repo_name": "ZhiangChen/tornado_ML", "max_stars_repo_head_hexsha": "d8bded61a6a234ca67e31776bc8576c6c18f5621", "max_stars_repo_licenses": ["MIT"], "max_star...
import os import cv2 as cv import numpy as np import random import string imagepath = "./test/test/" #face_classifier = cv.CascadeClassifier("/home/sam/anaconda3/lib/python3.6/site-packages/cv2/data/haarcascade_frontalface_alt.xml") net = cv.dnn.readNetFromCaffe("deploy.prototxt.txt", "res10_300x300_ssd_iter_140000....
{"hexsha": "6cd68779c4d302b94d3af0a4c13eb992fc47684e", "size": 4551, "ext": "py", "lang": "Python", "max_stars_repo_path": "imageExtractor.py", "max_stars_repo_name": "MarxCar/FineViewer", "max_stars_repo_head_hexsha": "3d3b7675c2c6e082294b508e1608d6aea9ff2dc6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
import numpy as np import cv2 import glob import os import matplotlib.pyplot as plt import matplotlib.image as mpimg import pickle # Run the function # grad_binary = abs_sobel_thresh(img, orient='x', thresh_min=20, thresh_max=100) # mag_binary = mag_thresh(image, sobel_kernel=9, mag_thresh=(30, 100)) # di...
{"hexsha": "f15c78c71707b19706109ea73837c476fc71efec", "size": 5076, "ext": "py", "lang": "Python", "max_stars_repo_path": "thresholding.py", "max_stars_repo_name": "oguzhankara/CarND-Advanced-Lane-Lines", "max_stars_repo_head_hexsha": "14f7f66919f044aefa401f296fd2d816ffcf9daa", "max_stars_repo_licenses": ["MIT"], "max...
#!/usr/bin/env python3 # coding: utf-8 """ @author: Ping Qiu qiuping1@genomics.cn @last modified by: Ping Qiu @file:stereo_exp_data.py @time:2021/03/22 change log: 2021/08/12 add to_andata function , by wuyiran. """ from .data import Data import pandas as pd import numpy as np from typing import Optional, Union...
{"hexsha": "35377dc4fbbf8cfd16a65878341a68af8ec88184", "size": 7352, "ext": "py", "lang": "Python", "max_stars_repo_path": "stereo/core/stereo_exp_data.py", "max_stars_repo_name": "nilsmechtel/stereopy", "max_stars_repo_head_hexsha": "cd8f34b45ae6667043611e5d02ea46f8ca3f0c7b", "max_stars_repo_licenses": ["MIT"], "max_s...
// Copyright (c) 2012-2013 The Polcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "leveldbwrapper.h" #include "uint256.h" #include "random.h" #include "test/test_Polcoin.h" #include <boost/assign/s...
{"hexsha": "44db367325c6b9af5ea520562a61d75309e268ad", "size": 6577, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/test/leveldbwrapper_tests.cpp", "max_stars_repo_name": "wargo32/Polcoin", "max_stars_repo_head_hexsha": "7c142ec10f9672b0d3e541e1a659c0ace7064726", "max_stars_repo_licenses": ["MIT"], "max_stars...
import random import numpy as np from scipy.stats import binom class Player: def __init__(self, player_name): self.name = player_name self.dice_number = 5 self.current_roll = list() self.player_status = "in_game" self.trust = {} self.risk_taking = random.random() ...
{"hexsha": "105b77f82aaacdbb13e81f8da633c6b775feda49", "size": 7180, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/player.py", "max_stars_repo_name": "VasaKiDD/perudo-python", "max_stars_repo_head_hexsha": "19a0751c4f4b82230ef25e78898866f6b4dfade8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
# Copyright 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
{"hexsha": "40918b6f9de0e19f386f8b5a8848815e35c5818c", "size": 13487, "ext": "py", "lang": "Python", "max_stars_repo_path": "numba_dppy/dppy_passes.py", "max_stars_repo_name": "Rubtsowa/numba-dppy", "max_stars_repo_head_hexsha": "20f9825b144913ebe1f7635c785b334f3743c4cb", "max_stars_repo_licenses": ["Apache-2.0"], "max...
import os import pickle import kenlm import numpy as np from s2search.text import fix_text, fix_author_text from s2search.features import make_features, posthoc_score_adjust class S2Ranker: """A class to encapsulate the Semantic Scholar search ranker. Arguments: data_dir {str} -- where the language m...
{"hexsha": "2ad87e32a8f8c0ebca17f64f25242f646cb8114a", "size": 2981, "ext": "py", "lang": "Python", "max_stars_repo_path": "s2search/rank.py", "max_stars_repo_name": "ZeruiW/s2search", "max_stars_repo_head_hexsha": "cb0539b9594d7afe12e64c0b4ada4fb29c793060", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count":...