text
stringlengths
0
27.1M
meta
dict
from sympy import symbols, Mul, sin, Integral, oo, Eq, Sum, sqrt, exp, pi, Dummy from sympy.core.expr import unchanged from sympy.stats import (Normal, Poisson, variance, Covariance, Variance, Probability, Expectation, Moment, CentralMoment) from sympy.stats.rv import probability, expectation ...
{ "alphanum_fraction": 0.5824248431, "author": null, "avg_line_length": 54.0535714286, "converted": null, "ext": "py", "file": null, "hexsha": "1dc1d9cff0f351565a45353513930cbceba374ae", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
function fill_wavelets!(iss::Int64, wavelets::Array{Array{Float64,2},2}, srcwav::Array{SrcWav}, sflags::Vector{Int64}) npw = size(wavelets,1) nt = size(wavelets,2) δt = step(srcwav[1][1].grid) for ipw=1:npw ns, snfield = size(wavelets[ipw,1]) # ns may vary with ipw for ifield=1:snfield, is=1:ns snt = lengt...
{ "alphanum_fraction": 0.6467326733, "author": null, "avg_line_length": 30.421686747, "converted": null, "ext": "jl", "file": null, "hexsha": "65f831b9cdc6f61e2f73aabfbcb6fba253682300", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# -*- coding: utf-8 -*- import sys import subprocess import time from tempfile import NamedTemporaryFile import toml import asteval import tqdm import os from collections import deque import numpy as np from collections import namedtuple import itertools import h5py import Geant4 as g4 from Geant4.hepunit import * cla...
{ "alphanum_fraction": 0.5389572349, "author": null, "avg_line_length": 35.9368421053, "converted": null, "ext": "py", "file": null, "hexsha": "7534ace62b277d577f172bb93af76b86bd483af0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# # Arbitrary Precision # # COSMO allows you to solve problems with arbitrary floating-point precision, e.g. by using `BigFloat` problem data. To do this, the desired floating point type has to be consistent across the model `COSMO.Model{<: AbstractFloat}`, the input data and the (optional) settings object `COSMO.Setti...
{ "alphanum_fraction": 0.7198832847, "author": null, "avg_line_length": 57.119047619, "converted": null, "ext": "jl", "file": null, "hexsha": "5cae23c31d0349502e53adcba4aeb53bc1fb4414", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import sys sys.path.insert(0,'./') from argparse import ArgumentParser import pytorch_lightning as pl import json from typing import Iterator, List, Dict, Optional import torch import torch.optim as optim import torch.nn.functional as F import numpy as np # for dataset reader from allennlp.data.data_loaders import M...
{ "alphanum_fraction": 0.6579667823, "author": null, "avg_line_length": 43.1417322835, "converted": null, "ext": "py", "file": null, "hexsha": "410bcef59196b7e6d021fca4308484ff01c5d354", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
! Copyright (c) 2019, ARM Ltd. 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 applicable law o...
{ "alphanum_fraction": 0.7315936626, "author": null, "avg_line_length": 37, "converted": null, "ext": "f90", "file": null, "hexsha": "3cad73ef6f63112ba5e1245413760761582a1163", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
from __future__ import print_function # Example of a *very* simple variabiilty metric # krughoff@uw.edu, ebellm, ljones import numpy as np from scipy.signal import lombscargle from rubin_sim.maf.metrics import BaseMetric __all__ = ['PeriodDeviationMetric'] def find_period_LS(times, mags, minperiod=2., maxperiod=35...
{ "alphanum_fraction": 0.655549054, "author": null, "avg_line_length": 41.016, "converted": null, "ext": "py", "file": null, "hexsha": "382701575566928ea10b01b3e992d35b72e20a0b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
import torch import math import numpy as np from .random_fields import GaussianRF from timeit import default_timer import argparse class KolmogorovFlow2d(object): def __init__(self, w0, Re, n): # Grid size self.s = w0.size()[-1] assert self.s == w0.size()[-2], "Grid must be uniform in...
{ "alphanum_fraction": 0.5538141692, "author": null, "avg_line_length": 31.5808080808, "converted": null, "ext": "py", "file": null, "hexsha": "b18a371f123e204c7255a986879978ee628cdb45", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- """ Created on Mon Mar 16 11:02:22 2020 @author: sopmathieu This file contains different functions to compute and analyze the autocorrelation of time-series that may contain missing values. These functions compute the autocorrelation and the autocovariance of a series at a desired lag. They ...
{ "alphanum_fraction": 0.5879042832, "author": null, "avg_line_length": 36.1739130435, "converted": null, "ext": "py", "file": null, "hexsha": "3641711d513a536cb75a18a0ace06de75948b751", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np def pad_images_similar(img1, img2): list_of_images = [img1, img2] padded_list = [] a = 0 b = 0 for image in list_of_images: x, y = image.shape if x > a: a = x if y > b: b = y for image in list_of_images: nuc_a, nuc_b ...
{ "alphanum_fraction": 0.5, "author": null, "avg_line_length": 26, "converted": null, "ext": "py", "file": null, "hexsha": "094b5533ab9510b7bb69dc2709c0409f85abca45", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "...
# make_experiments.py # Author: Noam Buckman # Description: Generate Simulation Settings # This Notebook generates and saves multiple experiment savings for # analyzing the effects of different parameters. # The settings can be varied by % human (non-communicating) vehicles and SVO type. # Output: Multiple Pickle (.p...
{ "alphanum_fraction": 0.765578635, "author": null, "avg_line_length": 48.5075757576, "converted": null, "ext": "py", "file": null, "hexsha": "2e70046045b9553066d6adeb18cde0273c8558d0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
""" External indices """ import numpy as np from sklearn.metrics.cluster.supervised import check_clusterings from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.metrics import accuracy_score from scipy.sparse import csr_matrix from scipy.sparse.csgraph import connected_components def _conting...
{ "alphanum_fraction": 0.6245939675, "author": null, "avg_line_length": 28.7333333333, "converted": null, "ext": "py", "file": null, "hexsha": "3a0840d58aea546b29529869f4abbeab439af444", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Tests for telescope objects and functions. """ import os from astropy.coordinates import EarthLocation import numpy as np import pytest import pyuvdata from pyuvdata.data import DAT...
{ "alphanum_fraction": 0.6629559856, "author": null, "avg_line_length": 29.6395939086, "converted": null, "ext": "py", "file": null, "hexsha": "bc2654a4c348d836db6d4d1f85ab2dae665fe8e8", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
module Ch05.VarArg import Data.Vect -------------------------------------------------------------------------------- -- Auxillary stuff for defining functions with a variable # of args -------------------------------------------------------------------------------- ||| Type of vectors of fixed length of elements of ...
{ "alphanum_fraction": 0.4707050645, "author": null, "avg_line_length": 27.9722222222, "converted": null, "ext": "idr", "file": null, "hexsha": "de6cff6672d0d1dd30180793ae863f6f412ed632", "include": null, "lang": "Idris", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from __future__ import division from numpy import * from interpolation.cartesian import mlinspace d = 2 # number of dimension Ng = 1000 # number of points on the grid K = int(Ng**(1/d)) # nb of points in each dimension N = 10000 # nb of points to evaluate a = array([0.0]*d, dtype=fl...
{ "alphanum_fraction": 0.6888708367, "author": null, "avg_line_length": 24.137254902, "converted": null, "ext": "py", "file": null, "hexsha": "b268b5a428aea729192391f13f50ab8d9dda9acb", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#this is a python script that calls a c++ excutable import time import numpy as np import subprocess import os def generate_embedding(norb,nimp,u,afm): ''' Generate the 1-body embedding Hamiltonian. ''' tmpdir = "/home/sunchong/work/finiteTMPS/tests/call/dump/" impsite = np.arange(nimp)+1 np.s...
{ "alphanum_fraction": 0.5548698168, "author": null, "avg_line_length": 28.6464088398, "converted": null, "ext": "py", "file": null, "hexsha": "837f59c23342b5bb7e7496caf11e120c72fe4fda", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Toolbox for statistical methods. For all functions, this toolbox assumes that the first dimension is the temporal sampling dimension. Author: Andre Perkins """ import numpy as np import numexpr as ne import dask.array as da import logging from scipy.linalg import svd from scipy.ndimage import convolve1d from skl...
{ "alphanum_fraction": 0.6367831745, "author": null, "avg_line_length": 30.5972222222, "converted": null, "ext": "py", "file": null, "hexsha": "ec31632a324dd9ddfa5bec955bcb1ce5c43953a4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Optimality conditions Now we will move to studying constrained optimizaton problems i.e., the full problem $$ \begin{align} \ \min \quad &f(x)\\ \text{s.t.} \quad & g_j(x) \geq 0\text{ for all }j=1,\ldots,J\\ & h_k(x) = 0\text{ for all }k=1,\ldots,K\\ &x\in \mathbb R^n. \end{align} $$ In order to identify which poi...
{ "alphanum_fraction": 0.4991351975, "author": null, "avg_line_length": 27.3149606299, "converted": true, "ext": "ipynb", "file": null, "hexsha": "18065e73ab59d14961d9dfefa999f69c56e891ee", "include": null, "lang": "Jupyter Notebook", "length": null, "llama_tokens": null, "mathlib_filename": nul...
""" This module allows detect spots in fluorescence microscopy images. The algorithms are translations of those published in Aguet et al. Dev. Cell 2013. Refer to that publication and corresponding code for detailed information. """ # Author: Guillaume Witz, Biozentrum Basel, 2019 # License: MIT License import numpy...
{ "alphanum_fraction": 0.5975107371, "author": null, "avg_line_length": 36.4504792332, "converted": null, "ext": "py", "file": null, "hexsha": "9bbb0d6688c0cae441b758d0dc72211351eb3335", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import sys import numpy as np import cv2 filename = 'space_shuttle.jpg' if len(sys.argv) > 1: filename = sys.argv[1] img = cv2.imread(filename) if img is None: print('Image load failed!') exit() # Load network net = cv2.dnn.readNet('bvlc_googlenet.caffemodel', 'deploy.prototxt') ...
{ "alphanum_fraction": 0.6441176471, "author": null, "avg_line_length": 20.8163265306, "converted": null, "ext": "py", "file": null, "hexsha": "4f8bb0ad1216bdedadfceb59102e8f2b13009604", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from __future__ import annotations from typing import Tuple, NoReturn from ...base import BaseEstimator import numpy as np from itertools import product from IMLearn.metrics.loss_functions import misclassification_error class DecisionStump(BaseEstimator): """ A decision stump classifier for {-1,1} labels acco...
{ "alphanum_fraction": 0.5862369338, "author": null, "avg_line_length": 32.5673758865, "converted": null, "ext": "py", "file": null, "hexsha": "a15d3cbbefa91da6d061bf0453bc1a96d6fa0a52", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import re import numpy as np def write_point_cloud(ply_filename, points): formatted_points = [] for point in points: formatted_points.append("%f %f %f %d %d %d 0\n" % (point[0], point[1], point[2], point[3], point[4], point[5])) out_file = open(ply_filename, "w") out_file.write('''ply fo...
{ "alphanum_fraction": 0.5732038835, "author": null, "avg_line_length": 23.623853211, "converted": null, "ext": "py", "file": null, "hexsha": "2af2a0846909b8b216d5f95a6284cd5f6684e78f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#!/usr/bin/env python import numpy as np import rospy from minau.srv import ArmControl, SetHeadingVelocity, SetHeadingDepth from geometry_msgs.msg import Vector3 from minau.msg import ControlStatus from sensor_msgs.msg import Joy # def vel(heading,speed): # heading_rad = heading*np.pi/180 # return Vector3(spee...
{ "alphanum_fraction": 0.5649458784, "author": null, "avg_line_length": 33.8309859155, "converted": null, "ext": "py", "file": null, "hexsha": "b9c87dd5e961651edafa64ac76894effda7858bd", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import tensorflow as tf from tensorflow import distributions import numpy as np def evaluate_sample(model, data_sample, session): """ Samples parameter realizations from the variational posterior distributions and performs inference Args: model: the model to evaluate data_iterat...
{ "alphanum_fraction": 0.5822102426, "author": null, "avg_line_length": 33.223880597, "converted": null, "ext": "py", "file": null, "hexsha": "ec7a2c978b5250d16c806e53276c3a030d21ace0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# -*- coding: utf-8 -*- """ Created on Tue May 17 15:50:25 2016 @author: hossam """ from pathlib import Path import optimizers.PSO as pso import optimizers.MVO as mvo import optimizers.GWO as gwo import optimizers.MFO as mfo import optimizers.CS as cs import optimizers.BAT as bat import optimizers.WOA as woa import op...
{ "alphanum_fraction": 0.6256564141, "author": null, "avg_line_length": 38.0857142857, "converted": null, "ext": "py", "file": null, "hexsha": "866dc0a1cd3ff270f986994530347a801f7b3781", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
function [texture structure] = structure_texture_decomposition_rof(im, theta, nIters, alp) % % Decompose the input IMAGE into structure and texture parts using the % Rudin-Osher-Fatemi method. The final output is a linear combination % of the decomposed texture and the structure parts. % % According to Wedel etal "An ...
{ "alphanum_fraction": null, "author": "kristinbranson", "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_...
import pandas as pd import statsmodels.api as sm from patsy import dmatrices from statsmodels.stats.outliers_influence import variance_inflation_factor def vif(df, y, x, merge_coef = False): import scorecardpy as sc df = sc.germancredit() y = 'creditability' x = ['age_in_years', 'credit_amount', 'present_resid...
{ "alphanum_fraction": 0.6472545757, "author": null, "avg_line_length": 31.3565217391, "converted": null, "ext": "py", "file": null, "hexsha": "3af5b91bd48219414ca844d488c124159bbccfa6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np # Calculating the time needed for task i when allocated in DC j def dijstra(G, src, des): '''Find the shortest path lenght from src to des Args: G: A graph representing the network src: The source node des: The destination node Returns: The length ...
{ "alphanum_fraction": 0.5405904059, "author": null, "avg_line_length": 27.7948717949, "converted": null, "ext": "py", "file": null, "hexsha": "3da27298c0e967134ed82191a47bc42f3dc9456d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import sys import subprocess from SALib.test_functions import Ishigami import numpy as np import re salib_cli = "./src/SALib/scripts/salib.py" ishigami_fp = "./src/SALib/test_functions/params/Ishigami.txt" if sys.version_info[0] == 2: subprocess.run = subprocess.call def test_delta(): cmd = "python {cli} sa...
{ "alphanum_fraction": 0.6566101256, "author": null, "avg_line_length": 38.4228855721, "converted": null, "ext": "py", "file": null, "hexsha": "1c428aad04470cc050f9150015da22fd25145f7a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# import libraries here import numpy as np import cv2 def count_blood_cells(image_path): """ Procedura prima putanju do fotografije i vraca broj crvenih krvnih zrnaca, belih krvnih zrnaca i informaciju da li pacijent ima leukemiju ili ne, na osnovu odnosa broja krvnih zrnaca Ova procedura se poziva a...
{ "alphanum_fraction": 0.7019553073, "author": null, "avg_line_length": 52.6470588235, "converted": null, "ext": "py", "file": null, "hexsha": "939799d7dadecc300efbd446476d62f629517391", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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...
{ "alphanum_fraction": 0.6401762115, "author": null, "avg_line_length": 37.3355263158, "converted": null, "ext": "py", "file": null, "hexsha": "10705ae41c7a6275da84b4f2b43b28d9f09b983a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import traces.PyTrace as PT import numpy as np import traces.conicsolve as con import pdb,sys from traces.axro.WSverify import traceChaseParam import matplotlib.pyplot as plt import time import utilities.plotting as uplt #Need to determine resolution and effective area #as a function of shell radius #Loop through all ...
{ "alphanum_fraction": 0.5613132338, "author": null, "avg_line_length": 37.5967302452, "converted": null, "ext": "py", "file": null, "hexsha": "1675dce23e5331b3855dabdffc8b8b02a3ada5b4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Plot test files of the forcings Notes ----- Reference : Kay et al. [2014] Author : Zachary Labe Date : 1 February 2018 """ ### Import modules import numpy as np from netCDF4 import Dataset import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap import nclcmaps as ncm import datetime...
{ "alphanum_fraction": 0.6420682731, "author": null, "avg_line_length": 28.4571428571, "converted": null, "ext": "py", "file": null, "hexsha": "6c509fb8920a9c5ea7e125c43aa6c64caf88db50", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import csv import sys import re from surprise import Dataset from surprise import Reader from collections import defaultdict import numpy as np class Load_Data: # These two dictionaries will be used to fetch id from movieName and vice versa. movieID_to_name = {} name_to_movieID = {} # de...
{ "alphanum_fraction": 0.5611558036, "author": null, "avg_line_length": 33.6519337017, "converted": null, "ext": "py", "file": null, "hexsha": "39dfe61ad92b6d66293fcdbd3a23043358782c03", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/* Copyright (C) 2014 InfiniDB, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but W...
{ "alphanum_fraction": 0.5384113734, "author": null, "avg_line_length": 26.4379310345, "converted": null, "ext": "cpp", "file": null, "hexsha": "7b16af9d54f2789bda1fa57ba5d58d558aaa3e04", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
\chapter{{\tt ILUMtx}: Incomplete $LU$ Matrix Object} \label{chapter:ILUMtx} \par The {\tt ILUMtx} object represents and approximate (incomplete) $(L+I)D(I+U)$, $(U^T+I)D(I+U)$ or $(U^H+I)D(I+U)$ factorization. It is a very simple object, rows and columns of $L$ and $U$ are stored as single vectors. All computations ...
{ "alphanum_fraction": 0.7275223061, "author": null, "avg_line_length": 41.6285714286, "converted": null, "ext": "tex", "file": null, "hexsha": "75e6d9c881d78229ef89d723fdb94a273c882d19", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
from __future__ import absolute_import, division, print_function, unicode_literals import glob import os import numpy as np import argparse import json import torch from scipy.io.wavfile import write from env import AttrDict from meldataset import MAX_WAV_VALUE from models import Generator from time import time h = N...
{ "alphanum_fraction": 0.6678214011, "author": null, "avg_line_length": 27.6382978723, "converted": null, "ext": "py", "file": null, "hexsha": "d99f146b8152df0a30f14afa3a9e06067ed8521c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
'''This module contains all functions needed for the fully handmade neural network, as well as the model class itself''' #import pandas as pd import numpy as np import seaborn as sns #from progressbar.bar import ProgressBar ## Functions def compute_activation (X, activation_type): '''Defining activation function...
{ "alphanum_fraction": 0.5989200095, "author": null, "avg_line_length": 39.4660421546, "converted": null, "ext": "py", "file": null, "hexsha": "190b43ce92ce85f169fa021de133b5c79034758d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma irreflexiveDecisionLess: shows "(x, x) \<notin> decisionLess" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (x, x) \<notin> decisionLess [PROOF STEP] unfolding decisionLess_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. (x, x) \<notin> {(l1, l2). isDecision l1 \<and> \<not> isDecision l2}...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "SATSolverVerification_SatSolverVerification", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 150, "mathlib_filename": null, "max_forks_count": null, "ma...
"""Locator functions to interact with geographic data""" import numpy as np import pandas as pd import flood_tool.geo as geo __all__ = ['Tool'] def clean_postcodes(postcodes): """ Takes list or array of postcodes, and returns it in a cleaned numpy array """ postcode_df = pd.DataFrame({'Postcode':post...
{ "alphanum_fraction": 0.6209789071, "author": null, "avg_line_length": 40.2590163934, "converted": null, "ext": "py", "file": null, "hexsha": "4072cb968c1fe7cb9e4bc5fed16ae082a9179243", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np from operator import itemgetter from scipy.linalg import cholesky, cho_solve from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.base import clone from sklearn.utils import check_random_state from sklearn.utils.optimize import _check_optimize_result from .kernels import RBF, Wh...
{ "alphanum_fraction": 0.5316471015, "author": null, "avg_line_length": 44.6648648649, "converted": null, "ext": "py", "file": null, "hexsha": "85235ae80ec0a24fe581cc88e7b553232cc4aae4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
(* Title: HOL/Algebra/Lattice.thy Author: Clemens Ballarin, started 7 November 2003 Copyright: Clemens Ballarin Most congruence rules by Stephan Hohe. *) theory Lattice imports Congruence begin section \<open>Orders and Lattices\<close> subsection \<open>Partial Orders\<close> record 'a gorder =...
{ "alphanum_fraction": null, "author": "SEL4PROJ", "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_da...
# import numpy as np # import gym # import torch # from typing import Dict, Any # from copy import deepcopy # from malib.algorithm.common.model import MLPCritic # from malib.algorithm.common.policy import Policy # # # class QMIX(Policy): # def __init__( # self, # registered_name: str, # obse...
{ "alphanum_fraction": 0.5638621389, "author": null, "avg_line_length": 34.9203539823, "converted": null, "ext": "py", "file": null, "hexsha": "b599dbea2abcc1ec4fbf5f3e2f587aa9a53a36e5", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/*************************************************************************** * Software License Agreement (BSD License) * * Copyright (C) 2012 by Markus Bader <markus.bader@tuwien.ac.at> * * * * Redistr...
{ "alphanum_fraction": 0.5754671196, "author": null, "avg_line_length": 43.3789473684, "converted": null, "ext": "cpp", "file": null, "hexsha": "43101b0ae11df976c4f2821f837e019a0c5d5c96", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# -*- coding: utf-8 -*- """FFT functions. This module contains FFT functions that support centered operation. """ import numpy as np from sigpy import config, util if config.cupy_enabled: import cupy as cp def fft(input, oshape=None, axes=None, center=True, norm='ortho'): """FFT function that supports cent...
{ "alphanum_fraction": 0.579133958, "author": null, "avg_line_length": 26.5033557047, "converted": null, "ext": "py", "file": null, "hexsha": "40b728357a1cf78ff8c40718d059423c898441aa", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import pygame import numpy as np import random pygame.init() clock = pygame.time.Clock() display = pygame.display.set_mode((1280, 720)) screen = pygame.display.get_surface() width,height = screen.get_width(), screen.get_height() pygame.display.set_caption('water cellular automata') rows = int(height / 8) ...
{ "alphanum_fraction": 0.4778856526, "author": null, "avg_line_length": 47.2356687898, "converted": null, "ext": "py", "file": null, "hexsha": "d75e81163d75de3977ca22c060df2cd22f389eb0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma irreducible\<^sub>dD: assumes "irreducible\<^sub>d p" shows "degree p > 0" "\<And>q r. degree q < degree p \<Longrightarrow> degree r < degree p \<Longrightarrow> p \<noteq> q * r" [PROOF STATE] proof (prove) goal (1 subgoal): 1. 0 < degree p &&& (\<And>q r. \<lbrakk>degree q < degree p; degree r...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Polynomial_Interpolation_Missing_Polynomial", "hexsha": null, "include": null, "lang": null, "length": 3, "llama_tokens": 381, "mathlib_filename": null, "max_forks_count": null, "ma...
#pragma once #include <boost/core/noncopyable.hpp> #include <cstdint> #include <functional> #include <memory> #include <optional> #include <string> #include <utility> namespace koinos::mq { enum class retry_policy { none, exponential_backoff }; enum class error_code : int64_t { success, failure, tim...
{ "alphanum_fraction": 0.6563814867, "author": null, "avg_line_length": 23, "converted": null, "ext": "hpp", "file": null, "hexsha": "c942d35ae099334a2d4cbd52b8f0efee8256ac41", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": nu...
import ipywidgets as widgets from ipywidgets import interact import matplotlib.pyplot as plt import numpy as np def browse_track_multi(img, liste_a, segmentation): nt, ny, nx = img.shape def plot_track(i, save=False, name_img = "file.png"): fig, axes = plt.subplots(1,1, figsize=(8, 8)) axes.ims...
{ "alphanum_fraction": 0.518111639, "author": null, "avg_line_length": 40.0952380952, "converted": null, "ext": "py", "file": null, "hexsha": "17d625fa6aedeb6e21696a88cb29150507bf386e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
from typing import Dict, List, Tuple, Union import numpy as np import torch from torch.nn.utils.rnn import pad_sequence from torch.utils.data import Dataset from .prepare_data import process_labels, process_tokens class NERDataset(Dataset): """ PyTorch Dataset for NER data format. Dataset might be prepr...
{ "alphanum_fraction": 0.6272413793, "author": null, "avg_line_length": 29.5918367347, "converted": null, "ext": "py", "file": null, "hexsha": "e9da54e88b83e52f47838c9103d51ab85b341b40", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import h5py import json import pickle import random import numpy as np from pathlib import Path from sklearn.cluster import MiniBatchKMeans # root path ROOT_PATH = Path(os.path.dirname(__file__)).parent # set seed value SEED = 1234 random.seed(SEED) np.random.seed(SEED) # read data hdf5_data = h5py.File(os...
{ "alphanum_fraction": 0.7310889443, "author": null, "avg_line_length": 30.4556962025, "converted": null, "ext": "py", "file": null, "hexsha": "36676c7fa9ddbde0faa47a463b92f59896de25b1", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/*============================================================================== Copyright (c) 2016 Matt Calabrese 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) ===================================================...
{ "alphanum_fraction": 0.6239205527, "author": null, "avg_line_length": 27.9036144578, "converted": null, "ext": "hpp", "file": null, "hexsha": "7ae8dfe6b8190d338253160962a0e26021a11d08", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
cd("..") run(`bash build.sh`)
{ "alphanum_fraction": 0.5333333333, "author": null, "avg_line_length": 10, "converted": null, "ext": "jl", "file": null, "hexsha": "afd8542cd0e308bb76b90ffef073c96bdb383348", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": n...
import pandas as pd import numpy as np from datetime import datetime df = pd.read_csv('3WLA.txt',sep='\t') epoch = datetime(1980, 1, 1) df["Cardinality TW"] = df["Week-End"].apply(lambda x: (datetime.strptime(x, "%d-%b-%Y")-epoch)) df["Activity CL"] = df["Activity"].apply(lambda x: x.lower().strip().replac...
{ "alphanum_fraction": 0.6445079523, "author": null, "avg_line_length": 51.5897435897, "converted": null, "ext": "py", "file": null, "hexsha": "e547962fcfe7b954e23235e6dff6bbeaa59471aa", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# coding: utf-8 # This notebook will make abundance matched catalogs for Jeremy and Zhongxu. I'm gonna send this notebook along to them as well in case there's something not quite right that they want to adjust. The catalogs requested were defined as follows: # - 2 catalogs, M_peak and V_max @ M_peak (which is how, I...
{ "alphanum_fraction": 0.7110041566, "author": null, "avg_line_length": 34.6287878788, "converted": null, "ext": "py", "file": null, "hexsha": "d1136c40a7258ff48f3e088cc6d4b75ca6ed5909", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import unittest from opentamp.core.internal_repr import parameter from opentamp.core.util_classes import robot_predicates, pr2_predicates, matrix from opentamp.core.util_classes.openrave_body import OpenRAVEBody from errors_exceptions import PredicateException, ParamValidationException from opentamp.core.util_classes.p...
{ "alphanum_fraction": 0.6194574443, "author": null, "avg_line_length": 53.4194915254, "converted": null, "ext": "py", "file": null, "hexsha": "809c6c9dd9ca8d5ea3260ece504d18ac82c6d528", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
PROGRAM exemple USE parlib USE lib IMPLICIT NONE REAL:: more more = addition(a,b) WRITE(*,*) "The result: ", more END PROGRAM
{ "alphanum_fraction": 0.6893939394, "author": null, "avg_line_length": 8.8, "converted": null, "ext": "f90", "file": null, "hexsha": "a6841e174000b0ec07de5da937ba36c06cff614c", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
dir <- "~/workspace/dyn-urg/files/results/time-series-dynamism-experiment/" nonhomogTS <- read.table(paste(dir,"non-homog-poisson-dynamism.csv",sep=""), quote="\"",as.is=T,colClasses=list("numeric")) homogTS <- read.table(paste(dir,"homog-poisson-dynamism.csv",sep=""), quote="\"",as.is=T,colClasses=list("numeric")) n...
{ "alphanum_fraction": 0.6958174905, "author": null, "avg_line_length": 40.4615384615, "converted": null, "ext": "r", "file": null, "hexsha": "3fefeccd56788a041fd5abae13d7ade7eb795c93", "include": null, "lang": "R", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_cou...
import numpy as np class solver: def __init__(self): self.grid= np.ones((9,9,9),dtype=np.uint8) self.Org=None self.isSolved=False self.Error=False def setField(self,x,y,value): if value>0: self.grid[x,y,:]=0 self.grid[x,y,value-1]=1 e...
{ "alphanum_fraction": 0.4351503759, "author": null, "avg_line_length": 28.1647058824, "converted": null, "ext": "py", "file": null, "hexsha": "1584037d21fb63c030f7bf91fe2f6082c9411550", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- """ Generating image window by weighted sampling map from input image This can also be considered as a `weighted random cropping` layer of the input image """ from __future__ import absolute_import, division, print_function import numpy as np import tensorflow as tf from niftynet.engine.image_...
{ "alphanum_fraction": 0.643623523, "author": null, "avg_line_length": 44.0898203593, "converted": null, "ext": "py", "file": null, "hexsha": "6a45aaa181e349ef8861d8bd5a8d357db4312af9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
include("Include.jl") # extra: using Flux using Flux: @epochs using BSON: @save # load training set - full_training_data_frame = load_fibrinolysis_training_data() # filter out the data - experimental_data_table = filter(:visitid => x -> (x == 2 || x == 3 || x == 1), full_training_data_frame) # initialize storage fo...
{ "alphanum_fraction": 0.6895027624, "author": null, "avg_line_length": 28.28125, "converted": null, "ext": "jl", "file": null, "hexsha": "dc7d9b8b486a4b51a631294f6f1ea07d58f1e232", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_cou...
from copy import deepcopy import numpy as np import torch from ..data import FlatTransition from . import OffPolicyAlgorithm from .goal_sampling_strategy import GoalSamplingStrategy class HAC(OffPolicyAlgorithm): """Hierarchical Actor-Critic.""" supported_goal_sampling_strategies = {"future", "episode", "fi...
{ "alphanum_fraction": 0.6073188538, "author": null, "avg_line_length": 53.4536585366, "converted": null, "ext": "py", "file": null, "hexsha": "6d108623d6983ed0cb8b8b04022ba918e5ed1c95", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
using RegexTools using Test @testset "RegexTools.jl" begin @testset "hex_escape" begin for char in Char.(0:126) rawstr = string(char) regstr = RegexTools.hex_escape(rawstr) reg = Regex(regstr) m = match(reg, rawstr) @test !isnoth...
{ "alphanum_fraction": 0.53125, "author": null, "avg_line_length": 19.5555555556, "converted": null, "ext": "jl", "file": null, "hexsha": "c317a1bef3384898c2b74d699e4af1b940852eab", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_cou...
"""Reads a multi-tile CBF image, discovering its detector geometry automatically""" import sys import numpy import pycbf from scitbx.array_family import flex from dxtbx.format.FormatCBF import FormatCBF from dxtbx.format.FormatCBFFull import FormatCBFFull from dxtbx.format.FormatStill import FormatStill from dxtbx...
{ "alphanum_fraction": 0.5857940942, "author": null, "avg_line_length": 32.1282051282, "converted": null, "ext": "py", "file": null, "hexsha": "bf88ebc39840e10e6c6db52c2bfd532e81f43495", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Programmer: Date of Development: This code has been developed according to the procedures mentioned in the following research article: " " """ import numpy as np import time import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn import datasets from Py_FS.wrapper.nat...
{ "alphanum_fraction": 0.56773634, "author": null, "avg_line_length": 40.8865248227, "converted": null, "ext": "py", "file": null, "hexsha": "d2bbab95a6def330ece05589646c4d7d8994cb24", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
*dk,ltripedge function ltripedge(i,iedg,itet,itetoff,itettyp,iparent,jtet, & jtetoff,mbndry,nef_cmo,icr1,icontab) C C C ##################################################################### C C PURPOSE - C C This function is true iff the given edge is determined C to be a triple edge. C C...
{ "alphanum_fraction": 0.5519113323, "author": null, "avg_line_length": 31.3546099291, "converted": null, "ext": "f", "file": null, "hexsha": "f41580eed603c20366cfd460fb4389cf092d0892", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from copper.cop.cop_node import CopNode import pyopencl as cl import numpy from PIL import Image class COP2_Comp_Add(CopNode): ''' This filter adds foreground over background using OpenCL ''' type_name = "add" category = "comps" def __init__(self, engine, parent): super(CLC_Comp_Add, self).__init__(engine, ...
{ "alphanum_fraction": 0.7052117264, "author": null, "avg_line_length": 29.2380952381, "converted": null, "ext": "py", "file": null, "hexsha": "183ad3a9a2ed6c678262c55c0a1cc151b307d671", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
subroutine readopac(fname, f, fx, fy, fxy) c c*********************************************************************** c read opacity tables c*********************************************************************** c include'titan.imp' include'titan.par' include'titan.com' c logical lxst...
{ "alphanum_fraction": 0.4111944966, "author": null, "avg_line_length": 34.3870967742, "converted": null, "ext": "f", "file": null, "hexsha": "a8a2e96348e2f01321554e39177e5f3406e68bb5", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python import rospy from geometry_msgs.msg import Twist, Quaternion #, Point, Pose, TwistWithCovariance, Vector3 import tf import numpy as np def main(): rospy.init_node("sphero_simple_openloop") pub_twist = rospy.Publisher("/cmd_vel", Twist, queue_size=1) T = Twist() r = rospy.Rate(1...
{ "alphanum_fraction": 0.606504065, "author": null, "avg_line_length": 20.5, "converted": null, "ext": "py", "file": null, "hexsha": "d1832f30326d1c59b62289a1d8dd2b90ec32c865", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count":...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from __future__ import print_function import json import torch import numpy as np import random import os os.environ["CUDA_VISIBLE_DEVICES"] = "3" import sys import time import argparse from src.models.m...
{ "alphanum_fraction": 0.6710039087, "author": null, "avg_line_length": 48.368159204, "converted": null, "ext": "py", "file": null, "hexsha": "f68bdac01bed7313ac7e61dca763cbb301d0a1a0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
""" @author: Vincent Bonnet @description : Constraint data structure """ import numpy as np import core.jit.item_utils as item_utils class Constraint: def __init__(self, num_nodes : int): # Constraint Property self.stiffness = np.float64(0.0) self.damping = np.float64(0.0) # Node...
{ "alphanum_fraction": 0.6448291998, "author": null, "avg_line_length": 30.5285714286, "converted": null, "ext": "py", "file": null, "hexsha": "4e81c9e64df56df47a38be8546c656b373078d31", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import sys sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../..') from andi_funcs import TrackGeneratorSegmentation, import_tracks, import_labels, package_tracks from models import segmentation_model_2d from tensorflow.keras.optimizers import Adam from tensorflow.keras.callbacks import Mode...
{ "alphanum_fraction": 0.737037037, "author": null, "avg_line_length": 46.2857142857, "converted": null, "ext": "py", "file": null, "hexsha": "ffaacdf2fc9509d704ff28b0ff5c99e10f559737", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
[STATEMENT] lemma lex_two_SN_order_pair: assumes o1: "SN_order_pair s1 ns1" and o2: "SN_order_pair s2 ns2" shows "SN_order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. SN_order_pair (lex_two s1 ns1 s2) (lex_two s1 ns1 ns2) [PROOF STEP] proof - [PROOF STATE] proof ...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Knuth_Bendix_Order_Lexicographic_Extension", "hexsha": null, "include": null, "lang": null, "length": 14, "llama_tokens": 1216, "mathlib_filename": null, "max_forks_count": null, "m...
[STATEMENT] lemma Substable_intro_diamond[Substable_intros]: assumes "Substable cond \<psi>" shows "Substable cond (\<lambda> \<phi> . \<^bold>\<diamond>(\<psi> \<phi>))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Substable cond (\<lambda>\<phi>. \<^bold>\<diamond>\<psi> \<phi>) [PROOF STEP] unfolding co...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "PLM_TAO_9_PLM", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 196, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_d...
import matplotlib import numpy as np matplotlib.use('Agg') import shap def test_multiply(): """ Basic LSTM example from keras """ try: import keras import numpy as np import tensorflow as tf from keras.datasets import imdb from keras.models import Sequential ...
{ "alphanum_fraction": 0.6710301651, "author": null, "avg_line_length": 36.6041666667, "converted": null, "ext": "py", "file": null, "hexsha": "5b4513e0cd38d45faff90814be0c0a516a3358a0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from .enums import CitySize, AreaKind import numpy as np class OkumuraHata: def __init__( self, frequency, transmitter_height, receiver_height, city_size, area_kind, ): self.frequency = frequency self.transmitter_height = transmitter_height self.receiver_height = ...
{ "alphanum_fraction": 0.7001469868, "author": null, "avg_line_length": 37.1090909091, "converted": null, "ext": "py", "file": null, "hexsha": "176666c2c3b2a4b220958ac4332993594c6ba494", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/////////////////////////////////////////// // http://progsch.net/wordpress/?p=81 #include <boost/thread.hpp> #include <deque> class ThreadPool; // our worker thread objects class Worker { public: Worker(ThreadPool &s) : pool(s) { } void operator()(); private: ThreadPool &pool; }; // the actual thread pool class...
{ "alphanum_fraction": 0.6505219207, "author": null, "avg_line_length": 18.1439393939, "converted": null, "ext": "hpp", "file": null, "hexsha": "e2cac4f4618498812186505a041cc79b74d6e4df", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
''' This module contains functions for retrieving Kartverket map data for specified areas. Notes ----- The retrieval of map data uses `owslib`. Read more in the `owslib image tutorial <https://geopython.github.io/OWSLib/index.html?highlight=webmapservice>`_. Karverket data is retrieved from the `Kartverket WMS <http:...
{ "alphanum_fraction": 0.6014673311, "author": null, "avg_line_length": 27.3636363636, "converted": null, "ext": "py", "file": null, "hexsha": "cc62daa8f862be641129c5ce62acdf5fed3dc81f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import os from IPSData import CollectorIPSData import csv import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_squared_error forest = RandomForestRegressor(n_estimators = 10 , max_features = 'sqrt' , criterion = 'mse' , max_depth ...
{ "alphanum_fraction": 0.6088319088, "author": null, "avg_line_length": 29.7457627119, "converted": null, "ext": "py", "file": null, "hexsha": "44f158df1755830cbddf70d70a69116dce5b4f85", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/python import re import numpy as np import sys import ChemUtils as ch #print ch.str2composition( sys.argv[1] ) #sides = ch.parseReaction( 'Fe+O2=Fe2O3' ) #sides = ch.parseReaction( 'C12H22O11+KNO3=H2O+CO2+K2CO3+N2' ) #print sides #print ch.reaction2string( sides ) #print ch.balanceReactionString( 'Fe+O2=...
{ "alphanum_fraction": 0.7377777778, "author": null, "avg_line_length": 22.5, "converted": null, "ext": "py", "file": null, "hexsha": "4ce0b6928e1820a99cfba97f5fb1c95b134b15eb", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
import numpy as np from relevanceai.operations.dr.base import DimReductionBase from typing import Optional, Dict, Any from relevanceai.operations.cluster.constants import ( DIM_REDUCTION, DIM_REDUCTION_DEFAULT_ARGS, ) class PCA(DimReductionBase): def fit(self, vectors: np.ndarray, dims: int = 3, *args, **...
{ "alphanum_fraction": 0.6851654216, "author": null, "avg_line_length": 32.3103448276, "converted": null, "ext": "py", "file": null, "hexsha": "0fde7e69c029dba29d54454c833eb13d185fd95c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np from conv_net import conv_net from data_utils import * import time class Solver(object): """ Solver class for train and test methods: - train: train conv_net - test: test trained net """ def __init__(self): # config self.lr = 1e-4 self.weight_decay=0.0004 self.batch_si...
{ "alphanum_fraction": 0.6049891015, "author": null, "avg_line_length": 34.4083333333, "converted": null, "ext": "py", "file": null, "hexsha": "40053747bddc7f447167b2847965b6a074e4f316", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- """ Created on Wed May 26 18:27:37 2021 @author: Laura Grandas """ import os import PyPDF2 import slate3k as slate import pandas as pd import numpy as np import string # para las stopwords import nltk from nltk.corpus import stopwords spanish_stopwords = stopwords.words('span...
{ "alphanum_fraction": 0.5896656535, "author": null, "avg_line_length": 27.5517241379, "converted": null, "ext": "py", "file": null, "hexsha": "82d83ac72f386d919295cb6bec063954e00e32ab", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Sebastian Ullrich -/ import Lean.Util.CollectLevelParams import Lean.Elab.DeclUtil import Lean.Elab.DefView import Lean.Elab.Inductive import Lean.Elab.Struct...
{ "alphanum_fraction": null, "author": "gebner", "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 argparse import yaml import os import shutil from pathlib import Path import torch import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams["lines.linewidth"] = 0.8 from pysnn.network import SNNNetwork from evolutionary.utils.constructors import build_netwo...
{ "alphanum_fraction": 0.6261642676, "author": null, "avg_line_length": 26.5393258427, "converted": null, "ext": "py", "file": null, "hexsha": "f0d41fb6601e775f26d43b986d70611e59d64a2e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import torch import torch.nn as nn import torch.functional as F from sklearn.metrics import accuracy_score class DMILoss: def __call__(self, *args, **kwargs): return self.forward(*args, **kwargs) def forward(self, output, target): outputs = torch.softmax(output, dim=-1) ...
{ "alphanum_fraction": 0.5709757229, "author": null, "avg_line_length": 37.3815028902, "converted": null, "ext": "py", "file": null, "hexsha": "bc449f9064d2a656fa8314bdef7fd46be5c48253", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
module complete end
{ "alphanum_fraction": 0.8095238095, "author": null, "avg_line_length": 5.25, "converted": null, "ext": "jl", "file": null, "hexsha": "5036c4d74975ec7a574bdbf757e455b51a8128c0", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count":...
[STATEMENT] lemma diff_invariant_eq: "diff_invariant I f U S t\<^sub>0 G = (\<forall>s. I s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. (\<forall>t\<in>U s.(\<forall>\<tau>\<in>(down (U s) t). G (X \<tau>)) \<longrightarrow> I (X t))))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. diff_invariant I...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Hybrid_Systems_VCs_HS_ODEs", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 427, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_fork...
# any functions for plots from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes from matplotlib import dates as mdates from matplotlib.ticker import FormatStrFormatter import numpy as np import pandas as pd from pathlib import Path import glob, os import datetime def deploy...
{ "alphanum_fraction": 0.6563870968, "author": null, "avg_line_length": 39.7435897436, "converted": null, "ext": "py", "file": null, "hexsha": "f79d026c88bd3385855f496c209bca425dc77719", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import data.finset import data.fintype import data.fin import data.rat open function open finset variables {α : Type*} {β : Type*} variables [fintype α] [fintype β] namespace fintype theorem card_image_of_injective [decidable_eq β] {f : α → β}: injective f → finset.card ((elems α).image f) = card α := finset.car...
{ "alphanum_fraction": null, "author": "b-mehta", "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_dat...
#!/usr/bin/env python """bulge_graph.py: A graph representation of RNA secondary structure based on its decomposition into primitive structure types: stems, hairpins, interior loops, multiloops, etc... for eden and graphlearn we stripped forgi down to this single file. forgi: https://github.com/pkerpedj...
{ "alphanum_fraction": 0.5148986462, "author": null, "avg_line_length": 31.6935300795, "converted": null, "ext": "py", "file": null, "hexsha": "529075584e7e7f5b22b46ff655d558470509c089", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os os.environ['CUDA_VISIBLE_DEVICES'] = '5' import cv2 import numpy as np from maskrcnn_benchmark.config import cfg from demo.predictor import ICDARDemo, RRPNDemo from maskrcnn_benchmark.utils.visualize import vis_image, write_result_ICDAR_RRPN2polys, zip_dir from maskrcnn_benchmark.data.datasets.irra_int...
{ "alphanum_fraction": 0.6266321477, "author": null, "avg_line_length": 35.8225806452, "converted": null, "ext": "py", "file": null, "hexsha": "c4ffbcaa09c9c28512e13bbd75ba29ed18777b76", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python # coding: utf-8 # # Fifth exercice: Non-Cartesian radial under-sampling # # In this notebook, you can play with the design parameters to regenerate different radial in-out patterns (so, we draw radial spokes over a rotating angle of $\pi$). You can play with the number of shots by changing the u...
{ "alphanum_fraction": 0.7206385405, "author": null, "avg_line_length": 31.0442477876, "converted": null, "ext": "py", "file": null, "hexsha": "6c90062f5023b00b10a7f060b780e7164ecef2c3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import pickle from typing import Dict import colorlog import tensorflow as tf import numpy as np __PATH__ = os.path.abspath(os.path.dirname(__file__)) _PARLAI_PAD = '__null__' _PARLAI_GO = '__start__' _PARLAI_EOS = '__end__' _PARLAI_UNK = '__unk__' _PARLAI_START_VOCAB = [_PARLAI_PAD, _PARLAI_GO, _PARLAI_EO...
{ "alphanum_fraction": 0.6407109606, "author": null, "avg_line_length": 30.6883116883, "converted": null, "ext": "py", "file": null, "hexsha": "031daf96f3f2941ad04f0bbc16259c75853ebca6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from __future__ import absolute_import, division, print_function, unicode_literals import time import numpy as np from noise import snoise3 from ..mode import Mode class Noise(Mode): class State(object): RED = "RED" GREEN = "GRN" BLUE = "BLUE" GREYSCALE = "GREY" FULL_COL...
{ "alphanum_fraction": 0.5906652361, "author": null, "avg_line_length": 30.5573770492, "converted": null, "ext": "py", "file": null, "hexsha": "a094ef18156dfaae1cd18107b673672172a58a46", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import subprocess import os import glob #NUM_TRIES = 5 #NUM_EPOCHS = 200 NUM_TRIES = 1 NUM_EPOCHS = 20 #DATASETS=["UWaveGestureLibraryAll","FacesUCR","ECG5000"] #DATASETS=["Datasets/CDOT/Time_Series_For_Clustering_El_Paso_with_Weather_data.csv"] DATASETS=["CDOT"] exmpl_range = np.arange(4, 29, step=8...
{ "alphanum_fraction": 0.6095551895, "author": null, "avg_line_length": 64.5744680851, "converted": null, "ext": "py", "file": null, "hexsha": "434e20817d8313653b91d6aa2708b9406355b95d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# https://github.com/nirupamaprv/Analyze-AB-test-Results/blob/master/Analyze%20A:B%20Test%20Results-Quiz-Answers.txt # hypothesis is less related to p-value import pandas as pd import numpy as np import random import matplotlib matplotlib.use('TkAgg') #We are setting the seed to assure that we get the same answers ...
{ "alphanum_fraction": 0.7154353774, "author": null, "avg_line_length": 33.4032258065, "converted": null, "ext": "py", "file": null, "hexsha": "2a302c1ef818e8a8ddbe030cfd171f1db6cb2866", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#script to create moisture capital map for testing (for % chg) #requires climate data from cru_ts4.zip (via https://crudata.uea.ac.uk/cru/data/hrg/) rm(list = ls()) library(raster) library(tidyverse) #set scenario parms initial_yr <- 2018 final_yr <- 2035 perc_chg <- -20 #this is the % difference over the entire...
{ "alphanum_fraction": 0.7265372168, "author": null, "avg_line_length": 28.96875, "converted": null, "ext": "r", "file": null, "hexsha": "2ffac65eac75ec73ab85aebc1efd6b9bf1b78752", "include": null, "lang": "R", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": ...
#!/usr/bin/env python3 import argparse from collections import defaultdict from typing import Dict, List, Union, Any import xml.etree.ElementTree as ET from xml.dom import minidom from xml.sax.saxutils import unescape import networkx as nx import yaml import sys import io def bandwidth_conversion(x): # shadow...
{ "alphanum_fraction": 0.6611102375, "author": null, "avg_line_length": 40.5031847134, "converted": null, "ext": "py", "file": null, "hexsha": "cfbe16d1c41d73418199b655eced9d4b0c60d5c0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
include("faber.jl") include("types.jl") """ acc_rej(n::Int64, S::System, X::AbstractModel, f1::Regular, u, v) For Regular sampling_scheme: always accept """ function acc_rej(n::Int64, S::System, X::AbstractModel, f1::Regular, u::Float64, v::Float64, t::Float64) return true end """ acc_rej(n::Int64, S::Sy...
{ "alphanum_fraction": 0.6051915048, "author": null, "avg_line_length": 33.3878787879, "converted": null, "ext": "jl", "file": null, "hexsha": "47e4ffb39c2be1340fcf4210ed7ffbf3fc208010", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...