text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np # In[2]: def sn_random_numbers(shape,antithetic=True,moment_matching=True,fixed_seed=False): if fixed_seed: np.random.seed(1000) if antithetic: ran=np.random.standard_normal((shape[0],shape[1],shape[2]//2)) ran=np.c...
{"hexsha": "1d2a19a4c0310c806f8cc0293db1004214c22d2c", "size": 580, "ext": "py", "lang": "Python", "max_stars_repo_path": "sn_random_numbers.py", "max_stars_repo_name": "HaoLiNick/quantbasic", "max_stars_repo_head_hexsha": "59ff8bef07df2357cc91e7092c8cb660285541b0", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
import numpy as np import pandas as pd import plotly.graph_objects as go from scripts.python.routines.plot.save import save_figure from scripts.python.routines.plot.bar import add_bar_trace from scripts.python.routines.plot.layout import add_layout from scripts.python.routines.manifest import get_manifest from scripts....
{"hexsha": "4728111b674af385f9681a20c3b37ecb18441f38", "size": 1978, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/python/meta/tasks/GPL13534_Blood/005_plot_models_results.py", "max_stars_repo_name": "AaronBlare/dnam", "max_stars_repo_head_hexsha": "4d97c879cb24447eee0852eaf48fc5b3ef8e159b", "max_stars...
export pca_session function pca_session(spikes::Array{SpikeTrain,1},binsize::Float64,kern::Float64) myrate=rate_KD(spikes,binsize,kern) pcamat=zeros(Float64,length(spikes[1].trials[1].time:binsize:spikes[1].trials[end].time)-1,length(spikes)) for i=1:length(spikes) pcamat[:,i]=rate_session(myrate,i...
{"hexsha": "0df77cddf0f0e8a1218b98bac27ba3cf36120dd1", "size": 1005, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/dimensionreduce.jl", "max_stars_repo_name": "paulmthompson/Spikes.jl", "max_stars_repo_head_hexsha": "43de3dfc6ec1fc9a1fcf93231590e8d98a85db4e", "max_stars_repo_licenses": ["BSD-2-Clause"], "ma...
import numpy as np class MixupImageDataGenerator(): def __init__(self, generator, directory, batch_size, img_height, img_width, alpha=0.2, subset=None): """Constructor for mixup image data generator. Arguments: generator {object} -- An instance of Keras ImageDataGenerator. ...
{"hexsha": "1c69b991500fba436e2e9d760606ee6de53510ae", "size": 3780, "ext": "py", "lang": "Python", "max_stars_repo_path": "mixup_generator.py", "max_stars_repo_name": "Tony607/keras_mixup_generator", "max_stars_repo_head_hexsha": "a510b3f7f909055b64a308bb8e94dc9e0d66e29c", "max_stars_repo_licenses": ["MIT"], "max_star...
using Documenter, OneHotArrays DocMeta.setdocmeta!(OneHotArrays, :DocTestSetup, :(using OneHotArrays); recursive = true) makedocs(sitename = "OneHotArrays", doctest = false, pages = ["Overview" => "index.md", "Reference" => "reference.md"]) deploydocs(repo = "github.com/FluxML/OneHotArrays....
{"hexsha": "79336a244f55e2a216a57477f27240bf020b09e2", "size": 390, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/make.jl", "max_stars_repo_name": "FluxML/OneHotArrays.jl", "max_stars_repo_head_hexsha": "d44a239928bdb14517cdb9c1963d1deeed31c714", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,...
#include "RateManagerAsync.h" #include <iostream> #include <boost/bind/bind.hpp> RateManagerAsync::RateManagerAsync(boost::asio::io_service & ioService, const uint64_t rateBitsPerSec, const uint64_t maxPacketsBeingSent) : m_ioServiceRef(ioService), m_rateTimer(ioService), m_rateBitsPerSec(rateBitsPerSec), ...
{"hexsha": "80dee870495130047f0047fef56b8d3ce3608206", "size": 10089, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "common/util/src/deprecated/RateManagerAsync.cpp", "max_stars_repo_name": "ewb4/HDTN", "max_stars_repo_head_hexsha": "a0e577351bd28c3aeb7e656e03a2d93cf84712a0", "max_stars_repo_licenses": ["NASA-1.3...
from tensorflow.keras import layers, Model, backend import numpy as np import tensorflow as tf from signal_separation._signal_creator import destandardize_height, height_ratio, places_change, de_standardize def multiply_cnn(n, kernel_size, added_filters, filter_beg, dense1, dense2, x, batch_n): for i in np...
{"hexsha": "8ee3909706522f6617a40ed3f54811c35afd855b", "size": 8085, "ext": "py", "lang": "Python", "max_stars_repo_path": "signal_separation/_neural_network.py", "max_stars_repo_name": "MieszkoP/signal_separation", "max_stars_repo_head_hexsha": "c18a29fb92891e671907524609162f9a7985eaff", "max_stars_repo_licenses": ["M...
import random import numpy as np import torch # %% def choice(a, size=None, replace=True): ''' Randomly choose elements from given iterable. Parameters ---------- a: int or list choice of ''' m = len(a) # Single sample if size==None: random_i = np.random.randint(m...
{"hexsha": "ca61ec76bf3c33a9a1317a0b10879155917e6e18", "size": 1242, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/random.py", "max_stars_repo_name": "jsyoo61/tools", "max_stars_repo_head_hexsha": "bba8bfe69f87c8111d8b82c90a65a71b6996f9b4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_s...
# Copyright (c) 2014-2016, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions...
{"hexsha": "d6e4ac6356ccd2286079cb8aa4176a766b166f6b", "size": 4842, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymic/_misc.py", "max_stars_repo_name": "01org/pyMIC", "max_stars_repo_head_hexsha": "f775239a208dc1daaf89451af06e0138b80099e9", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 38,...
import torch import torch.nn as nn # from pts3d import * import torchvision.models as models import functools from torch.autograd import Variable import torch.nn.functional as F from torch.nn import init import numpy as np class Flatten(nn.Module): def forward(self, input): return input.view(input.size(0),...
{"hexsha": "b2ce34f11ca517dd963c872256f504feb44c3c70", "size": 3344, "ext": "py", "lang": "Python", "max_stars_repo_path": "id_removing_net.py", "max_stars_repo_name": "keetsky/VGGVox_EBT", "max_stars_repo_head_hexsha": "fc2647b9bafc641d38b3f996205cdb8860f66625", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n...
import random import numpy as np import matplotlib.pyplot as plt import pandas as pd def randomized_response(true_value): res1 = random.randint(0,1) if (res1 == 1): return true_value else: res2 = random.randint(0,1) if (res2 == 1): return 0 else: return 1 n_users = 30 users = [i for i in range(100,...
{"hexsha": "3a6c1df1b494b89e92739ad9493fa4a6cd83ebc2", "size": 752, "ext": "py", "lang": "Python", "max_stars_repo_path": "LDP/random_response.py", "max_stars_repo_name": "nikosgalanis/bsc-thesis", "max_stars_repo_head_hexsha": "b5521e995f266ff1aeb9fecc220650483630dc04", "max_stars_repo_licenses": ["Apache-2.0"], "max_...
# -*- coding: utf-8 -*- import os import sys #lib_path = os.path.abspath('/home/dani/github/ConcursoPolicia') #if lib_path not in sys.path: # sys.path.append(lib_path) import luigi from RecolectorTwitter import * from Config.Conf import Conf from DBbridge.ConsultasCassandra import ConsultasCassandra from DBbridge.Con...
{"hexsha": "aae57a5a54c993a11e18f9cc26e853b988959815", "size": 12209, "ext": "py", "lang": "Python", "max_stars_repo_path": "LuigiTasks/GenerateSim.py", "max_stars_repo_name": "garnachod/ConcursoPolicia", "max_stars_repo_head_hexsha": "f123595afc697ddfa862114a228d7351e2f8fd73", "max_stars_repo_licenses": ["Apache-2.0"]...
# SM.Simp_AP.py # # Implements the Simplified Set-membership Affine-Projection algorithm for COMPLEX valued data. # (Algorithm 6.7 - book: Adaptive Filtering: Algorithms and Practical # Implementation, Diniz) # # Authors: # . Bruno Ramos Lima N...
{"hexsha": "48db8edfcdd565099ccb41be270f6b36aee9b024", "size": 5302, "ext": "py", "lang": "Python", "max_stars_repo_path": "pydaptivefiltering/SM/Simp_AP.py", "max_stars_repo_name": "BruninLima/PydaptiveFiltering", "max_stars_repo_head_hexsha": "14f4758a25b7cb3f1fd643caa5caffd5e7f06c6a", "max_stars_repo_licenses": ["RS...
# Copyright(c) 2020 Jake Fowler # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, # copy, modify, merge, publish, distri...
{"hexsha": "f51090510e79a9928eaae8b1927e4eca596a9c0d", "size": 17378, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/Cmdty.Storage.Python/tests/test_multi_factor.py", "max_stars_repo_name": "eliot-tabet/storage", "max_stars_repo_head_hexsha": "b40c04ce49130e976b095d0087d2520bb9a80db2", "max_stars_repo_licen...
# This is the R2-IBEA weight vector generation algorithm as described in: # Dung H. Phan and Junichi Suzuki, "R2-IBEA: R2 Indicator Based Evolutionary # Algorithm for Multiobjective Optimization", 2013. function generate_random_weight_vector(m) x = sort(rand(m-1)) w = zeros(m) w[1] = x[1] for i in 2:(m-1) ...
{"hexsha": "919cc3b483227fa753cd04598e2fa4a86287fedd", "size": 2795, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "spikes/r2_ibea_weight_vector_generation.jl", "max_stars_repo_name": "devmotion/BlackBoxOptim.jl", "max_stars_repo_head_hexsha": "252b373da6571b209f82660839923add60eba34d", "max_stars_repo_licenses"...
%labels segments comparing their eventIdx property to event annotations. %The eventIdx prperty is set if an eventSegmentation has been used %to generate the segment classdef EventSegmentsLabeler < Algorithm properties (Access = public) manualAnnotations; end methods (Access = public) ...
{"author": "avenix", "repo": "WDK", "sha": "c525222b02bd390b4758d30f1cd8b19af043108e", "save_path": "github-repos/MATLAB/avenix-WDK", "path": "github-repos/MATLAB/avenix-WDK/WDK-c525222b02bd390b4758d30f1cd8b19af043108e/ARC/algorithm/5-labeling/EventSegmentsLabeler.m"}
[STATEMENT] lemma WT_gpv_pauses [WT_intro]: "\<I> \<turnstile>g pauses xs \<surd>" if "set xs \<subseteq> outs_\<I> \<I>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<I> \<turnstile>g pauses xs \<surd> [PROOF STEP] using that [PROOF STATE] proof (prove) using this: set xs \<subseteq> outs_\<I> \<I> goal (1 su...
{"llama_tokens": 185, "file": "Constructive_Cryptography_CM_Fold_Spmf", "length": 2}
import argparse import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler import numpy as np import torchvision from torchvision import models, transforms import os from sklearn import metrics from data_utils import ImageFolderWithPaths import pandas as pd import torchnet.mete...
{"hexsha": "5c9c7e5fa4ab5b0de5bac821b5ea4a70ccbe1c21", "size": 9775, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/test.py", "max_stars_repo_name": "gonzalezsieira/UGR-FuCiTNet", "max_stars_repo_head_hexsha": "0bcf9ba493e8f1173661f88b397113dd386a1e9b", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import numpy as np import math def standard_propensity(rxn, CRS, concentrations): ''' Standard Propensity function calculates propensity as the concentrations of the reactants raised to their coefficients Arguements: - rxn: Reaction object - CRS: CRS object for system - concentrations: list of molec...
{"hexsha": "97f1ae515177775c8a1be7b14938d12ae209fc79", "size": 5625, "ext": "py", "lang": "Python", "max_stars_repo_path": "chemevolve/PropensityFunctions.py", "max_stars_repo_name": "ELIFE-ASU/chemevolve", "max_stars_repo_head_hexsha": "3ab58024f2d32066c4ae102841de5f581dd4720f", "max_stars_repo_licenses": ["MIT"], "ma...
using jInv.Mesh using jInv.Utils using jInv.ForwardShare using ShapeReconstructionPaLS.Utils using ParamLevelSet using ShapeReconstructionPaLS.ShapeFromSilhouette; using Statistics using Distributed using LinearAlgebra using SparseArrays using Test println("Test SoftMax") n = 20; m = 10; u = rand(20).-0.1; At = sprand...
{"hexsha": "028dd8b8e75a513a07ca4c42837ce997837d840d", "size": 842, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/ShapeFromSilhouette/testSoftMax.jl", "max_stars_repo_name": "BGUCompSci/ShapeReconstructionPaLS", "max_stars_repo_head_hexsha": "725cfa2a2ab357b4f2ed564eb2227158efc07f7f", "max_stars_repo_licen...
vidname = 'vid.mp4' style = 's1.jpg' import numpy as np from PIL import Image import random from tensorflow.keras.layers import * from tensorflow.keras.models import * from tensorflow.keras.optimizers import * import tensorflow.keras.backend as K from tensorflow.keras.applications.vgg19 import VGG19 model_num = 90 ...
{"hexsha": "0b71abd47fd27055120422f30e0754a6cfdc716e", "size": 2468, "ext": "py", "lang": "Python", "max_stars_repo_path": "video.py", "max_stars_repo_name": "manicman1999/Style-Transfer-TF2.0", "max_stars_repo_head_hexsha": "f9c4621320255a3d3ab150756f63ea0bae23f498", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
SUBROUTINE CheckTime(stime,etime,ctime) IMPLICIT NONE ! ------------------------------------------------------------------------- ! NAME: CheckTime ! STATUS: Current ! OWNER: General ! TEXT: Print CPU time. ! When called for the first time, stime should be set to 0.0 before ! ...
{"hexsha": "820520353b6ec4c078759ff7d3c2b8b2e3e0f894", "size": 762, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "CheckTime.f90", "max_stars_repo_name": "anducnguyen/ferritas_e", "max_stars_repo_head_hexsha": "e3273c5513d6f22b060b4ea9034022b07785746f", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co...
subroutine runCY_00ll(k,l,Xtwiddle,Gtwiddle,Shat4,N0) implicit none C--- Expression for Eq. 5.58a C--- Calculates C00ll C--- Small terms of order Xtwiddle(0,k)*Ciii,Xtwiddle(0,0)*Ciiii C--- Denominator Gtwiddle(k,l) include 'pvCnames.f' include 'pvCv.f' include 'Carraydef.f' i...
{"hexsha": "d3f4956e636a0a9742da5a27124ccec60c6cedae", "size": 793, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "MCFM-JHUGen/TensorReduction/recur/smallY/runCY_00ll.f", "max_stars_repo_name": "tmartini/JHUGen", "max_stars_repo_head_hexsha": "80da31668d7b7eb5b02bb4cac435562c45075d24", "max_stars_repo_licenses"...
module FxForHasql.Prelude ( module Exports, ) where -- base ------------------------- import Control.Applicative as Exports import Control.Arrow as Exports hiding (first, second) import Control.Category as Exports import Control.Concurrent as Exports import Control.Exception as Exports import Control.Monad as Expor...
{"hexsha": "48e3f4b6fc6ce29324b4a83ef6088d050b2ec8e0", "size": 3317, "ext": "hs", "lang": "Haskell", "max_stars_repo_path": "library/FxForHasql/Prelude.hs", "max_stars_repo_name": "nikita-volkov/fx-for-hasql", "max_stars_repo_head_hexsha": "fc515853d0d32376874df29663cb7eaf3e2d44e4", "max_stars_repo_licenses": ["MIT"], ...
\documentclass[11pt,twoside]{article} \usepackage[headings]{fullpage} \usepackage[utopia]{mathdesign} \pagestyle{myheadings} \markboth{Horn equation}{Horn equation} \input{../../fncextra} \begin{document} \begin{center} \bf Toot your own horn \end{center} The use of mathematics for the design and analysis ...
{"hexsha": "6ae51825580f02adfa160133a2235298341cf9af", "size": 5254, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "labs/chapter10/Horn/Horn.tex", "max_stars_repo_name": "snowdj/fnc-extras", "max_stars_repo_head_hexsha": "ef51fada748de1326a4ce645fbcb0c2499cb2b8a", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
# Import libraries import argparse from azureml.core import Run import pandas as pd import numpy as np import joblib from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn.metrics import roc_auc_score from sklearn.metrics import roc_curve # Set ...
{"hexsha": "fc1775ab8a72168fbd42e4f7efcfa3c805f32d47", "size": 1914, "ext": "py", "lang": "Python", "max_stars_repo_path": "projects/mslearn-aml-labs/diabetes_training_from_tab_dataset/diabetes_training.py", "max_stars_repo_name": "Code360In/data-science", "max_stars_repo_head_hexsha": "cb6093e898ccb860e76914057a52f751...
# -*- coding: utf-8 -*- import sys import types import os import getopt import re from pathlib import Path from pathlib import PurePath from io import StringIO import contextlib import importlib from lopper import Lopper from lopper import LopperFmt import lopper from lopper_tree import * from re import * import numpy ...
{"hexsha": "748db52ed8aa84cc6bfe891e154db0bbabe574b8", "size": 129423, "ext": "py", "lang": "Python", "max_stars_repo_path": "assists/zuplus_config.py", "max_stars_repo_name": "nagasureshkumar/lopper", "max_stars_repo_head_hexsha": "8c5f34181a246cdd8ed8ed4ba6e32de017940af8", "max_stars_repo_licenses": ["BSD-3-Clause"],...
import numpy as np import pandas as pd import tensorflow as tf import math data = pd.read_excel('1000_abstracttotal.xls', encoding='utf-8') data = data.iloc[:,[0,2]] raw_data = data.to_numpy() #print(raw_data.shape) x=raw_data[:,1].reshape(len(raw_data),1) y=raw_data[:,0].reshape(len(raw_data),1) #print(x.sha...
{"hexsha": "22255bc3c9f871db2314ebd1403e9d9c815a494a", "size": 851, "ext": "py", "lang": "Python", "max_stars_repo_path": "bert_classifier/read_made.py", "max_stars_repo_name": "Zeng-WH/MaterBERT", "max_stars_repo_head_hexsha": "92bdf721ee168a3c91c6cd94599b7df65f9e6cbd", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
import numpy as np import pandas as pd from collections import OrderedDict from datetime import datetime CRA = 0.001 MAX_ERROR = 0.0000000001 MAX_RUNS = 20 def DiscountedValue4par2forwards( sum_df: float = 0, last_df: float = 0, par_rate: float = 0, forward_rate: float = 0, t_min_k: int = 0, ) ->...
{"hexsha": "b50499e939bff5eab4630235b8cbaa32a6a4bdfe", "size": 3084, "ext": "py", "lang": "Python", "max_stars_repo_path": "solvency2_data/alternative_extrapolation.py", "max_stars_repo_name": "DeNederlandscheBank/solvency2-rfr", "max_stars_repo_head_hexsha": "61f192b98283274594f80605b11823a0a505d0f6", "max_stars_repo_...
''' Define the Transformer model ''' import torch import torch.nn as nn import numpy as np #import transformer.Constants as Constants #from transformer.Layers import EncoderLayer#, DecoderLayer import Constants as Constants from Layers import EncoderLayer#, DecoderLayer ##############################################...
{"hexsha": "43f5bb80c5dd914424553094d748fdc9e8c5a1b4", "size": 5289, "ext": "py", "lang": "Python", "max_stars_repo_path": "transformer/Models.py", "max_stars_repo_name": "hamed-sadeghi-layer6/transformer-kk-mimic", "max_stars_repo_head_hexsha": "583c6aa00c97724f36bc196cd619f7a8b7928fd8", "max_stars_repo_licenses": ["M...
import numpy as np import scipy as sp import scipy.optimize import scipy.integrate import scipy.special import matplotlib.pyplot as plt import math ############################################################### ################# Use Only These Functions #################### ###########################################...
{"hexsha": "58364d1713f3f48ae9178d0c88913d7a78d75723", "size": 4119, "ext": "py", "lang": "Python", "max_stars_repo_path": "kernel_generalization/kernel_simulation.py", "max_stars_repo_name": "Pehlevan-Group/kernel_regression", "max_stars_repo_head_hexsha": "761c2e9f72da204ca1c4ef0841a97caf8f306d23", "max_stars_repo_li...
[STATEMENT] lemma subcls1_induct [consumes 1]: "\<lbrakk>ws_prog G; \<And>x. \<forall>y. (x, y) \<in> subcls1 G \<longrightarrow> P y \<Longrightarrow> P x\<rbrakk> \<Longrightarrow> P a" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>ws_prog G; \<And>x. \<forall>y. G\<turnstile>x\<prec>\<^sub>C1y \<longr...
{"llama_tokens": 577, "file": null, "length": 5}
```python def downloadDriveFile(file_id,file_name,file_extension): ''' Allows charge of public files into colab's workspace ''' !wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate '...
{"hexsha": "f86f5801d0ba2fa9975027b07a5c3b1f0e4a3f8a", "size": 36687, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "numeric_analysis_exercises/cap3_set_constrained_optimization.ipynb", "max_stars_repo_name": "lufgarciaar/num_analysis_exercises", "max_stars_repo_head_hexsha": "d145908494c5a7453830e...
from task1 import get_Lagrange_descr from sympy import symbols, diff x1, x2, x3, t = symbols('x1 x2 x3 t') def get_velocity_Lagrange(eq1, eq2, eq3): U1, U2, U3 = get_Lagrange_descr(eq1, eq2, eq3) V1 = diff(U1, t) V2 = diff(U2, t) V3 = diff(U3, t) return [V1, V2, V3] def get_acceleration_Lagrange(...
{"hexsha": "590614ee5ce3789bed616913ca070d76779f73ce", "size": 608, "ext": "py", "lang": "Python", "max_stars_repo_path": "pkmkt2_code/task2.py", "max_stars_repo_name": "toomastahves/predicting-diabetes", "max_stars_repo_head_hexsha": "ed7d3f9e64970fe0aacd13db9afb707f428ed2ac", "max_stars_repo_licenses": ["MIT"], "max_...
import torch from torch import nn from torch.nn import functional as F from torchvision.models import inception_v3 import numpy as np from scipy import linalg from skimage.metrics import peak_signal_noise_ratio as compare_psnr from skimage.metrics import structural_similarity as ssim from pytorch_lightning.metrics impo...
{"hexsha": "57249fe1e2a48dc101a1d545aa7051b648fef774", "size": 12279, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/metrics.py", "max_stars_repo_name": "CompVis/interactive-image2video-synthesis", "max_stars_repo_head_hexsha": "05ea449d3a2704b6d79a5f08683035220d615576", "max_stars_repo_licenses": ["MIT"]...
from sympy import * n = abs(int(input())) if isprime(n): print('This number is prime') else: print('This number is not prime')
{"hexsha": "72c719271848e7146dbfaa871ed9dadf6aa9e6a3", "size": 135, "ext": "py", "lang": "Python", "max_stars_repo_path": "self-learning/based/00000028.py", "max_stars_repo_name": "vladspirin/python-learning", "max_stars_repo_head_hexsha": "6b005fb28f96c0d610348a0b5f8830f94c53075f", "max_stars_repo_licenses": ["Unlicen...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright CNRS 2012 # Roman Yurchak (LULI) # This software is governed by the CeCILL-B license under French law and # abiding by the rules of distribution of free software. import sys import os, os.path import warnings import numpy as np from hedp.math.abel import abel fro...
{"hexsha": "7709a753708cf94fc9bb784c246d98e3338746dd", "size": 1118, "ext": "py", "lang": "Python", "max_stars_repo_path": "hedp/pp/interferometry.py", "max_stars_repo_name": "luli/hedp", "max_stars_repo_head_hexsha": "ab78879106ef2d7b6e54ac6a69d24439ec8c9a8b", "max_stars_repo_licenses": ["CECILL-B"], "max_stars_count"...
[STATEMENT] lemma "|x \<cdot> y] q = |x] |y] q" [PROOF STATE] proof (prove) goal (1 subgoal): 1. |x \<cdot> y] q = |x] |y] q [PROOF STEP] using fbox_mult [PROOF STATE] proof (prove) using this: |?x \<cdot> ?y] ?z = |?x] |?y] ?z goal (1 subgoal): 1. |x \<cdot> y] q = |x] |y] q [PROOF STEP] .
{"llama_tokens": 164, "file": "Hybrid_Systems_VCs_ModalKleeneAlgebra_HS_VC_MKA", "length": 2}
module ObjectTileNames names = Dict{Int, String}( -1 => "Air (-1)", 0 => "Grass A (0)", 1 => "Grass B (1)", 2 => "Grass C (2)", 3 => "Grass D (3)", 8 => "Fence Top A (8)", 9 => "Fence Top B (9)", 10 => "Fence Top C (10)", 11 => "Fence Top D (11)", 12 => "Fence Top E (12)", 1...
{"hexsha": "73830da5aaf67d5b0092a69f8838fba5942ec344", "size": 6204, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/object_tile_names.jl", "max_stars_repo_name": "kingW3/Ahorn", "max_stars_repo_head_hexsha": "a064bf0a953620415ea6eb8b0d610c8c606b2b05", "max_stars_repo_licenses": ["FSFAP"], "max_stars_count": ...
# -*- coding: utf-8 -*- """ Created on Thu Jun 2 14:51:27 2016 @author: DanielleTump Note: This script is not run in full, but is ran by parts of it, depending on the ensemble needed and the files used. """ import csv #to read from/write to csv files from math import ceil #to round floats to the highest integer ...
{"hexsha": "7a42e6dcd2cdd7fef3240d9843fb0fc3d536d14b", "size": 11230, "ext": "py", "lang": "Python", "max_stars_repo_path": "Project2/Code/Ensemble/EnsembleTrainsetVerificationset.py", "max_stars_repo_name": "TheLaurens/Team-Brains", "max_stars_repo_head_hexsha": "78b2417c90116336ac02036d4c148eb221f73830", "max_stars_r...
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-2014 Facebook, Inc. (http://www.facebook.com) | +---------...
{"hexsha": "f5fac491d4c0d0c63f545fe6d1476ec2fd1307a9", "size": 13399, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "hphp/compiler/option.cpp", "max_stars_repo_name": "nareshv/hhvm", "max_stars_repo_head_hexsha": "3528dc973dec02a4cc18a10586ce485995818666", "max_stars_repo_licenses": ["PHP-3.01", "Zend-2.0"], "max...
#ifdef WITH_PYTHON // Don't compile... anything, otherwise. #include <functional> #include <solvers/smt/smt_conv.h> #include <boost/python.hpp> #include <boost/python/class.hpp> #include <boost/python/suite/indexing/vector_indexing_suite.hpp> #include <solve.h> #include <smt_python.h> class dummy_solver_class { }; cl...
{"hexsha": "87741d816053d61e886865fefe43907f11b626b8", "size": 33807, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/solvers/smt_python.cpp", "max_stars_repo_name": "alecs184/esbmc", "max_stars_repo_head_hexsha": "ec70901e554b8fdcfaa82b85a7050fa042168ca7", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta...
""" Data Prep Script by Mary Kohl Adapted from 2020-06-07_prep_sources_DLevitt.py """ import pandas as pd import numpy as np import os import re in_dir = '../food-data/PFPC_data_files' out_dir = '../food-data/Cleaned_data_files' in_path = os.path.join(in_dir,'FMNPMarkets.xlsx') out_path = os.path.join(out_dir,'FMNPM...
{"hexsha": "f8259dffd7e5af3f4b10d314158ec510344ebe25", "size": 2690, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_prep_scripts/2020-10-20_prep_sources_MKohl.py", "max_stars_repo_name": "marykohl3/food-access-map-data", "max_stars_repo_head_hexsha": "29547f63d59691069994aaf9949c0e2b13e90be6", "max_stars_r...
abstract type SequenceSpec end # All all elements mutable struct SequenceAll <: SequenceSpec end # None no elements mutable struct SequenceNone <: SequenceSpec end # n elements 1 through n struct SequenceN{T<:Integer} <: SequenceSpec n::T end # UpTo[n] elements 1 up to at most n struct SequenceUpToN{T<:In...
{"hexsha": "db0f8a7101936061088a4f0c3648467fc46e646b", "size": 2286, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/sequence_specification.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/Symata.jl-a906b1d5-d016-55c4-aab3-8a20cba0db2a", "max_stars_repo_head_hexsha": "a717c629b2bcce4f78f3956752a2e5...
# --- Binary managment # ---------------------------------------------------- # --- Modules # ---------------------------------------------------- using Random # ---------------------------------------------------- # --- Source code # ---------------------------------------------------- """ --- Create a ...
{"hexsha": "08bfcf4d0d3fc22d18f6ee73d0579c63ad33dda7", "size": 3349, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/genBitSequence.jl", "max_stars_repo_name": "JuliaTelecom/DigitalComm.jl", "max_stars_repo_head_hexsha": "13c854b9c4a8864787075e06e0e3ef5a1d30beae", "max_stars_repo_licenses": ["MIT"], "max_star...
import miepy import numpy as np def test_plane_wave_point_matching(): """point matching a plane wave agrees with analytic results""" k = 1 wav = 2*np.pi/k lmax = 3 source = miepy.sources.plane_wave([1,0]) p_src = source.structure([[0,0,0]], k, lmax)[0] p_src_numeric = miepy.vsh.decomposi...
{"hexsha": "78589141af6ec0ceb3e9313d55f136eb45bd017f", "size": 1263, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_point_matching.py", "max_stars_repo_name": "johnaparker/MiePy", "max_stars_repo_head_hexsha": "5c5bb5a07c8ab79e9e2a9fc79fb9779e690147be", "max_stars_repo_licenses": ["MIT"], "max_stars_...
import io import os import zipfile import numpy as np from PIL import Image from chainer.dataset import download def get_facade(): root = download.get_dataset_directory('study_chainer/facade') npz_path = os.path.join(root, 'base.npz') url = 'http://cmp.felk.cvut.cz/~tylecr1/facade/CMP_facade_DB_base.zip' ...
{"hexsha": "ceb5d0bafb4c57f1cb4c6234e4bdd51d46f57db3", "size": 1190, "ext": "py", "lang": "Python", "max_stars_repo_path": "study_chainer/datasets/facade.py", "max_stars_repo_name": "briongloid/study_chainer", "max_stars_repo_head_hexsha": "95f2c7848f050302cac9f8875d24e8c200946e32", "max_stars_repo_licenses": ["MIT"], ...
import numpy as np import pandas as pd import os from kmodes import kmodes from sklearn.cluster import KMeans, SpectralClustering from sklearn.cluster import MiniBatchKMeans import csv from datetime import datetime import time import sys from sklearn import metrics from sklearn.metrics import pairwise_distances cl...
{"hexsha": "ddfde66a8265479272ca955cf36fe7e7aa415ee5", "size": 2015, "ext": "py", "lang": "Python", "max_stars_repo_path": "servidor/machine_learning/clustering.py", "max_stars_repo_name": "FelipeLimaM/ItsMyLife-Framework", "max_stars_repo_head_hexsha": "c1d1ce89db1882a2594b126ac6407fca6d9255aa", "max_stars_repo_licens...
[STATEMENT] lemma rel_resumption_OO [relator_distr]: "rel_resumption A B OO rel_resumption C D = rel_resumption (A OO C) (B OO D)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Resumption.resumption.rel_resumption A B OO Resumption.resumption.rel_resumption C D = Resumption.resumption.rel_resumption (A OO C) (B O...
{"llama_tokens": 149, "file": "CryptHOL_Resumption", "length": 1}
import numpy as np import pandas as pd from scipy import optimize, special from sklearn import metrics def optimize_threshold_f1(outputs, labels): std = np.std(outputs) bounds = np.array([np.min(outputs), np.max(outputs)]) / std def fn(thresh): return -metrics.f1_score(labels, outputs >= std * thre...
{"hexsha": "0fb4ab37949ea0efef95e09d24acb0f82b21cca3", "size": 6969, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepSM/post_processing.py", "max_stars_repo_name": "Vivoe/DeepSM", "max_stars_repo_head_hexsha": "bc35f2bfc3758199466079ec54de1d5297374921", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- """ Created on Wed Aug 5 08:55:53 2020 @author: Manuel Pinar-Molina """ import numpy as np ''' Normalize the original data with values between 0-255 ''' def normalize(original): readdata_norm = np.array(original) + abs(np.min(original)) readdata_norm = readdata...
{"hexsha": "7934bb522184996175d06487b8d1ddc855893c0d", "size": 2006, "ext": "py", "lang": "Python", "max_stars_repo_path": "Utils/seg_extend.py", "max_stars_repo_name": "manuelpinar/3DUnetCNN", "max_stars_repo_head_hexsha": "d40cf10ab2ee78c790caf4ebee6516f306797140", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
program test_get_grid_shape use bmif_1_2, only: BMI_FAILURE use bmisnowf use fixtures, only: config_file, status implicit none integer, parameter :: grid_id = 0 integer, parameter :: rank = 2 integer, dimension(rank), parameter :: expected_shape = [1, 1] type (bmi_snow) :: m integer, dimension(2) ...
{"hexsha": "751d91cd1cbb29c2485d3e7026d0df42a042aef3", "size": 606, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "snow/tests/test_get_grid_shape.f90", "max_stars_repo_name": "wk1984/Snow_BMI_Fortran", "max_stars_repo_head_hexsha": "68040d7cdfabe95e3376d55383ecfbdcbc7f87cd", "max_stars_repo_licenses": ["Apach...
import matplotlib.pyplot as plt import numpy as np from hypot import hypot bs = np.linspace(0., 5., 10) rs = [hypot(dict(a = 2., b = b)) for b in bs] plt.plot([r["c"] for r in rs]) plt.show()
{"hexsha": "77631ae2449f8ddef304f2a842a1f4b035e9da5e", "size": 194, "ext": "py", "lang": "Python", "max_stars_repo_path": "plot.py", "max_stars_repo_name": "rekka/python-cpp-json", "max_stars_repo_head_hexsha": "6c39c2d7d7952f79c0533ea287d23a7c3ce1e6c8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max...
\section{Method} \label{sec:method} In this section we describe how we calculate full 3D velocities for stars in the Kepler field. Around 1 in 3 Kepler targets have an RV from either Gaia, LAMOST, or APOGEE. For these \nrv\ stars we calculated 3D velocities using the {\tt coordinates} library of {\tt astropy} \citep{a...
{"hexsha": "7c5a5dbb87e6911994bcb19228f9f2a25482fac0", "size": 19932, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "paper/method.tex", "max_stars_repo_name": "RuthAngus/kepler_kinematics", "max_stars_repo_head_hexsha": "cd8d3d0f9bc74ce2a39266ed2bac6a8f10499f64", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
#! /usr/bin/env python # Example scipt to show integration of a 1D spectrum import nmrglue as ng import numpy as np import matplotlib.pyplot as plt # read in the data from a NMRPipe file dic, data = ng.pipe.read("1d_data.ft") length = data.shape[0] # read in the integration limits peak_list = np.recfromtxt("limits.i...
{"hexsha": "53428f01ceb4c61aaf703b325c2d3e92689e33dd", "size": 1395, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/integration/integrate_1d/integrate_1d.py", "max_stars_repo_name": "genematx/nmrglue", "max_stars_repo_head_hexsha": "8a24cf6cbd18451e552fc0673b84c42d1dcb69a2", "max_stars_repo_licenses": ...
[STATEMENT] lemma comp_wb_lens: "\<lbrakk> wb_lens x; wb_lens y \<rbrakk> \<Longrightarrow> wb_lens (x ;\<^sub>L y)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>wb_lens x; wb_lens y\<rbrakk> \<Longrightarrow> wb_lens (x ;\<^sub>L y) [PROOF STEP] by (unfold_locales, auto simp add: lens_comp_def wb_lens_de...
{"llama_tokens": 161, "file": "Optics_Lens_Algebra", "length": 1}
[STATEMENT] lemma ideal_UNIV: "ideal UNIV" [PROOF STATE] proof (prove) goal (1 subgoal): 1. ideal UNIV [PROOF STEP] unfolding ideal_def left_ideal_def right_ideal_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. (subgroup UNIV \<and> (\<forall>x\<in>UNIV. \<forall>r. r * x \<in> UNIV)) \<and> subgroup UNIV \<and>...
{"llama_tokens": 284, "file": "Echelon_Form_Rings2", "length": 3}
# generate data for tictactoe 4 board sizes ... 3 odd sized and one even import utils as u import numpy as np import h5py batch_size = 128 num_classes = 2 epochs = 40 num_random_matches = 1000000 print("generate data....") print("3x3") board_size = 3 xinput = u.generateGameDataUsingRnd(board_size, num_random_match...
{"hexsha": "fc20e6f502eed491d5f19751b60ca51d1821abe6", "size": 2450, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/generate_tic_tac_toe_data.py", "max_stars_repo_name": "TRex22/vector-AI-ML-term_project", "max_stars_repo_head_hexsha": "70d1cab20966c9c71e38a2f471d60628396c8e5a", "max_stars_repo_licenses": [...
from PIL import Image import numpy as np import ast import cv2 f = open("./source/prototypes/testArray/test.txt", "r") iar = ast.literal_eval(f.read()) rows = len(iar) columns = len(iar[0]) newImg = [] # newImg = iar x = 0 y = 0 while y < rows: newImg.append([]) while x < columns: if iar[y][x] == 0:...
{"hexsha": "98ed962561d0ad4342a8ba6156287021595bf1cf", "size": 1390, "ext": "py", "lang": "Python", "max_stars_repo_path": "source/prototypes/testArray/test.py", "max_stars_repo_name": "JonasHimmetsbergerStudent/ScribbleFight", "max_stars_repo_head_hexsha": "b896a152b26fde5a57cd72cea074c952c4ea0de9", "max_stars_repo_li...
\section{Hierarchization on Full Grids (Unidirectional Principle)} \label{sec:42fullGrids} If $\sgset$ is a full grid $\fgset{\*l}$ (see \cref{sec:21nodalSpaces}), the well-known \up can be used to apply $\linop$ to input data $\vlinin$. As shown in \cref{fig:unidirectionalPrinciple} for a sparse grid, the idea of the...
{"hexsha": "de97606aceccb4710571f00a9be9674e18e0afc5", "size": 8452, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tex/document/42fullGrids.tex", "max_stars_repo_name": "valentjn/thesis-arxiv", "max_stars_repo_head_hexsha": "ae30179e67cd6a7813385e140b609546fd65b897", "max_stars_repo_licenses": ["CC0-1.0"], "max_...
import scipy as sp from ConfigParser import SafeConfigParser config = SafeConfigParser() config.read('xdmft.in') ########################################################### # read the inputs from xdmft.in ########################### # mpi part ################################################ np = 6 if config.has_op...
{"hexsha": "1adc879f9a5e7eed616fb21b21b4263917bca5b9", "size": 3053, "ext": "py", "lang": "Python", "max_stars_repo_path": "params.py", "max_stars_repo_name": "pokornyv/linkTRIQS_2bH", "max_stars_repo_head_hexsha": "8bdc689ef4a3a2ab5ee8de1f6cc66af8406980e4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ...
import pandas as pd import numpy as np from pathlib import Path from datetime import datetime as dt def mergePeople(IDColumn, gameLogs, people): merged = pd.merge(gameLogs[['row','Date',IDColumn]], people, how="left", left_on=[IDColumn], right_on=['playerID']) merged['age'] = (pd.to_datetime(merged['Date']) - ...
{"hexsha": "eb360523150aa6fa3dcfa6e4b470a1b52a1df7aa", "size": 1206, "ext": "py", "lang": "Python", "max_stars_repo_path": "Verworfen/~mlb_merge_people.py", "max_stars_repo_name": "timucini/MLB-DeepLearning-Project", "max_stars_repo_head_hexsha": "2737e9cd32edefec8ec935f304d04206264ce349", "max_stars_repo_licenses": ["...
(** CoLoR, a Coq library on rewriting and termination. See the COPYRIGHTS and LICENSE files. - Frederic Blanqui, 2005-06-17 general results on booleans *) Set Implicit Arguments. From Coq Require Import Arith Lia. From Coq Require Export Bool. From Coq Require Setoid. From CoLoR Require Import LogicUtil. Argumen...
{"author": "sorinica", "repo": "spike-prover", "sha": "f2d6dd0bcebb647e09dd23048753075551da27eb", "save_path": "github-repos/coq/sorinica-spike-prover", "path": "github-repos/coq/sorinica-spike-prover/spike-prover-f2d6dd0bcebb647e09dd23048753075551da27eb/CoLoR/Coq8.16/BoolUtil.v"}
import cv2 import os import numpy as np color_map = { "Animal" : (64, 128, 64 ), "Archway" : (192, 0, 128 ), "Bicyclist" : (0, 128, 192 ), "Bridge" : (0, 128, 64 ), "Building" : (128, 0, 0 ), "Car" : (64, 0,...
{"hexsha": "160485cd8aca3bc5dc912d7aca45eb0371f6b307", "size": 2127, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/test/convert_color_to_label.py", "max_stars_repo_name": "tiger0421/DDRNet.pytorch", "max_stars_repo_head_hexsha": "138cdc61c4cb00104f5051a129c31d603efb02ed", "max_stars_repo_licenses": ["M...
#Jinliang yang #Purpose: Use python code to merge snps from 3 datasets #updated: 7.2.2014 #Note: Running on server 129.186.85.7 run_snp3merge <- function(chr="chr1"){ hmp1 <- paste("/mnt/02/yangjl/DBcenter/VariationDB/HapMap1/hapmap1V2_070214_", chr, ".dsf", sep=""); hmp2 <- paste("/mnt/02/yangjl/DBcenter/Variatio...
{"hexsha": "bd152aa7060f1a07edd2d0f4563789faadcf5e3e", "size": 1968, "ext": "r", "lang": "R", "max_stars_repo_path": "profiling/2.SNP/old/2.A.4_snp_merge.r", "max_stars_repo_name": "yangjl/Heterosis-GWAS", "max_stars_repo_head_hexsha": "454208509c22b1269f17ba63452ef19a9c3d13f8", "max_stars_repo_licenses": ["RSA-MD"], "...
# On Eigendecomposition of Asset Returns ### Francisco A. Ibanez ## Part 1. $\Sigma$ v. $R$ To test some of the outstanding points on the stability of the eigendecomposition of asset returns, we will analyze simulated returns to avoid drawing conclusions from a specific dataset, which might not serve the general case....
{"hexsha": "60262bec7b9e20bf4b173af094f4f12f8559bdd1", "size": 393968, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "notebooks/robust_decomposition.ipynb", "max_stars_repo_name": "fcoibanez/eigenportfolio", "max_stars_repo_head_hexsha": "6e0f6c0239448a191aecf9137d545abf12cb344e", "max_stars_repo_l...
import ngraph as ng import numpy as np import pytest from ngraph.utils.types import get_element_type from tests import xfail_issue_58033 from tests.runtime import get_runtime def einsum_op_exec(input_shapes: list, equation: str, data_type: np.dtype, with_value=False, seed=202104): """Test Eins...
{"hexsha": "fb7581d9160fa9f2b6115ff1cc2292db49e17925", "size": 3583, "ext": "py", "lang": "Python", "max_stars_repo_path": "runtime/bindings/python/tests/test_ngraph/test_einsum.py", "max_stars_repo_name": "monroid/openvino", "max_stars_repo_head_hexsha": "8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6", "max_stars_repo_lice...
DOUBLE PRECISION FUNCTION slZD (HA, DEC, PHI) *+ * - - - * Z D * - - - * * HA, Dec to Zenith Distance (double precision) * * Given: * HA d Hour Angle in radians * DEC d declination in radians * PHI d observatory latitude in radians * * The result is in the range 0...
{"hexsha": "c7376266ba3a5a1a7ea8c35b2b9105a6b0f4cb01", "size": 2675, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "iraf.v2161/math/slalib/zd.f", "max_stars_repo_name": "ysBach/irafdocgen", "max_stars_repo_head_hexsha": "b11fcd75cc44b01ae69c9c399e650ec100167a54", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
import caffe import numpy as np import ast import base64 import csv import random import sys import json import atexit from collections import defaultdict csv.field_size_limit(sys.maxsize) np.random.seed() random.seed() # Memory efficient version of rcnn_layers.py. If you have lots of RAM, # training with rcnn_layer...
{"hexsha": "6b4abc4d48c8c5e41f15958d61ef525a314cc4b2", "size": 8132, "ext": "py", "lang": "Python", "max_stars_repo_path": "layers/efficient_rcnn_layers.py", "max_stars_repo_name": "quangvy2703/Up-Down-Captioner", "max_stars_repo_head_hexsha": "c7c4bc4a36d62f67fe21efdac3c1afcf63432977", "max_stars_repo_licenses": ["MIT...
########################################################################## # MediPy - Copyright (C) Universite de Strasbourg # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # for de...
{"hexsha": "4edb3329828c4a371943eea6b7854752cb516805", "size": 7443, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/medipy/gui/annotations/image_annotation.py", "max_stars_repo_name": "bsavelev/medipy", "max_stars_repo_head_hexsha": "f0da3750a6979750d5f4c96aedc89ad5ae74545f", "max_stars_repo_licenses": ["CE...
from __future__ import division from __future__ import print_function import numpy as np from scipy.stats import rv_discrete, entropy from copy import deepcopy class Infinite2DgridAction(object): def __init__(self, action): self.action = action self._hash = 10*(action[0]+2) + action[1]+2 def...
{"hexsha": "a6ce3ed5c7897e8f7a5c85893ac9a633d789d976", "size": 4701, "ext": "py", "lang": "Python", "max_stars_repo_path": "bamcp/states/infinite_2Dgrid_state.py", "max_stars_repo_name": "mspeekenbrink/mcts", "max_stars_repo_head_hexsha": "a3aac44a9697e9f67c6656dfc1dd3b91666a1633", "max_stars_repo_licenses": ["BSD-2-Cl...
[STATEMENT] lemma tensor_compose_distribution1: assumes wf1:"mat (row_length A1) (length A1) A1" and wf2:"mat (row_length A2) (length A2) A2" and wf3:"mat (row_length B1) (length B1) B1" and wf4:"mat (row_length B2) (length B2) B2" and matchAA:"length A1 = row_length A2" and matchBB:"length B1 = ro...
{"llama_tokens": 3907, "file": "Matrix_Tensor_Matrix_Tensor", "length": 29}
[STATEMENT] lemma disj_convr [simp]: "(p \<or> q)\<^sup>- = (q\<^sup>- \<or> p\<^sup>-)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (p \<or> q)\<^sup>- = (q\<^sup>- \<or> p\<^sup>-) [PROOF STEP] by (pred_auto)
{"llama_tokens": 108, "file": "UTP_utp_utp_rel_laws", "length": 1}
import numpy as np import pytest from ddtruss import Truss, DataDrivenSolver points = np.array([[0, 0], [1, 0], [0.5, 0.5], [2, 1]]) lines = np.array([[0, 2], [1, 2], [1, 3], [2, 3]], dtype=int) truss = Truss(points, lines) E = 1.962e11 A = [2e-4, 2e-4, 1e-4, 1e-4] U_dict = {0: [0, 0], 1: [0, 0]} F_dict = {3: [0, -...
{"hexsha": "e494747ad6589e1234241f26ac62dacfe6cecd8c", "size": 998, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_truss.py", "max_stars_repo_name": "deeepeshthakur/ddtruss", "max_stars_repo_head_hexsha": "86aa945d577c6efe752099eee579386762942289", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
#ifndef STAN_MATH_REV_MAT_FUN_COV_EXP_QUAD_HPP #define STAN_MATH_REV_MAT_FUN_COV_EXP_QUAD_HPP #include <stan/math/rev/core.hpp> #include <stan/math/rev/scal/fun/value_of.hpp> #include <stan/math/prim/mat/fun/Eigen.hpp> #include <stan/math/prim/scal/err/check_not_nan.hpp> #include <stan/math/prim/scal/err/check_positiv...
{"hexsha": "4b0e16e53a8de7c8b5ae219c95450900d781846d", "size": 9033, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "stan/math/rev/mat/fun/cov_exp_quad.hpp", "max_stars_repo_name": "sakrejda/math", "max_stars_repo_head_hexsha": "3cc99955807cf1f4ea51efd79aa3958b74d24af2", "max_stars_repo_licenses": ["BSD-3-Clause"]...
[STATEMENT] lemma lens_plus_eq_left: "\<lbrakk> X \<bowtie> Z; X \<approx>\<^sub>L Y \<rbrakk> \<Longrightarrow> X +\<^sub>L Z \<approx>\<^sub>L Y +\<^sub>L Z" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>X \<bowtie> Z; X \<approx>\<^sub>L Y\<rbrakk> \<Longrightarrow> X +\<^sub>L Z \<approx>\<^sub>L Y +\<...
{"llama_tokens": 175, "file": "Optics_Lens_Order", "length": 1}
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np def plot_inset_image(ax, x_pos, y_pos, filename, img_height = 1, img_width = -1, format = "png", ignore_aspect = False, return_fig_dimensions = False): """ Plot specified image on the given axis. Only img_height or img_width is ne...
{"hexsha": "6999d69d4e08d76362f2b2a393739d58409dca60", "size": 2006, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_visualization/plot_inset_image.py", "max_stars_repo_name": "CashabackLab/DataVisualization", "max_stars_repo_head_hexsha": "91b2a2d6020ae2fb5b8277f5c7bca69d620be1cb", "max_stars_repo_licenses...
module variableKind !! Defines variable kinds use, intrinsic :: iso_fortran_env, only: i8=>int8, i16=>int16, i32=>int32, i64=>int64 use, intrinsic :: iso_fortran_env, only: r32=>real32, r64=>real64 integer(i32), parameter :: cLen = 1024 !! Default character length for temporaries end module
{"hexsha": "46d095eb9b90e530757518a4d6b6399c36504128", "size": 312, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/core/m_variableKind.f90", "max_stars_repo_name": "leonfoks/coretran", "max_stars_repo_head_hexsha": "bf998d4353badc91d3a12d23c78781c8377b9578", "max_stars_repo_licenses": ["BSD-3-Clause"], "m...
# Defines different storages for zarr arrays. Currently only regular files (DirectoryStore) # and Dictionaries are supported abstract type AbstractStore end #Define the interface """ storagesize(d::AbstractStore) This function shall return the size of all data files in a store. """ function storagesize end """ ...
{"hexsha": "5b56bbc0d119b3e39c9eafd0052a5463549d6dd7", "size": 2835, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Storage/Storage.jl", "max_stars_repo_name": "manics/Zarr.jl", "max_stars_repo_head_hexsha": "a3662f17c8d7f50a4b8bf2961e18865409cee85e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
#!/usr/bin/env python2.7 # __BEGIN_LICENSE__ # # Copyright 2012 Stanford University. All rights reserved. # # __END_LICENSE__ # calibrate.py # # Usage: calibrate.py <calibration_dir> # # This script re-runs the calibration from a set of calibration images # captured by the uScope GUI. This script is mostly useful f...
{"hexsha": "3c982e130f2d0483d0cc8229e5d9c72a1cee2d6c", "size": 15373, "ext": "py", "lang": "Python", "max_stars_repo_path": "stanford_lfanalyze_v0.4/lfcalibrate.py", "max_stars_repo_name": "pauledgarson/FlyLFM-Paul", "max_stars_repo_head_hexsha": "aa7e8fcae630e7db7322219437cbc0b47d4598a7", "max_stars_repo_licenses": ["...
import numpy as np import scipy.stats as scipystats import torch.nn as nn import torch import os import matplotlib.pyplot as plt import scipy.misc as sm import cv2 import random def get_1x(model): b = [] name = [] b.append(model.module.Scale.conv1) b.append(model.module.Scale.bn1) b.append(model.m...
{"hexsha": "cc8c9e5add9d17a27da0acd58ddf824c1e6ba4f9", "size": 1277, "ext": "py", "lang": "Python", "max_stars_repo_path": "training/get.py", "max_stars_repo_name": "birdman9390/MetaMaskTrack", "max_stars_repo_head_hexsha": "8d2e13fbf31f69008f2d02724e71ba7d87aefbbb", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
''' Jake Elkins built this boi spacecraft attitude control simulator, built in the OpenAI gym format for easy interface with popular RL libraries. this one is continuous control. ''' import gym from gym import spaces, logger import numpy as np from numba import jit class AttitudeControlEnv(gym.Env): # ---- t...
{"hexsha": "30eed94a41bcfb66078454a059b90873081ba10d", "size": 9190, "ext": "py", "lang": "Python", "max_stars_repo_path": "envs/ADCS_gym_cont.py", "max_stars_repo_name": "jakeelkins/rl-attitude-control", "max_stars_repo_head_hexsha": "3f268f96fecf5f1b3194b2927e0c494ce731adf6", "max_stars_repo_licenses": ["MIT"], "max_...
##### ### This is the specialized code I wrote to simplify the similarity ### data. There is otherwise too much variation to find patterns. ### We use binning to reduce values to categorical values. ### For most of the analysis we simply reduce it to whole ### percents. ##### using DataFrames, DataArrays """ find...
{"hexsha": "f44f63274fb4b115b700acec7c7e74045481fb85", "size": 3836, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "DataFrameBinning.jl", "max_stars_repo_name": "Nectarineimp/PlayerSessionGap.jl", "max_stars_repo_head_hexsha": "eae287801b3743a7546d9ae73fdea0d520b37e2d", "max_stars_repo_licenses": ["MIT"], "max_s...
[STATEMENT] lemma finite_deriv: "finite (deriv s) = (\<exists>m. f [s] m = [])" [PROOF STATE] proof (prove) goal (1 subgoal): 1. finite (deriv s) = (\<exists>m. f [s] m = []) [PROOF STEP] apply(rule) [PROOF STATE] proof (prove) goal (2 subgoals): 1. finite (deriv s) \<Longrightarrow> \<exists>m. f [s] m = [] 2. \<ex...
{"llama_tokens": 5583, "file": "Verified-Prover_Prover", "length": 39}
[STATEMENT] lemma ord_one[simp]: "ord \<one> = 0" [PROOF STATE] proof (prove) goal (1 subgoal): 1. ord \<one> = 0 [PROOF STEP] using Zp.nonzero_one_closed local.frac_one ord_of_frac [PROOF STATE] proof (prove) using this: \<one>\<^bsub>Z\<^sub>p\<^esub> \<in> nonzero Z\<^sub>p ?a \<in> nonzero Z\<^sub>p \<Longrightarr...
{"llama_tokens": 253, "file": "Padic_Field_Padic_Fields", "length": 2}
!** Copyright (c) 1989, 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 a copy of the License at !** !** http://www.apache.org/licenses/LICENSE-2.0 !** !** Unless...
{"hexsha": "ca29461f8f6451615b4a04b31434b80f9f0d6eb2", "size": 2483, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "test/f90_correct/src/mmulR4mxv_t.f90", "max_stars_repo_name": "kammerdienerb/flang", "max_stars_repo_head_hexsha": "8cc4a02b94713750f09fe6b756d33daced0b4a74", "max_stars_repo_licenses": ["Apache...
####################################################### # # # This file is test # # maybe contains wrong logical operation # # ignore this file # # ...
{"hexsha": "d5c27fb833c66f2a67bb953d2bde1b8ff3d6f3fb", "size": 1587, "ext": "py", "lang": "Python", "max_stars_repo_path": "Q10/Q10_test.py", "max_stars_repo_name": "AliRezaBeigy/MultiMediaCourse", "max_stars_repo_head_hexsha": "069e8e438b273c9dbc093be0badb02c3d9b50d72", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
""" Copyright (c) 2019 Microsoft Corporation. All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,...
{"hexsha": "61c4e965091bbebd1e7b007a0c199c0c90d56247", "size": 17916, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/sr_dataset.py", "max_stars_repo_name": "gaochangfeng/pykaldi2", "max_stars_repo_head_hexsha": "5e988e5968aa9a5867f8179e6c53ea715ac46bdc", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
#include <iostream> #include "HexGridPrint.hpp" #include <boost/lexical_cast.hpp> HexGridPrint::HexGridPrint(int i_width,int i_height, bool i_ULStart,bool i_LowShort): m_width(i_width), m_height(i_height), m_ULStart(i_ULStart), m_LowShort(i_LowShort), m_grid(2+5*i_width,1+4*i_heigh...
{"hexsha": "95f9890ebf5f517bb7c9498d0a172d3579a4011c", "size": 2069, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "VideoGameAssistants/PuzzlePirates/Alchemy/HexGridPrint.cpp", "max_stars_repo_name": "chiendarrendor/AlbertsMisc", "max_stars_repo_head_hexsha": "f017b29f65d1d47eb22db66dff0b6d2145794fc8", "max_stars...
[STATEMENT] theorem homeomorphic_monotone_image_interval: fixes f :: "real \<Rightarrow> 'a::{real_normed_vector,complete_space}" assumes cont_f: "continuous_on {0..1} f" and conn: "\<And>y. connected ({0..1} \<inter> f -` {y})" and f_1not0: "f 1 \<noteq> f 0" shows "(f ` {0..1}) homeomorphic {0..1:...
{"llama_tokens": 239616, "file": null, "length": 1419}
import numpy as np import schnell as snl import matplotlib.pyplot as plt from matplotlib import rc rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']}) rc('text', usetex=True) t_obs = 1 f_ref = 63 nside = 64 obs_time = t_obs*365*24*3600. freqs = np.linspace(10., 1010., 101) dets = [snl.Gr...
{"hexsha": "1baf13c33c8af2896e5c701f2bcbe93cba9095ab", "size": 1740, "ext": "py", "lang": "Python", "max_stars_repo_path": "plots/Nell_alpha.py", "max_stars_repo_name": "damonge/SNELL", "max_stars_repo_head_hexsha": "4bb276225fce8f535619d0f2133a19f3c42aa44f", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun...
import numpy as np minX = 206 maxX = 250 minY = -57 maxY = -105 distance = 0 speed = [] xarray = [] heightarray = [] def partOne(): j = abs(maxY)-1 tempheight = [] height = 0 count = 0 while height > maxY: height += (j + count * -1) count += 1 tempheight.append(height) print(max(tempheight), 'is the max h...
{"hexsha": "fadf725325784121bc477971df671a8103dac98b", "size": 1092, "ext": "py", "lang": "Python", "max_stars_repo_path": "Day17.py", "max_stars_repo_name": "SheepiCagio/Advent-of-Code-2021", "max_stars_repo_head_hexsha": "52f0035da2cb258810d8947cbf56b51b65a9fe8b", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
import pyspark.sql.functions as F #import spark_object_storage_demo_python.ibm_cos_helper as ibm_cos import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from s...
{"hexsha": "f69701f0b77dcb6cc80016a2a94007b74fb8c5d1", "size": 4737, "ext": "py", "lang": "Python", "max_stars_repo_path": "spark_object_storage_demo_python/spark_object_storage_demo_python/mission.py", "max_stars_repo_name": "nicolas2lee/Big-data-architecture", "max_stars_repo_head_hexsha": "45379068398ec0a8e4208436b9...
import chainer import h5py import numpy as np import pandas as pd class HDF5VideoDataset(chainer.dataset.DatasetMixin): def __init__(self, n_frames, h5path, config_path, img_size, label=False, stride=1, xmargin=0, xflip=False): self.n_frames = n_frames self.h5path = h5path ...
{"hexsha": "5687e271080c43069593263ca00bf9b75e226260", "size": 2463, "ext": "py", "lang": "Python", "max_stars_repo_path": "tgan2/datasets/h5video.py", "max_stars_repo_name": "wilson1yan/tgan2", "max_stars_repo_head_hexsha": "5373136cff7af4241c9d0b1bac1357f08a509d28", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
from __future__ import absolute_import from __future__ import print_function import sys import glob import time import numpy as np import pandas as pd import os.path import time import datetime import re from keras.preprocessing import sequence from keras.optimizers import SGD, RMSprop, Adagrad from keras.utils impor...
{"hexsha": "2ceb79540e687b214199373bce7ea13273c8c7be", "size": 51403, "ext": "py", "lang": "Python", "max_stars_repo_path": "ufcnn-keras/models/UFCNN1_REPO_V16_TESTMODE.py", "max_stars_repo_name": "mikimaus78/ml_monorepo", "max_stars_repo_head_hexsha": "b2c2627ff0e86e27f6829170d0dac168d8e5783b", "max_stars_repo_license...
using BenchmarkTools, AssociatedLegendrePolynomials, Markdown dotune = "--tune" in ARGS saveres = "--save" in ARGS const PARAMS_PATH = joinpath(dirname(@__FILE__), "params.json") const SUITE = BenchmarkGroup() const ASSERTS = BenchmarkGroup() const LMAX = 700 const MMAX = 350 const NORMS = (LegendreUnitNorm(), ...
{"hexsha": "d97308d2a6aedc9af73a924cef837e69136c93bd", "size": 4358, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "bench/benchmark.jl", "max_stars_repo_name": "jmert/LegendrePolynomials.jl", "max_stars_repo_head_hexsha": "b0df887a93570e176e8521faca3d8ea7a233d10b", "max_stars_repo_licenses": ["MIT"], "max_stars_...
""" This script/module includes the functions to produce the noise estimate used to determine the best aperture method to use. This function is used in getPeriodograms.py. This script includes a way to estimate the amplitude of a light curve signal; but is depracated since it did not yield good results in determining ...
{"hexsha": "12635436513e1b24a6b716d770e2ae88f04411b5", "size": 4766, "ext": "py", "lang": "Python", "max_stars_repo_path": "LCFeatureExtraction.py", "max_stars_repo_name": "AstroJosePC/TESSDataExploration", "max_stars_repo_head_hexsha": "3bb15d555ce9465a1ce4becd4ef62d2bf091d68d", "max_stars_repo_licenses": ["MIT"], "ma...
import numpy as np # a = np.array([1, 2, 3]); # print(a) # b = a * 2 # print(b) # b = a / 255 # print(b) # c = np.max(a) # print(c) # b = np.arange(10); # print(b) # ndim:返回数组的维数 a = np.arange(24); print(a) print(a.ndim) # 1 # numpy.reshape: 在不改变数据的条件下修改形状 b = a.reshape(2, 4, 3); print(b) print(b.ndim) # 3
{"hexsha": "7677693c963a1cabd81aa5928e9020b4152f1194", "size": 313, "ext": "py", "lang": "Python", "max_stars_repo_path": "aura/AI Engineer/course2_20191117/a1_python_lib/numpy/test.py", "max_stars_repo_name": "linksdl/futuretec-project-coursera_cerficates", "max_stars_repo_head_hexsha": "278a533501b702abd90ac3124739d3...
# Copyright (c) 2016-present, Facebook, Inc. # # 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...
{"hexsha": "c6500e4e77899af0ffca008db8e0d4e712bf3177", "size": 1621, "ext": "py", "lang": "Python", "max_stars_repo_path": "caffe2/python/test_util.py", "max_stars_repo_name": "KevinKecc/caffe2", "max_stars_repo_head_hexsha": "a2b6c6e2f0686358a84277df65e9489fb7d9ddb2", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from linear_regression import Linear_regression def Call_myLRmodel(data): # add ones column data.insert(0, 'Ones', 1) # set X (training data) and y (target variable) cols = data.shape[1] X = data.iloc[:,0:cols-1] y = data....
{"hexsha": "b122d2daee4bc8519b137b6b9dad3f875f082d59", "size": 1992, "ext": "py", "lang": "Python", "max_stars_repo_path": "practice_ML/Linear_regression/multi_features.py", "max_stars_repo_name": "ives-kwy/run_ml", "max_stars_repo_head_hexsha": "17fd549bb28a731102dae1f12e2f273f314417ab", "max_stars_repo_licenses": ["M...