text
stringlengths
0
27.1M
meta
dict
import os import glob import random import numpy as np import subprocess import audiosegment import inflect from num2words import num2words inflect_engine = inflect.engine() PAD = '_' EOS = '~' PUNC = '!\'(),-.:;?`' SPACE = ' ' SYMBOLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' en_symbols = SYMBOLS + PAD...
{ "alphanum_fraction": 0.5743090561, "author": null, "avg_line_length": 32.8742857143, "converted": null, "ext": "py", "file": null, "hexsha": "8592828d96fc4e10b90596f1d5ccc37cd88fa301", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
// __BEGIN_LICENSE__ // Copyright (c) 2009-2013, United States Government as represented by the // Administrator of the National Aeronautics and Space Administration. All // rights reserved. // // The NGT platform is licensed under the Apache License, Version 2.0 (the // "License"); you may not use this file excep...
{ "alphanum_fraction": 0.628457295, "author": null, "avg_line_length": 44.0284757119, "converted": null, "ext": "cc", "file": null, "hexsha": "f379cc966d45bf82fbba67c1fddb2b85769eeddb", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_c...
# Import Libraries import numpy as np import pandas as pd from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_squared_error from sklearn.model_selection import cross_val_score def stack_models(df_prepared, df_target, model_1, model_2, model_3, model_4): """ Stack all th...
{ "alphanum_fraction": 0.7377972466, "author": null, "avg_line_length": 47, "converted": null, "ext": "py", "file": null, "hexsha": "12206ca200b4b6557e0ffb1c3afef3ff04d949e4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": ...
[STATEMENT] lemma secureTT_secure: "secureTT \<Longrightarrow> secure" [PROOF STATE] proof (prove) goal (1 subgoal): 1. secureTT \<Longrightarrow> secure [PROOF STEP] unfolding secureTT_def secure_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<forall>tr vl vl1. validSystemTrace tr \<and> TT tr \<and> B vl vl1...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Bounded_Deducibility_Security_BD_Security_Triggers", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 244, "mathlib_filename": null, "max_forks_count": null...
#include <boost/simd/include/native.hpp> #include <boost/simd/preprocessor/stack_buffer.hpp> #include <boost/simd/include/functions/aligned_load.hpp> using boost::simd::aligned_load; using boost::simd::native; int main() { typedef native<double,BOOST_SIMD_DEFAULT_EXTENSION> simd_t; BOOST_SIMD_ALIGNED_STACK_BUFFER...
{ "alphanum_fraction": 0.699195171, "author": null, "avg_line_length": 26.8648648649, "converted": null, "ext": "cpp", "file": null, "hexsha": "0e61852902dba43e464e3e60443a12107293d8c9", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
import numpy as np from nntoolbox.losses import PinballLoss import torch class TestPinball: def test_pinball(self): """ Adopt from https://www.tensorflow.org/addons/api_docs/python/tfa/losses/PinballLoss """ target = torch.from_numpy(np.array([0., 0., 1., 1.])) input = torc...
{ "alphanum_fraction": 0.6209150327, "author": null, "avg_line_length": 30.6, "converted": null, "ext": "py", "file": null, "hexsha": "8de78c3cbd764308810f46e2e966f28cfb6bc324", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import numpy as np from sklearn.isotonic import IsotonicRegression from .curve_fit import project_convex_lip class _BaseShapeIV: def predict(self, X): inds = np.searchsorted(self.x_, X[:, 0]) lb_x = self.x_[np.clip(inds - 1...
{ "alphanum_fraction": 0.5245339912, "author": null, "avg_line_length": 43.6886227545, "converted": null, "ext": "py", "file": null, "hexsha": "b88ea10c8ec44659bb6e4fbd6e8a28e8bebd3a58", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from ..diversity import compound_class from matplotlib import pyplot as plt import pandas as pd import numpy as np def compound_class_plot(formula_list, mass_list = [], method = 'MSCC', **kwargs): """ Docstring for function PyKrev.compound_c...
{ "alphanum_fraction": 0.6490641711, "author": null, "avg_line_length": 34.7906976744, "converted": null, "ext": "py", "file": null, "hexsha": "bada6d532f820ea31a6af84366421420c00d2988", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import os.path import copy import hashlib import errno import numpy as np from numpy.testing import assert_array_almost_equal from parse_config import args from data.noise import build_for_cifar100 def check_integrity(fpath, md5): if not os.path.isfile(fpath): return False md5o...
{ "alphanum_fraction": 0.5386627147, "author": null, "avg_line_length": 35.7352024922, "converted": null, "ext": "py", "file": null, "hexsha": "19a06d14e7b3b786e9f319c7d46af3edfd1e436d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Let's look at how the API is used by importing a simple pretrained imagenet # model and testing it out on a picture of a dog. We start with our imports, and # can import our ResNet50 model-getter and decode_predictions tool for # retrieving labels import tensorflow as tf import matplotlib.pyplot as plt import numpy ...
{ "alphanum_fraction": 0.7597103357, "author": null, "avg_line_length": 35.3255813953, "converted": null, "ext": "py", "file": null, "hexsha": "210f55df88643738d1b7bb7f68deee0df19cf436", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma invpst_baldR: "invpst l \<Longrightarrow> invpst r \<Longrightarrow> invpst (baldR l a r)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>invpst l; invpst r\<rbrakk> \<Longrightarrow> invpst (baldR l a r) [PROOF STEP] by (cases "(l,a,r)" rule: baldR.cases) (auto simp: invpst_baliL)
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Priority_Search_Trees_PST_RBT", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 135, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_f...
/******************************************************************************* procmon, Copyright (c) 2014, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. If you have questi...
{ "alphanum_fraction": 0.5685949631, "author": null, "avg_line_length": 35.3835845896, "converted": null, "ext": "hh", "file": null, "hexsha": "6269ddc48e5ca5e3fe28780105933a6380d2f739", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
program main use DataInputM use Structural3DApplicationM use StructuralStrategyM use SolvingStrategyM use GIDDataOutputM implicit none type(Structural3DApplicationDT) :: application type(StructuralStrategyDT) :: strategy type(SolvingStrategyDT) :: solvingStrategy call initFEM3D(ap...
{ "alphanum_fraction": 0.4899328859, "author": null, "avg_line_length": 58.3711340206, "converted": null, "ext": "f90", "file": null, "hexsha": "2259e7a63bfd671cebefb528f8143a1d2728b682", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
# Copyright 2021 Google LLC # # 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 writing, ...
{ "alphanum_fraction": 0.6227923406, "author": null, "avg_line_length": 29.2336956522, "converted": null, "ext": "py", "file": null, "hexsha": "fe8ad2c02b216bbb8e3ff21781deeac633419a46", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
program tel integer n,m,l parameter(n=96,m=38,l=13) integer i,j,k,irow,icol,iu,itel write(6,*) 'give irow' read(5,*) irow write(6,*) 'give icol' read(5,*) icol do i=1,n do j=1,m do k=1,l do iu=1,6 itel = 6*((k-1)*n*m+n*(j-1)+i-1) +iu if (...
{ "alphanum_fraction": 0.4411764706, "author": null, "avg_line_length": 21.76, "converted": null, "ext": "f", "file": null, "hexsha": "fe7d8bdaaf0d5f1630f0a3486b9c46c19de6f3b3", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
""" A basic parser for tped plink formated files to a more convenient HDF5 format. """ import time import h5py import scipy as sp def parse_single_12tped_to_hdf5(in_file_prefix='/home/bv25/data/Ls154/Ls154_12', out_file_prefix='/home/bv25/data/Ls154/Ls154_12', impute_t...
{ "alphanum_fraction": 0.6025880031, "author": null, "avg_line_length": 37.6818181818, "converted": null, "ext": "py", "file": null, "hexsha": "a5aaeafcc6c6cdf0e803a585d3237a19f8f0df47", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# ############################################## # Implementation of a (k,n) threshold scheme # ################################################ import sys import numpy as np # Parameters that needs to be changed manually are marked with: <-- par_nbr = 1 #<-- participant number n = 5 #<-- k = 3 #<-- polynom = ...
{ "alphanum_fraction": 0.5047454702, "author": null, "avg_line_length": 24.1458333333, "converted": null, "ext": "py", "file": null, "hexsha": "3162b9522006d2fcd9123dfd6dd03fce1b0754c6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import cv2 import numpy as np import sys import shutil import os class Crop(): def __init__(self, image_name): self.image_name = image_name #####Filled polygons #lpnts : polygons being built self.lpnts = np.empty((1,0,2), dtype=np.int32) #rpnts : ready polygons ...
{ "alphanum_fraction": 0.5486885246, "author": null, "avg_line_length": 41.7808219178, "converted": null, "ext": "py", "file": null, "hexsha": "f5771bcb94145faec8c3e9dda1947970d4dcec1e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import time numMin = [] numMax = [] numAvg = [] ts = [] tformat = "%d/%m/%Y" print(time.strftime(tformat)) tformat = "%H:%M" #tformat = "%H:%M:%S" for i in range(5): numMin.append(np.random.randint(1,high=3)) numMax.append(np.random.randint(10,high=15)) numAvg.append(np.rand...
{ "alphanum_fraction": 0.6070763501, "author": null, "avg_line_length": 23.347826087, "converted": null, "ext": "py", "file": null, "hexsha": "6f9ca5ad8d28ec9cf4943e99b308f4d4f822535a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#!/usr/bin/env python import os import argparse import subprocess import numpy as np import pandas as pd from Bio import Seq import pyranges as pr from pathlib import Path from collections import defaultdict def main(fasta_file, codon_list, input_file, output, aa_length): results_name = ( output ...
{ "alphanum_fraction": 0.577994429, "author": null, "avg_line_length": 28.046875, "converted": null, "ext": "py", "file": null, "hexsha": "1dec6566bfb7b7aa25fcc168faa08f4a0c363194", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_co...
/- Copyright (c) 2021 Joseph Myers. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Myers -/ import linear_algebra.ray import linear_algebra.determinant /-! # Orientations of modules This file defines orientations of modules. ## Main definitions * `orientatio...
{ "alphanum_fraction": null, "author": "leanprover-community", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_...
[STATEMENT] lemma in_conc_True[iff]: "\<And>L R. fin (conc L R) (True#p) = False" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<And>L R. fin (RegExp2NAe.conc L R) (True # p) = False [PROOF STEP] by (simp add:conc_def)
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Functional-Automata_RegExp2NAe", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 106, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_...
# Call Syntax person = @shared_var Citizen( name::String = "Amin", number::Float64 = 20.0, ) person2 = Citizen(name = "Not-Amin", number = 1) @test person.name == person2.name @test person2.number == person2.number
{ "alphanum_fraction": 0.6024096386, "author": null, "avg_line_length": 22.6363636364, "converted": null, "ext": "jl", "file": null, "hexsha": "1388c6ae193d553967a7d92e48fe12579fdf515e", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
REBOL [ Title: "Red compile error test script" Author: "Peter W A Wood" File: %compile-error-test.r Rights: "Copyright (C) 2013-2015 Peter W A Wood. All rights reserved." License: "BSD-3 - https://github.com/red/red/blob/origin/BSD-3-License.txt" ] ~~~start-file~~~ "Red compile errors" --test-- "ce-1 iss...
{ "alphanum_fraction": 0.6541019956, "author": null, "avg_line_length": 28.1875, "converted": null, "ext": "r", "file": null, "hexsha": "48d3d8375eecee54ea6d7397dade63a048a1770b", "include": null, "lang": "R", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": 1...
from bayesianpy.network import NetworkFactory class Selector: def __init__(self, target, continuous=[], discrete=[]): self.target = target self._continuous = list(continuous) self._discrete = list(discrete) self._index = -1 self._all_variables = self._continuous + self._disc...
{ "alphanum_fraction": 0.6360615268, "author": null, "avg_line_length": 31.7228915663, "converted": null, "ext": "py", "file": null, "hexsha": "0b1609756709f590f373cf3d374183b4b4b2171b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma Subset_fresh_iff [simp]: "a \<sharp> t SUBS u \<longleftrightarrow> a \<sharp> t \<and> a \<sharp> u" [PROOF STATE] proof (prove) goal (1 subgoal): 1. a \<sharp> t SUBS u = (a \<sharp> t \<and> a \<sharp> u) [PROOF STEP] apply (rule obtain_fresh [where x="(t, u)"]) [PROOF STATE] proof (prove) goal (1...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Incompleteness_Predicates", "hexsha": null, "include": null, "lang": null, "length": 3, "llama_tokens": 236, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks...
#%% Import modules import time from get_data import get_data import model as m from train import train from comp import comp import numpy as np from os import listdir from sklearn.metrics import r2_score import torch import torch.optim as optim import torch.nn as nn #%% tStart = time.time() #%% Path dpath = './Data_...
{ "alphanum_fraction": 0.595107339, "author": null, "avg_line_length": 33.0164835165, "converted": null, "ext": "py", "file": null, "hexsha": "52212593f934c160a224bbc4225bbf075418a51c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import .QueueUnion: Range, Queues import Printf: @printf const EPS = 1e-10 const DEBUG = false @deprecate( clip_front(elements, pqs, i, slope, offset, t), clip(elements, Ref(pqs, i), +slope, +offset - t, Val(true)) ) @deprecate( clip_back(elements, pqs, i, slope, offset, t), clip(elements, Ref(pqs,...
{ "alphanum_fraction": 0.552928533, "author": null, "avg_line_length": 27.776119403, "converted": null, "ext": "jl", "file": null, "hexsha": "8505692ff02f1c93a2e008280a9c154bb0e2b497", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
from __future__ import absolute_import, division, print_function """ This is for 3D selection in Glue 3d scatter plot viewer. """ import numpy as np from glue.core import Data from glue.config import viewer_tool from glue.viewers.common.tool import CheckableTool from glue.core.command import ApplySubsetState from...
{ "alphanum_fraction": 0.6076327584, "author": null, "avg_line_length": 32.2938596491, "converted": null, "ext": "py", "file": null, "hexsha": "675f0643e4fbcbdc8e76d0603c77eab0d12053f3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.models import load_model from tensorflow.keras.optimizers import Adam import numpy as np from matplotlib import pyplot as plt import sys import os import warnings import logging # TODO: Specify the directory that contains the `pyco...
{ "alphanum_fraction": 0.6661639962, "author": null, "avg_line_length": 39.8872180451, "converted": null, "ext": "py", "file": null, "hexsha": "a731d09114df5d6444b6a876bbd110f4eb92e8a7", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
!****h* ROBODoc/H5D (F03) ! ! NAME ! H5D_PROVISIONAL ! ! PURPOSE ! This file contains Fortran 90 and Fortran 2003 interfaces for H5D functions. ! It contains the same functions as H5Dff_F90.f90 but includes the ! Fortran 2003 functions and the interface listings. This file will be compiled ! instead of H5Dff_F90.f...
{ "alphanum_fraction": 0.7078845885, "author": null, "avg_line_length": 41.6191268191, "converted": null, "ext": "f90", "file": null, "hexsha": "61d5dfc72fb42458e27c615d74bfc4931cab92d8", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
#!python3 ./infer.py from time import sleep from picamera import PiCamera import numpy as np import tarfile import tempfile import os import timeit import tvm from tvm.contrib import graph_runtime as runtime from tvm.contrib.download import download_testdata from scipy.special import softmax # Download the and load l...
{ "alphanum_fraction": 0.666743649, "author": null, "avg_line_length": 34.64, "converted": null, "ext": "py", "file": null, "hexsha": "727497497893439fdac26756aab2e9691adf903d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved. # # 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 ...
{ "alphanum_fraction": 0.6486585478, "author": null, "avg_line_length": 34.5601265823, "converted": null, "ext": "py", "file": null, "hexsha": "86d66ab3523131f07d7fcd5402670e46fc1ceb8c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma Cl_F: "Br_1 \<B> \<Longrightarrow> Br_3 \<B> \<Longrightarrow> \<forall>A. Cl(\<F> A)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>Br_1 \<B>; Br_3 \<B>\<rbrakk> \<Longrightarrow> \<forall>A w. \<C> (\<F> A) w = \<F> A w [PROOF STEP] by (metis CF_rel Cl_fr_def FB4 Fr_4_def eq_ext' join_d...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Topological_Semantics_topo_border_algebra", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 146, "mathlib_filename": null, "max_forks_count": null, "max_...
import os import csv import numpy as np import torch import pandas as pd import matplotlib.pyplot as plt if __name__ == "__main__": base_path = os.path.join('results', 'mnistgen_ent') exp_names = [f"mnistgen_ent1", f"mnistgen_ent2"] dfs = [] for exp_name in exp_names: results_path = os.path.jo...
{ "alphanum_fraction": 0.647, "author": null, "avg_line_length": 34.4827586207, "converted": null, "ext": "py", "file": null, "hexsha": "207dfc0cb06d458a04c950d15aa2f4e19338a602", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_coun...
import numpy as np from rdkit.Chem import Mol from rdkit.Chem import DataStructs from rdkit.Chem import rdFingerprintGenerator import rdkit.Chem.Descriptors as Desc def _fingerprint_fn_bits(generator): def _fp(mol: Mol): fingerprint = generator.GetFingerprint(mol) array = np.zeros((0,), dtype=np.i...
{ "alphanum_fraction": 0.6535433071, "author": null, "avg_line_length": 37.7743589744, "converted": null, "ext": "py", "file": null, "hexsha": "7b54b4dc903d833c3e25018b3a742feccf83023e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
// // asio.hpp // ~~~~~~~~ // // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under 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) // // See www.boost.org/libs/asio for documentation. /...
{ "alphanum_fraction": 0.8005455712, "author": null, "avg_line_length": 41, "converted": null, "ext": "hpp", "file": null, "hexsha": "c8179c7ec074c5dd51c8ca17cb48db699f07f1df", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": 12...
#importing required modules import pandas as pd import numpy as np #function to create or check required files def create_file(): try: exp = pd.read_csv('ent_expense.csv') except FileNotFoundError: exp = pd.DataFrame({'Purchase': np.NaN,'Electricity': np.NaN,'Telecom': np.NaN,'Rent': np.NaN,'In...
{ "alphanum_fraction": 0.6472868217, "author": null, "avg_line_length": 49.1428571429, "converted": null, "ext": "py", "file": null, "hexsha": "c4c5460d7718979818551e2c0597f6f2db2095de", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by Bin Xiao (Bin.Xiao@microsoft.com) # ------------------------------------------------------------------------------ from __future__ import absolute_import from __futu...
{ "alphanum_fraction": 0.5784743287, "author": null, "avg_line_length": 41.4965034965, "converted": null, "ext": "py", "file": null, "hexsha": "a67007d27ee7183cb1e0ccb11f76309155fb9881", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import sys import json import yaml import datetime import numpy as np from ptranking.base.ranker import LTRFRAME_TYPE from ptranking.data.data_utils import SPLIT_TYPE from ptranking.ltr_adhoc.eval.ltr import LTREvaluator from ptranking.ltr_adhoc.eval.parameter import ValidationTape from ptranking.ltr_divers...
{ "alphanum_fraction": 0.6482585504, "author": null, "avg_line_length": 52.056261343, "converted": null, "ext": "py", "file": null, "hexsha": "d6c4df9ba339a7a7094461a3267f481a5b638759", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import cv2 import numpy as np import svm_train as st #Get the biggest Controur def getMaxContour(contours,minArea=200): maxC=np.array([]) maxArea=minArea for cnt in contours: area=cv2.contourArea(cnt) if(area>maxArea): maxArea=area maxC=cnt return maxC #Ge...
{ "alphanum_fraction": 0.649870801, "author": null, "avg_line_length": 28.6666666667, "converted": null, "ext": "py", "file": null, "hexsha": "35fa3eba7dc577cb274a27465d86f711e8f1fd6f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 University of Groningen # # 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 # # U...
{ "alphanum_fraction": 0.6091748372, "author": null, "avg_line_length": 40.9765395894, "converted": null, "ext": "py", "file": null, "hexsha": "502fd3e66cd31c6d7362ee65920565c9874dfac3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python """ Key '0' - To select areas of background Key '1' - To select areas of cervix Key '2' - To select areas of channel Key 'l' - go to next image Key 'k' - go to previous iamge Key 'd' - inc thickness Key 'a' - dec thickness Key 'r' - To reset mask Key 's' - To save the results Key 'm' - move pro...
{ "alphanum_fraction": 0.5802332038, "author": null, "avg_line_length": 33.3518518519, "converted": null, "ext": "py", "file": null, "hexsha": "5a74c26749b5e20b1f1cbfced1ce96721e9adad9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
def azureml_main(frame1): import matplotlib matplotlib.use('agg') import pandas as pd import numpy as np import matplotlib.pyplot as plt import statsmodels.graphics.boxplots as sm Azure = True ## Create a series of bar plots for the various levels of the ## string co...
{ "alphanum_fraction": 0.5516098485, "author": null, "avg_line_length": 41.4117647059, "converted": null, "ext": "py", "file": null, "hexsha": "5744ca34e9a48c1fb7a7a25ba1e5613b7df89d9a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma nn_integral_C: assumes "m \<le> m'" and f[measurable]: "f \<in> borel_measurable (PiM {0..<n+m} M)" and nonneg: "\<And>x. x \<in> space (PiM {0..<n+m} M) \<Longrightarrow> 0 \<le> f x" and x: "x \<in> space (PiM {0..<n} M)" shows "(\<integral>\<^sup>+x. f x \<partial>C n m x) = (\<integral...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": 11, "llama_tokens": 2147, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_datetime":...
# -*- coding: utf-8 -*- """ This example solves a plug-flow reactor problem of hydrogen-oxygen combustion. The PFR is computed by two approaches: The simulation of a Lagrangian fluid particle, and the simulation of a chain of reactors. """ import cantera as ct import numpy as np ######################################...
{ "alphanum_fraction": 0.6446855399, "author": null, "avg_line_length": 37.1006289308, "converted": null, "ext": "py", "file": null, "hexsha": "982da873a7279e840837dc2e38fcb09fa1412577", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python # generative model associated with compression approaches to give us insights # into how to compress better import numpy as np import matplotlib.pyplot as plt # from .datasets import viz # ================================================================ main def unif_nbits(N=200, B=16, M=8, ...
{ "alphanum_fraction": 0.5485631139, "author": null, "avg_line_length": 27.7676767677, "converted": null, "ext": "py", "file": null, "hexsha": "8e24d5f3e118b8d375b390d1933cc188d324be1f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
\section{The one-pass distributed algorithm} The essence of the distributed strategy is to achieve almost perfect parallelism, by splitting the input matrix into several smaller matrices called \emph{jobs}. \\ \[ A^{m \times n} = \begin{bmatrix} A_1^{m \times c_1} \mid A_2^{m \times c_2} \mid \cdots \mid A_k^{m \tim...
{ "alphanum_fraction": 0.7141222248, "author": null, "avg_line_length": 36.7142857143, "converted": null, "ext": "tex", "file": null, "hexsha": "3589a82772411f72d0744f9e02cd07290317e2f9", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# Copyright Contributors to the Tapqir project. # SPDX-License-Identifier: Apache-2.0 import math from collections import defaultdict from functools import partial from pathlib import Path import numpy as np import pandas as pd import pyro import pyro.distributions as dist import torch from pyro.ops.indexing import V...
{ "alphanum_fraction": 0.4933762649, "author": null, "avg_line_length": 35.1779935275, "converted": null, "ext": "py", "file": null, "hexsha": "13edc955e54506b3359158d83638564c67cf7eee", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
"""Colour related classes and functions.""" from collections import deque import random import numpy def wrap_hue(value): while value >= 360: value -= 360 while value < 0: value += 360 return value def rainbow(gap): def hue_iterator(): hue = wrap_hue(random.randint(0, 359) ...
{ "alphanum_fraction": 0.6145393068, "author": null, "avg_line_length": 20.7543859649, "converted": null, "ext": "py", "file": null, "hexsha": "22c3972f63f9a39de5b503d0450c88b2cf12e3fc", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Class Features Name: lib_data_io_ascii Author(s): Francesco Avanzi (francesco.avanzi@cimafoundation.org), Fabio Delogu (fabio.delogu@cimafoundation.org) Date: '20210603' Version: '1.0.0' """ ####################################################################################### # Libra...
{ "alphanum_fraction": 0.5431573976, "author": null, "avg_line_length": 42.7727272727, "converted": null, "ext": "py", "file": null, "hexsha": "83dfb7337ac8ecf14479ddc82c780295ba1f350c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma finite_ImageI: assumes "finite A" assumes "\<And>a. a\<in>A \<Longrightarrow> finite (R``{a})" shows "finite (R``A)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. finite (R `` A) [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. finite (R `` A) [PROOF STEP] note [[simp...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "CAVA_LTL_Modelchecker_SM_Lib_SOS_Misc_Add", "hexsha": null, "include": null, "lang": null, "length": 14, "llama_tokens": 865, "mathlib_filename": null, "max_forks_count": null, "max...
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### imp...
{ "alphanum_fraction": 0.6593245228, "author": null, "avg_line_length": 35.1030927835, "converted": null, "ext": "py", "file": null, "hexsha": "bc886a9617dbc7d15f807bfb65a4004abdf51d0f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright (c) 2020, Huawei Technologies.All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/BSD-3-Clause # # Unless required by applicable law...
{ "alphanum_fraction": 0.6523170423, "author": null, "avg_line_length": 40.7113402062, "converted": null, "ext": "py", "file": null, "hexsha": "68688ae6faaaf28701889744bc013d134d7ce2e5", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import logging from absl import app from absl import flags import numpy as np import torch from bgrl import * log = logging.getLogger(__name__) FLAGS = flags.FLAGS # Dataset. flags.DEFINE_enum('dataset', 'coauthor-cs', ['amazon-computers', 'amazon-photos', 'coauthor-cs', 'coauthor-physics', 'wiki-c...
{ "alphanum_fraction": 0.6769157994, "author": null, "avg_line_length": 35.2333333333, "converted": null, "ext": "py", "file": null, "hexsha": "07d87da2d021c610fc4c1a1187cf1d82112242be", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
SUBROUTINE DIAGN(N,A,D,V,EPS) * Diagonalization of a real symmetric NxN matrix * Using the Jacobi method (from Numerical Recipes) IMPLICIT NONE INTEGER N,I,J,IP,IQ,NMAX PARAMETER(NMAX=500) DOUBLE PRECISION A(N,N),D(N),V(N,N),B(N),Z(N) DOUBLE PRECISION EPS,SM,THR,G,H,C,S,T,THE...
{ "alphanum_fraction": 0.501404269, "author": null, "avg_line_length": 23.6470588235, "converted": null, "ext": "f", "file": null, "hexsha": "96d99188be206cbbf9b4c281e9d51a2655da3ed7", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# confusion matrix is set up correctly test_that("Included and own confusion matrix give identical results", { data(iris) tmp <- ranger::ranger(Species ~., data = iris) confusion_matrix <- table(true = iris$Species, predicted = tmp$predictions) expect_equal(confusion_matrix, tmp$confusion.matrix) }) # r...
{ "alphanum_fraction": 0.729689808, "author": null, "avg_line_length": 39.3604651163, "converted": null, "ext": "r", "file": null, "hexsha": "715ae27cb9a5e51d92b130a29a33adbb1ac51892", "include": null, "lang": "R", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_coun...
import os import numpy as np import pandas as pd import pg8000 from sqlalchemy import create_engine import datetime import scipy.optimize import scipy.interpolate # templatenumeric = np.zeros((10, 1)) * np.nan # templatebool = np.zeros((10, 1), dtype=bool) engine = create_engine('postgresql+pg8000://user:password@vm...
{ "alphanum_fraction": 0.5080531033, "author": null, "avg_line_length": 44.0326409496, "converted": null, "ext": "py", "file": null, "hexsha": "0d5a2a2065e1789183178f07d8fadea93bb3a79e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
!------------------------------------------------------------------------------- ! Copyright (c) 2021, Whitman T. Dailey ! 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 sou...
{ "alphanum_fraction": 0.27610304, "author": null, "avg_line_length": 55.313771518, "converted": null, "ext": "f90", "file": null, "hexsha": "045951bfee67b863802f455802f2b1e219be0ac2", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
"""MPI-INF-3DHP dataset.""" import copy import json import os import pickle as pk import numpy as np import scipy.misc import torch.utils.data as data from hybrik.utils.bbox import bbox_clip_xyxy, bbox_xywh_to_xyxy from hybrik.utils.pose_utils import cam2pixel_matrix, pixel2cam_matrix, reconstruction_error from hybri...
{ "alphanum_fraction": 0.5666935004, "author": null, "avg_line_length": 47.7775919732, "converted": null, "ext": "py", "file": null, "hexsha": "a9b9ea59ba46b50c243767cde4912df019b26e9f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# coding: utf-8 # # Assignment 3: Recommendation systems # # Here we'll implement a content-based recommendation algorithm. # It will use the list of genres for a movie as the content. # The data come from the MovieLens project: http://grouplens.org/datasets/movielens/ # Note that I have not provided many doctests fo...
{ "alphanum_fraction": 0.6616463256, "author": null, "avg_line_length": 35.3302752294, "converted": null, "ext": "py", "file": null, "hexsha": "1ee563c4b475b96348e89866ec4cc9b366439042", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright (c) 2009-2022 The Regents of the University of Michigan. # Part of HOOMD-blue, released under the BSD 3-Clause License. """Angle potentials.""" from hoomd.md import _md from hoomd.md.force import Force from hoomd.data.typeparam import TypeParameter from hoomd.data.parameterdicts import TypeParameterDict i...
{ "alphanum_fraction": 0.6224290647, "author": null, "avg_line_length": 33.9846938776, "converted": null, "ext": "py", "file": null, "hexsha": "4742db2c2633c5311b9eb053787f8fb1f631b912", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- """example_depletion A case that shows how the depletion is carried out. Created on Mon Oct 11 21:30:00 2021 @author: Dan Kotlyar Last updated on Mon Oct 11 21:45:00 2021 @author: Dan Kotlyar """ import numpy as np from pyIsoDep.functions.maindepletionsolver import MainDepletion from pyIsoD...
{ "alphanum_fraction": 0.5309633028, "author": null, "avg_line_length": 36.8450704225, "converted": null, "ext": "py", "file": null, "hexsha": "aebf01b10fc4b2652ec44d0f5c59d1693c798c24", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
!===================================================================2 ! LANCZOS routines for BIGSTICK ! ! versions for 'new' parallelization scheme -- FALL 2011 ! ! This code uses LAPACK ROUTINES ! ! LAPACK copyright statements and license ! !Copyright (c) 1992-2013 The University of Tennessee and The University ! ...
{ "alphanum_fraction": 0.5868022562, "author": null, "avg_line_length": 30.7414543195, "converted": null, "ext": "f90", "file": null, "hexsha": "5277342d530ed9719025e01d26c3517972190f86", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
import datetime import pandas_datareader.data as web import pandas as pd import numpy as np from collections import defaultdict from sklearn.ensemble import GradientBoostingClassifier as GBC from sklearn.cross_validation import train_test_split from sklearn.metrics import precision_score import warnings warnings.filt...
{ "alphanum_fraction": 0.6795516042, "author": null, "avg_line_length": 32.746835443, "converted": null, "ext": "py", "file": null, "hexsha": "14947699a696725d73d94ec543286e4c46bb6f40", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
/*!@file * @copyright This code is licensed under the 3-clause BSD license. * Copyright ETH Zurich, Laboratory of Physical Chemistry, Reiher Group. * See LICENSE.txt for details. */ #define BOOST_FILESYSTEM_NO_DEPRECATED #include "boost/filesystem.hpp" #include "boost/program_options.hpp" #include "Molassemb...
{ "alphanum_fraction": 0.6278498772, "author": null, "avg_line_length": 29.8534031414, "converted": null, "ext": "cpp", "file": null, "hexsha": "e6a2b2a6cbe22c5a4a567a67c051bd9bb27b2bf1", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
from PIL import Image from OpenGL.GL import * import numpy as np class Number: _digit_textures = [None] * 10 _digit_to_path = [ './assets/digit_0.png', './assets/digit_1.png', './assets/digit_2.png', './assets/digit_3.png', './assets/digit_4.png', './assets/digit...
{ "alphanum_fraction": 0.5874363328, "author": null, "avg_line_length": 31, "converted": null, "ext": "py", "file": null, "hexsha": "c311205fe3b81d18b0a46f8b7229c602df7aeca8", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": ...
from __builtin__ import sorted from docopt import docopt import numpy as np from representations.representation_factory import create_representation def main(): args = docopt(""" Usage: analogy_eval.py [options] <representation> <representation_path> <task_path> Options: ...
{ "alphanum_fraction": 0.6087503143, "author": null, "avg_line_length": 32.3333333333, "converted": null, "ext": "py", "file": null, "hexsha": "f66c258aa87f093e88eef1c58582531cd7345567", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
------------------------------------------------------------------------ -- Brandt and Henglein's subterm relation ------------------------------------------------------------------------ module RecursiveTypes.Subterm where open import Algebra open import Data.Fin using (Fin; zero; suc; lift) open import Data.Nat ope...
{ "alphanum_fraction": 0.3758508663, "author": null, "avg_line_length": 41.0412698413, "converted": null, "ext": "agda", "file": null, "hexsha": "3b87b4754f644efb711ebc79a1720ef32acbf912", "include": null, "lang": "Agda", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# # Copyright (c) 2020. Asutosh Nayak (nayak.asutosh@ymail.com) # # 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 # import os import re from ...
{ "alphanum_fraction": 0.607804878, "author": null, "avg_line_length": 39.8952095808, "converted": null, "ext": "py", "file": null, "hexsha": "1cc4b42f90fc8deade2c6c5e865b3387bb0b5013", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import logging import os import numpy as np import tensorflow as tf from cleverhans.attacks import CarliniWagnerL2 from cleverhans.compat import flags from cleverhans.dataset import MNIST from cleverhans.loss import CrossEntropy from cleverhans.utils import grid_visual, AccuracyReport from cleverhans.utils import set_...
{ "alphanum_fraction": 0.6389314276, "author": null, "avg_line_length": 36.73125, "converted": null, "ext": "py", "file": null, "hexsha": "1949466bf055f1183ddee54213a041256af1a4aa", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_co...
# coding: utf-8 # In[177]: import os import pandas as pd get_ipython().run_line_magic('matplotlib', 'inline') import numpy as np import matplotlib.pyplot as plt import hashlib import sklearn as sk import os # In[178]: path = '/home/catherinej/Downloads' file = os.path.join(path, 'IrmaMudThicknessComparisons.xls...
{ "alphanum_fraction": 0.6833862014, "author": null, "avg_line_length": 19.1787072243, "converted": null, "ext": "py", "file": null, "hexsha": "54f7982bc8fa2f112eb115dd58d77420bdf09aeb", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Module of utility methods. """ import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import re import os import sys import time import pickle import random import scipy.sparse import numpy as np import pandas as pd import xgboost as xgb import lightgbm as lgb import termcolor import sklearn.metric...
{ "alphanum_fraction": 0.5509617036, "author": null, "avg_line_length": 39.4779661017, "converted": null, "ext": "py", "file": null, "hexsha": "be2993ba8f3a7c04da9a31a3a3a47d7341c97599", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import wikipedia from wordcloud import WordCloud, STOPWORDS import os from PIL import Image import numpy as np #currdir = os.path.dirname(__file__) def get_wiki(query): title = wikipedia.search(query)[0] page = wikipedia.page(title) return page.content def create_wordcloud(text): stopwords = set(STOPW...
{ "alphanum_fraction": 0.6717948718, "author": null, "avg_line_length": 26.5909090909, "converted": null, "ext": "py", "file": null, "hexsha": "ac52d9c6ee61f60343fee15ae0e80eebfdb525a9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- """ Created on Tue Sep 3 15:30:41 2019 @author: autol """ #%% from depends import ScaleX from matrix_fun import Fill,Frob2,obj1,obj2,svdk,svd_,Prox,Frob1 import numpy as np import time from init_matrix import init_A1,init_A2,init_A3,init_A4 from sklearn.model_selection import ParameterGrid fr...
{ "alphanum_fraction": 0.4930041152, "author": null, "avg_line_length": 34.1292134831, "converted": null, "ext": "py", "file": null, "hexsha": "3dbcacbaf3aa15adda77e4270cc72bd5264fc2bb", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np from brl_gym.estimators.bayes_doors_estimator import BayesDoorsEstimator #, LearnableDoorsBF from brl_gym.envs.mujoco.doors import DoorsEnv from brl_gym.envs.mujoco.doors_slow import DoorsSlowEnv from brl_gym.wrapper_envs.explicit_bayes_env import ExplicitBayesEnv from brl_gym.wrapper_envs.env_sample...
{ "alphanum_fraction": 0.58262027, "author": null, "avg_line_length": 33.9290322581, "converted": null, "ext": "py", "file": null, "hexsha": "b9fcceb0c093f6c3ef29153b05f631d3ad76d719", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import os import sys #dir_path = os.path.dirname(os.path.realpath(__file__)) dir_path = "/Users/neda/HiCPlus_pytorch/src" import numpy as np import argparse import cooler import matplotlib.pyplot as plt import matplotlib.backends.backend_pdf import torch from torch.autograd import Variable from scipy.stats.stats import...
{ "alphanum_fraction": 0.7412610804, "author": null, "avg_line_length": 45.641221374, "converted": null, "ext": "py", "file": null, "hexsha": "b7de74a060b860a9c5dca45449a8295571c64845", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
from netCDF4 import Dataset import numpy as np import matplotlib.pyplot as plt import math import matplotlib as mpl #------------------------------------------------------------------------------- def strain_stress_divergence_hist(): # grid fileGrid = Dataset("grid.40962.nc","r") nVertices = len(fileGri...
{ "alphanum_fraction": 0.7053917766, "author": null, "avg_line_length": 36.0559440559, "converted": null, "ext": "py", "file": null, "hexsha": "e1ba8c7e9085ba06c80c33a208e6cf3eaec6ba4d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma binomial_absorb_comp: "(n - k) * (n choose k) = n * ((n - 1) choose k)" (is "?lhs = ?rhs") [PROOF STATE] proof (prove) goal (1 subgoal): 1. (n - k) * (n choose k) = n * (n - 1 choose k) [PROOF STEP] proof (cases "n \<le> k") [PROOF STATE] proof (state) goal (2 subgoals): 1. n \<le> k \<Longrightar...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": 23, "llama_tokens": 1931, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_datetime":...
import numpy as np import matplotlib.pyplot as plt # For drift ''' for test in range(0,330): # Removing anomalies. if test not in [19,80,282,310]: # Loading data. data = np.load(f'D:/RLBot/ViliamVadocz/TestBot/data/test_{test:03}.npy') # Selection position data. pos = data[0] ...
{ "alphanum_fraction": 0.6062618596, "author": null, "avg_line_length": 25.7073170732, "converted": null, "ext": "py", "file": null, "hexsha": "28a23090316a6dcfdf4fce228e4f37602782dc78", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
// Copyright (C) 2004-2008 The Trustees of Indiana University. // Use, modification and distribution is 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) // Authors: Douglas Gregor // Andrew Lumsdaine #include <...
{ "alphanum_fraction": 0.6567745285, "author": null, "avg_line_length": 32.4662921348, "converted": null, "ext": "cpp", "file": null, "hexsha": "d1aae740eac4572f2947925ff7e6df26d303ddf2", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
#include <iostream> #include <vector> #include <functional> #include <cmath> #include <Eigen/Dense> #include "Derivative.h" using Eigen::MatrixXd; using Eigen::VectorXd; using Eigen::Derivative; using std::function; using std::vector; typedef function<double(VectorXd)> FuncDV; typedef function<VectorXd(VectorXd)> ...
{ "alphanum_fraction": 0.5461144321, "author": null, "avg_line_length": 30.1545064378, "converted": null, "ext": "cpp", "file": null, "hexsha": "55ee171f3727f76c71ad3e290159f3a536dca781", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
[STATEMENT] lemma reflexive: fixes P :: pi shows "P \<sim>\<^sup>s P" [PROOF STATE] proof (prove) goal (1 subgoal): 1. P \<sim>\<^sup>s P [PROOF STEP] by(force simp add: substClosed_def intro: Strong_Early_Bisim.reflexive)
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Pi_Calculus_Strong_Early_Bisim_Subst", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 100, "mathlib_filename": null, "max_forks_count": null, "max_forks...
import ctypes import glob import logging import logging.config import os import shutil from pathlib import Path import numpy as np import pandas as pd from invoke import task logging.config.fileConfig("logging.ini") logger = logging.getLogger(__name__) DEFAULT_SIM_DATADIR = os.getenv("SIM_DATADIR", "data") DEFAULT_T...
{ "alphanum_fraction": 0.6675302245, "author": null, "avg_line_length": 28.5925925926, "converted": null, "ext": "py", "file": null, "hexsha": "f4da9666b635695a66392389db215975b020542b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
Require Import Kami.AllNotations. Require Import StdLibKami.Fifo.Ifc. Require Import StdLibKami.GenericFifo.Ifc. Section Spec. Context {ifcParams : Fifo.Ifc.Params}. Class Params := {fifo : @Fifo.Ifc.Ifc ifcParams; genericFifo : @GenericFifo.Ifc.Ifc (GenericFifo.Ifc.Build_Params ...
{ "alphanum_fraction": null, "author": "sifive", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_date...
import os, sys import random import itertools import collections import ast import os.path as osp import math import multiprocessing import numpy as np class AttrDict(dict): __getattr__ = dict.__getitem__ __setattr__ = dict.__setitem__ def deep_update(source, target): for k, v in target.items(): ...
{ "alphanum_fraction": 0.5442145794, "author": null, "avg_line_length": 31.4640657084, "converted": null, "ext": "py", "file": null, "hexsha": "6a2f862a3a901e4cbda79128c786fa5aa5b8712c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import cv2 import sys import torch import numpy as np import pydicom import os.path as osp from copy import deepcopy import torch.nn.functional as F sys.path.insert(0, ".") #from ct_iterator import C...
{ "alphanum_fraction": 0.6268328446, "author": null, "avg_line_length": 38.2429906542, "converted": null, "ext": "py", "file": null, "hexsha": "5185449cf141576abcd180c76a2fb5e2e6b26686", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#ifndef READ_PCAP_HPP #define READ_PCAP_HPP #define DETAIL_TIMING #include <ParallelPcap/Pcap.hpp> #include <ParallelPcap/Util.hpp> #include <ParallelPcap/CountDictionary.hpp> #include <boost/program_options.hpp> #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/file...
{ "alphanum_fraction": 0.6605436398, "author": null, "avg_line_length": 35.2734082397, "converted": null, "ext": "hpp", "file": null, "hexsha": "2c2f851bd526ca666541a80f66ca7a4c8bcda970", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import numpy as np import matplotlib.pyplot as plt # 42. Ten pregnant women were given an injection of pitocin to induce labor. Their # systolic blood pressures immediately before and after the injection were: before = [134, 122, 132, 130, 128, 140, 118, 127, 125, 142] after = [140, 130, 135, 126, 134, 138, 124, 126...
{ "alphanum_fraction": 0.7298672969, "author": null, "avg_line_length": 33.3393939394, "converted": null, "ext": "py", "file": null, "hexsha": "9bf2a9310772eb38be4bafbc537bed6b96cc2464", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import pandas as pd import torch import torch.nn.functional import tqdm.auto as tqdm from torch import nn def _default_age_embedder(num_hidden, num_factors): return nn.Sequential( nn.utils.weight_norm(nn.Linear(1, num_hidden)), nn.LeakyReLU(0.3), nn.utils.weight_norm(nn....
{ "alphanum_fraction": 0.604494382, "author": null, "avg_line_length": 35.0606060606, "converted": null, "ext": "py", "file": null, "hexsha": "eff4696d57c86ef7fb73bcca4431811ec6b4495e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
/- Copyright (c) 2018 Kenny Lau. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kenny Lau, Chris Hughes, Mario Carneiro -/ import algebra.associated import linear_algebra.basic import order.zorn import order.atoms import order.compactly_generated import tactic.abel imp...
{ "alphanum_fraction": null, "author": "Mel-TunaRoll", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_ma...
!c*************************************************************** subroutine test1(accessor1,accessor2,width1,width2,test) implicit none !c PARAMETER STATEMENTS: integer*8 accessor1,accessor2 integer width1,width2,i,j,k,test,eofFlag complex*8, allocatable :: data1(:) real*4,...
{ "alphanum_fraction": 0.4852824185, "author": null, "avg_line_length": 24.1730769231, "converted": null, "ext": "f90", "file": null, "hexsha": "4a82640add38096cdbe13f389171f7b03835466e", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
""" Bit Plane Slicing """ import cv2 import numpy as np import matplotlib.pyplot as plt def bit_plane_slicing(img_file, plane_level): img = cv2.imread(img_file, 0) plane_level = 1 transformed_img = np.zeros(shape=img.shape) height, width = img.shape for slice_factor in range(8): for y in range(height): ...
{ "alphanum_fraction": 0.6844444444, "author": null, "avg_line_length": 24.1071428571, "converted": null, "ext": "py", "file": null, "hexsha": "233bea65ba7dfe4e62c8a6ffe042d876656620fc", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Functions for converting between data formats """ from typing import Optional import numpy as np import pandas as pd from .checks import ( is_flat_dataset, is_sklearn_dataset, is_stacked_dataset, is_timeseries_dataset, ) from .exceptions import TimekeepCheckError def convert_timeseries_input(fun...
{ "alphanum_fraction": 0.5820647931, "author": null, "avg_line_length": 26.7571801567, "converted": null, "ext": "py", "file": null, "hexsha": "7e9d59c6a985e9009db98d31888cb95a74cc361c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
\chapter{Undocumented Facilities} Ns is often growing to include new protocols. Unfortunately the documention doesn't grow quite as often. This section lists what remains to be documented, or what needs to be improved. (The documentation is in the doc subdirectory of the ns source code if you want to add to it. ...
{ "alphanum_fraction": 0.6546029515, "author": null, "avg_line_length": 27.9019607843, "converted": null, "ext": "tex", "file": null, "hexsha": "d2f68dc8f8cae951dbf8425afdb52a7814757f7b", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# # Test does not work on some cards. # import threading try: from Queue import Queue # Python 2 except: from queue import Queue # Python 3 import numpy as np from numba import cuda from numba.cuda.testing import unittest, CUDATestCase def newthread(exception_queue): try: cuda.select_device(0) ...
{ "alphanum_fraction": 0.6234269119, "author": null, "avg_line_length": 22.4565217391, "converted": null, "ext": "py", "file": null, "hexsha": "8aa68755a3b62f3243bbf3ee486db1a757b840bd", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" This code is modified from Hengyuan Hu's repository. https://github.com/hengyuan-hu/bottom-up-attention-vqa """ from __future__ import print_function import _pickle as cPickle import os import json import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore",category=FutureWarning) impor...
{ "alphanum_fraction": 0.5893555693, "author": null, "avg_line_length": 38.5476190476, "converted": null, "ext": "py", "file": null, "hexsha": "43e018cdd438294a05f7e1e87dcfc859cbc67df2", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#encoding=utf8 from __future__ import print_function import os import six import ast import copy import numpy as np import paddle.fluid as fluid class Placeholder(object): def __init__(self): self.shapes = [] self.dtypes = [] self.lod_levels = [] self.names = [] def __init...
{ "alphanum_fraction": 0.6107561235, "author": null, "avg_line_length": 25.7260273973, "converted": null, "ext": "py", "file": null, "hexsha": "e835038ee257d08f64b849855b30a0e9cd3d262b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import matplotlib.pyplot as plt import scipy.optimize as optimize import sys from termcolor import colored def line(x,a,x0) : return a*x+x0 def texsci(number): return "\\num{{{0:.2e}}}".format(number) if __name__ == "__main__": if(len(sys.argv) < 2) : binfile = './data.csv' ...
{ "alphanum_fraction": 0.5632267442, "author": null, "avg_line_length": 31.2727272727, "converted": null, "ext": "py", "file": null, "hexsha": "3ba8dce8b69b4051e259122965c9c3b0d77c7d42", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from typing import Dict from rastervision.core.data.raster_transformer.raster_transformer \ import RasterTransformer import numpy as np # noqa class ReclassTransformer(RasterTransformer): """Reclassifies label raster """ def __init__(self, mapping: Dict[int, int]): """Construct a new Reclas...
{ "alphanum_fraction": 0.6161016949, "author": null, "avg_line_length": 28.0952380952, "converted": null, "ext": "py", "file": null, "hexsha": "0431e7179380216d53c24d89f53b1c684131f9d9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...