text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
from numpy.distutils.core import setup, Extension
from distutils.dir_util import copy_tree
from distutils.errors import DistutilsFileError
import os, sys
from shutil import copyfile
# get version number
def get_version_number():
for l in open('wfnsympy/__init__.py', 'r').readlines():
if not(l.find('__vers... | {"hexsha": "a509db54e275750f057de5c7a22fda7163529c91", "size": 3594, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/setup.py", "max_stars_repo_name": "abelcarreras/WFNSYM", "max_stars_repo_head_hexsha": "81f97dc1861b4acf404c9b4c631fbf8d20f84768", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
#!python3
import argparse
import pandas as pd
import numpy as np
from scipy.optimize import brentq
from plot_module import *
if __name__ == '__main__':
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-o', '--output', default="theoretical_eq", type=s... | {"hexsha": "7beba3c58ca93541e4a4454ad37125e08145ccdd", "size": 3552, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/theoretical_equilibrium.py", "max_stars_repo_name": "ThibaultLatrille/GenotypePhenotypeFitness", "max_stars_repo_head_hexsha": "d1a8c4b928dfae3d9f34ed7f1702402c0528e185", "max_stars_repo_l... |
from simpleabc import simple_abc
from astropy.io import ascii
import simple_model
import numpy as np
import pickle
import pylab as plt
from scipy import stats
import time
import triangle
import matplotlib
from scipy.optimize import minimize
# plt.style.use('ggplot')
# matplotlib.rcParams['legend.numpoints'] = 1
# matp... | {"hexsha": "f0b57d22310240d346cd1f069ef6e18c717c1443", "size": 4356, "ext": "py", "lang": "Python", "max_stars_repo_path": "abcplot.py", "max_stars_repo_name": "rcmorehead/simplanets", "max_stars_repo_head_hexsha": "3d9b3d1273a4f1a32ce656bdf5e9d6c6c38e3f7b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
import os
import copy
import yaml
import argparse
import numpy as np
from easydict import EasyDict as edict
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeEr... | {"hexsha": "1cf7f14c3b4b57353a8d0fa57e4c0da6280cf5da", "size": 5083, "ext": "py", "lang": "Python", "max_stars_repo_path": "common_pytorch/config_pytorch_api.py", "max_stars_repo_name": "klo9klo9kloi/win_det_heatmaps", "max_stars_repo_head_hexsha": "fc427bcd593831d627698455b8917eb37add3f6e", "max_stars_repo_licenses": ... |
function ExchangeRxnMatrix = createXMatrix(compoundsIn, transport, compartment)
% Creates a matrix full of exchange reactions based
% on the input list (creates an exchange reaction for each of the
% metabolites present in the model)
%
% USAGE:
%
% ExchangeRxnMatrix = createXMatrix(compoundsIn, transport, compartmen... | {"author": "opencobra", "repo": "cobratoolbox", "sha": "e60274d127f65d518535fd0814d20c53dc530f73", "save_path": "github-repos/MATLAB/opencobra-cobratoolbox", "path": "github-repos/MATLAB/opencobra-cobratoolbox/cobratoolbox-e60274d127f65d518535fd0814d20c53dc530f73/src/reconstruction/refinement/createXMatrix.m"} |
# STATE MACHINE FOR 3D PICK AND PLACE SIMULATION
import numpy as np
from numpy.linalg import norm
from math import *
from matplotlib import pyplot as plt
from matplotlib.patches import Polygon
from random import random
from scipy.spatial import ConvexHull
from matplotlib import path
import time
from mpl_toolkits import... | {"hexsha": "953762d60dc3d00b4542b2ac09a09434fdf96aaa", "size": 5884, "ext": "py", "lang": "Python", "max_stars_repo_path": "python_src/rrts/3D/arm_state_machine.py", "max_stars_repo_name": "Abeilles14/motion_planning", "max_stars_repo_head_hexsha": "4eaf17abe85c3a0909b6f126b761956756d8ef34", "max_stars_repo_licenses": ... |
#-*-coding:utf-8-*-
import os.path
import random
import torchvision.transforms as transforms
import torch
import random
from data.base_dataset import BaseDataset
from data.image_folder import make_dataset
from PIL import Image
import numpy as np
class AlignedDataset(BaseDataset):
def initialize(self, opt):
... | {"hexsha": "553ec6b27399c7f3a89fc91e2498146e469f571b", "size": 3472, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/aligned_dataset.py", "max_stars_repo_name": "Taye310/Shift-Net_pytorch", "max_stars_repo_head_hexsha": "1b4ad0529e50365612bdb0ba4cd29be84d174429", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# Knapsack Cover Inequalities
Consider the 0-1 knapsack Set
$K := \Big\{\{0, 1\}^{n} : \sum_{j = 1}^n w_j x_j \le b \Big\}, w_j > 0, \forall j \in N = \{1, 2, ..., n\}, b > 0$
**Definition (Cover)** A set $C \subseteq N$ is a *cover* if $\sum_{j \in C} w_j > b$. A cover is minimal if $\sum_{j \in C \backslash \{j\}... | {"hexsha": "8b22ad0ac33ee7fae305741ee5d7afea45c49e74", "size": 19298, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "Knapsack Cover Inequalities/Knapsack Cover Inequalities notebook.ipynb", "max_stars_repo_name": "prameshk/Discrete-Optimization", "max_stars_repo_head_hexsha": "7cfb1e0977ab071ba5faf... |
import Pkg; Pkg.add(Pkg.PackageSpec(url="https://github.com/JuliaComputing/JuliaAcademyData.jl"))
using JuliaAcademyData; activate("Foundations of machine learning")
# ## Intro to neurons
#
# At this point, we know how to build models and have a computer automatically learn how to match the model to data. This is the ... | {"hexsha": "ca25ed8dc5b7c41ed177b3cb68fe18ee72f1061b", "size": 4496, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Courses/Foundations of machine learning/1100.Intro-to-neurons.jl", "max_stars_repo_name": "fercarozzi/JuliaAcademyMaterials", "max_stars_repo_head_hexsha": "4c7501d42e698379050fd6e6d469f3f84428cdcd... |
[STATEMENT]
lemma Linear_order_underS_above_Field:
assumes LIN: "Linear_order r" and IN: "a \<in> Field r"
shows "Field r = underS r a \<union> above r a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Field r = underS r a \<union> above r a
[PROOF STEP]
proof(unfold underS_def above_def, auto)
[PROOF STATE]
proof (... | {"llama_tokens": 4128, "file": null, "length": 27} |
import numpy as np
from keras import backend as K
from keras import Input, Model
from keras.layers import Conv3D, MaxPooling3D, UpSampling3D, Activation, Conv3DTranspose, Concatenate, BatchNormalization
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, EarlyStopping
import tensorflow as tf... | {"hexsha": "073ace9a826a9ff95246ccfaca9f87a9840b1a06", "size": 5820, "ext": "py", "lang": "Python", "max_stars_repo_path": "unet_3d_keras.py", "max_stars_repo_name": "fengcls/3D-Segmentation", "max_stars_repo_head_hexsha": "c9fec9593ca3744608a63f6ecbef21035caeba82", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#!/usr/bin/env python3
import cv2
import glob
import numpy as np
import os
import pprint
import rospkg
import rospy
import sched
import sys
import time
import traceback
from cv_bridge import CvBridge, CvBridgeError
from datetime import datetime
from rospy.numpy_msg import numpy_msg
from std_msgs.msg import String, Fl... | {"hexsha": "f93c223380c73a339f0cafea788e68e7c47daff4", "size": 9782, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/localization/scripts/run_localization.py", "max_stars_repo_name": "p-amonpitakpun/cpcu-delivery", "max_stars_repo_head_hexsha": "b7299cbc56a2b8a1415797e15e2c8032964af56b", "max_stars_repo_lice... |
#!/usr/local/sci/bin/python
#***************************************
# 7th May 2015
# This version reads in from /data/local/hadkw/HADCRUH2
# 7 May 2015 KMW - v1
# Reads in monthly mean anomalies for candidate (q and RH)
# Reads in the global mean time series for the candidate (q and RH)
# Reads in the global mean ti... | {"hexsha": "c2da6511531ece05c7705249aa39b07ddab178a2", "size": 28753, "ext": "py", "lang": "Python", "max_stars_repo_path": "PYTHON/PlotCorrMapTS_MAY2015.py", "max_stars_repo_name": "Kate-Willett/Climate_Explorer", "max_stars_repo_head_hexsha": "d49e65a6caa9beb1a859e16d3827022442bad324", "max_stars_repo_licenses": ["CC... |
'''
Investigating the offset of CIV emission in the Cloudy models
as a function of ionization, nebular metallicity, stellar metallicity,
stellar population type, age, etc.
'''
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from scipy.optimize import curve_... | {"hexsha": "975efdfaab5c5e48a5f4e89aadc64f61880753bd", "size": 6521, "ext": "py", "lang": "Python", "max_stars_repo_path": "modeling/offsets_civ.py", "max_stars_repo_name": "aibhleog/simply-spectra", "max_stars_repo_head_hexsha": "36534061dfba2bf9214c5334dc94e6b2998c7bcc", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# combination of prep_save.jl and align_prep.jl.
# Loads from NMR experiment instead of intermediate BSON file.
import NMRDataSetup
import NMRSpectraSimulator
import NMRSpecifyRegions
include("../src/NMRCalibrate.jl")
import .NMRCalibrate
#import NMRCalibrate
using LinearAlgebra
using FFTW
import PyPlot
#import Plo... | {"hexsha": "4c4a0ba43a184b807781ed5ed8c58c95b8226482", "size": 9495, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "example/prep_full.jl", "max_stars_repo_name": "AI4DBiological-Systems/NMRCalibrate.jl", "max_stars_repo_head_hexsha": "5d955b10eb7a3f9bdfaf6c88990d06c84c1f0dcc", "max_stars_repo_licenses": ["MIT"],... |
#include <bacs/problem/utility.hpp>
#include <bacs/problem/error.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/property_tree/ini_parser.hpp>
namespace bacs::problem {
BUNSAN_FACTORY_DEFINE(utility)
namespace {
std::string get_builder(const boost::property_tree::ptree &config) {
// note: "no" is... | {"hexsha": "2884827cce216c1dc88bf1215019743831ab1a0b", "size": 2246, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "bacs/problem/src/utility.cpp", "max_stars_repo_name": "bacsorg/bacs", "max_stars_repo_head_hexsha": "2b52feb9efc805655cdf7829cf77ee028d567969", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
[STATEMENT]
lemma linear_order_cases:
"((x::'a::linear_order) \<sqsubseteq> y \<Longrightarrow> C) \<Longrightarrow> (y \<sqsubseteq> x \<Longrightarrow> C) \<Longrightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>x \<sqsubseteq> y \<Longrightarrow> C; y \<sqsubseteq> x \<Longrightarrow> C\<r... | {"llama_tokens": 133, "file": null, "length": 1} |
"""
Title: Image classification with TNT(Transformer in Transformer)
Author: [ZhiYong Chang](https://github.com/czy00000)
Date created: 2021/10/25
Last modified: 2021/11/29
Description: Implementing the Transformer in Transformer (TNT) model for image classification.
"""
"""
## Introduction
This example implements th... | {"hexsha": "f364fdc92baef80e9abc7818de3cb8928dee39b6", "size": 11905, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/vision/transformer_in_transformer.py", "max_stars_repo_name": "czy00000/keras-io", "max_stars_repo_head_hexsha": "3a9f1500ad62360ec5518220a3f98200ab821723", "max_stars_repo_licenses": ["... |
#!/usr/bin/env python3
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import tensorflow as tf
from src.img.tfreader import tf_dataset, tf_imread, tf_imreadpair
@pytest.fixture
def mapfile_df():
filepath = "./src/tests/test_data/mnist_small/pytest_mapfile.csv"
return pd.read_c... | {"hexsha": "b53d4e5740b109237144ebf5c8da0c712ef47cbe", "size": 1667, "ext": "py", "lang": "Python", "max_stars_repo_path": "{{ cookiecutter.repo_name }}/src/tests/test_tfreader.py", "max_stars_repo_name": "jnirschl/cookiecutter-data-science", "max_stars_repo_head_hexsha": "b27bf00280c0aa4b437290eb4f3d45579214ed7f", "ma... |
#define BOOST_SPIRIT_USE_PHOENIX_V3
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix.hpp>
#include <boost/spirit/include/support_multi_pass.hpp>
#include <boost/spirit/include/classic_position_iterator.hpp>
#include <boost/phoenix/function/adapt_function.hpp>
namespace qi = boost::spi... | {"hexsha": "2406f6c73e8a978c186e04e11d489f23ff640a70", "size": 4597, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "C++/src/bio/spirit/sandbox/iterator-concept-check-2.cpp", "max_stars_repo_name": "JohnReid/biopsy", "max_stars_repo_head_hexsha": "1eeb714ba5b53f2ecf776d865d32e2078cbc0338", "max_stars_repo_licenses... |
# coding: utf-8
import torch
from torch.nn import functional as F
import torch.utils.data
import torch.utils.data.distributed
from torch import autograd
import numpy as np
from torch.autograd import Variable
from torch import nn
import torchvision
from torchvision import transforms
import sys
class Trainer(object):
... | {"hexsha": "a4495af9f38249d213b20bdcb0706c9ea40b1d3d", "size": 7828, "ext": "py", "lang": "Python", "max_stars_repo_path": "gan_training/train_BiGAN.py", "max_stars_repo_name": "coupriec/enc_dec", "max_stars_repo_head_hexsha": "5e31a1cd384f24ac48e932b623780bd0c70103d9", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import numpy as np
import pandas as pd
import argparse
from sklearn.linear_model import LogisticRegression
import glob
import os
from utils import get_all_scores
def get_gathered_features_labels_videoids(ground_truth_files_dir, dump_dir, label_name_to_label_id_dict, transposed, loadtext):
# Gathering the features ... | {"hexsha": "dc77a026d2b9cd4bc8b355a8204f4c9260da09c7", "size": 14491, "ext": "py", "lang": "Python", "max_stars_repo_path": "utility/perform_linear.py", "max_stars_repo_name": "dipika-singhania/ICC-Semi-Supervised-TAS", "max_stars_repo_head_hexsha": "b92309a7af0fd02935cd9ebc7619976b1be30fb3", "max_stars_repo_licenses":... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
selfsupervised3d.dataset.context
datasets to support context encoder-style self-supervised learning methods
References:
[1] D. Pathak et al. "Context encoders: Feature learning by inpainting."
CVPR. 2016.
Author: Jacob Reinhold (jacob.reinhold@jhu.edu)
C... | {"hexsha": "a0462759e6f6d37cdbc6cf1321d04bc409785728", "size": 5190, "ext": "py", "lang": "Python", "max_stars_repo_path": "selfsupervised3d/dataset/context.py", "max_stars_repo_name": "jcreinhold/selfsupervised3d", "max_stars_repo_head_hexsha": "735f0b8d0e5344fd7692649523a13a7c04ac2584", "max_stars_repo_licenses": ["A... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import sys
import pytest
_DEFAULT_DEVICE_ID = -1
def pytest_addoption(parser):
... | {"hexsha": "53c835abbc4d4c40ebf3b50113edd8fe72d35480", "size": 1616, "ext": "py", "lang": "Python", "max_stars_repo_path": "bindings/python/cntk/conftest.py", "max_stars_repo_name": "oplatek/CNTK", "max_stars_repo_head_hexsha": "35f05cbf7b14bf10e1b4207eaf1cfd4cc7e252b4", "max_stars_repo_licenses": ["RSA-MD"], "max_star... |
[STATEMENT]
lemma mult_imp_less_multiset\<^sub>H\<^sub>O:
"(M, N) \<in> mult {(x, y). x < y} \<Longrightarrow> less_multiset\<^sub>H\<^sub>O M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (M, N) \<in> mult {(x, y). x < y} \<Longrightarrow> less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
unfolding multp_def[of ... | {"llama_tokens": 375, "file": null, "length": 3} |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:hydrogen
# text_representation:
# extension: .py
# format_name: hydrogen
# format_version: '1.3'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %%
import matplot... | {"hexsha": "87787c99391bf67b391a465f929dd6bc70414412", "size": 3368, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/hazma_paper/scalar_spectra_ann_to_med.py", "max_stars_repo_name": "LoganAMorrison/Hazma", "max_stars_repo_head_hexsha": "e9612729767ff48d5ce50633393f81ee021242d2", "max_stars_repo_licens... |
module kind_spec
integer, parameter :: rprec = selected_real_kind(12,100)
integer, parameter :: iprec = selected_int_kind(8)
integer, parameter :: dp = rprec
end module kind_spec
| {"hexsha": "bcb75a30cb2e2c913b8f9f65510dbf9938076359", "size": 209, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/vmec_auxmod/kind_spec.f", "max_stars_repo_name": "jonathanschilling/VMEC_6_90", "max_stars_repo_head_hexsha": "5a63cc2b475038560d8e81de1ddae477d6f8ddec", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
from fastats.maths.correlation.pearson import pearson_pairwise
from fastats.scaling.scaling import rank
def spearman(x, y):
"""
Calculates the Spearman rank correlation
coefficient for the inputs `x` and `y`.
If there are any Nan values in the data,
they will be ignored in th... | {"hexsha": "e279d252ee580413e442950c227c1f07bcd01ba5", "size": 1497, "ext": "py", "lang": "Python", "max_stars_repo_path": "fastats/maths/correlation/spearman.py", "max_stars_repo_name": "rjenc29/fastats", "max_stars_repo_head_hexsha": "2fcbe15de721bcc20cac3612da34c7efa5f1c9d6", "max_stars_repo_licenses": ["MIT"], "max... |
program P0208
c>> 1997-06-20 Krogh Generate plots for ch02-08.tex
integer MAXPT
real RMAXPT, XA, XB, XSIZE, YSIZE
parameter (MAXPT=101, RMAXPT=101.E0)
parameter (XA = 0.0E0, XB = 1.0E0)
parameter (XSIZE=3.2E0, YSIZE=2.5E0)
real DX, OPT(19), X(MAXPT), Y(MAXPT, 2)
external ... | {"hexsha": "9d18f92a21d79a93e0ada39fc39a5f3f602e8467", "size": 1367, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/MATH77/demo/extras/pl02-08.f", "max_stars_repo_name": "jacobwilliams/math77", "max_stars_repo_head_hexsha": "b562d09e191e99eba8a5bedfec45acf7461203b1", "max_stars_repo_licenses": ["BSD-3-Claus... |
#define E_OK (0)
#define E_SYSTEM_ERROR (-1)
#define E_BAD_ARGUMENT (-2)
#define E_POSTED (-3)
#define E_CONNECTED (-4)
#define E_BAD_STATE (-5)
#define E_NO_ROOM (-6)
#define E_NOT_POSTED (-7)
#define E_UNKNOWN_COMMAND (-8)
#define E_NO_MATCH (-9)
#define E_NOT_SELECTABLE (-10)
#define E_NOT_CONNECTED ... | {"hexsha": "9eaee4394f0a193bc4b9fb3c0430e248a6337185", "size": 16854, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/form.jl", "max_stars_repo_name": "turingcomplete-/NCurses.jl", "max_stars_repo_head_hexsha": "b1e51ed54c19b162bef7d5f50e5cb52e8785ebd2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
# -*- coding: utf-8 -*-
import numpy as np
import pickle
from keras.models import model_from_json
labelencoder_X_contact = pickle.load(open('labelencoder_X_contact.p', 'rb'))
labelencoder_X_default = pickle.load(open('labelencoder_X_default.p', 'rb'))
labelencoder_X_education = pickle.load(open('labelencoder_X_educat... | {"hexsha": "51554bf388c3c3d073f4558cff27f190d5d55c79", "size": 2029, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "wehouse/purchase-or-not", "max_stars_repo_head_hexsha": "4d89f165692d8798d1a66713d79d63e33aac33c3", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
\chapter{Introduction}
| {"hexsha": "f4ec3a17d6005b36f65dcb1fe4da9cc89f3ca1c8", "size": 23, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "latex_simplest_report/fichiers/chapitres/intro.tex", "max_stars_repo_name": "amoulis/LaTeX_templates", "max_stars_repo_head_hexsha": "a7e755fa202a23873955ae5cde5fa2bf8f6dd34b", "max_stars_repo_license... |
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
from torch.utils.tensorboard import SummaryWriter
# transforms
transform = transforms.Compose([transforms.T... | {"hexsha": "697d65aca5f6401deb2ed337d40584d2369e9fea", "size": 3257, "ext": "py", "lang": "Python", "max_stars_repo_path": "Basics/ModelVisualizing.py", "max_stars_repo_name": "Fyy10/ML-DL_Practice", "max_stars_repo_head_hexsha": "7b7c8a63d52fbf2c9192d913255852bbbe3de276", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Copyright 2018 The Kubeflow Authors. 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 applicabl... | {"hexsha": "a15653343956d376570fe9de1381970b1a1b0dc4", "size": 5382, "ext": "py", "lang": "Python", "max_stars_repo_path": "example/tf/keras_model_to_estimator.py", "max_stars_repo_name": "lwangbm/kubedl", "max_stars_repo_head_hexsha": "ac5babf989bef495be566f17b97129a7114e5233", "max_stars_repo_licenses": ["Apache-2.0"... |
"""Tools for estimating time frequency properties, using Hilbert methods."""
import numpy as np
from scipy.signal import hilbert
from neurodsp.filt import filter_signal
from neurodsp.utils.decorators import multidim
from neurodsp.utils.outliers import remove_nans, restore_nans
from neurodsp.filt.utils import infer_pa... | {"hexsha": "43aa12fcbe50783d33d97f6fcb194dfdc53052e6", "size": 6657, "ext": "py", "lang": "Python", "max_stars_repo_path": "neurodsp/timefrequency/hilbert.py", "max_stars_repo_name": "bcmartinb/neurodsp", "max_stars_repo_head_hexsha": "36d8506f3bd916f83b093a62843ffb77647a6e1e", "max_stars_repo_licenses": ["Apache-2.0"]... |
import numpy as np
from MagniPy.lensdata import Data
from MagniPy.LensBuild.defaults import get_default_SIE_random, get_default_SIE
from MagniPy.util import approx_theta_E
from MagniPy.Workflow.grism_lenses.quad import Quad
class Lens0435(Quad):
x = np.array([1.272, 0.306, -1.152, -0.384])
y = np.array([0.156... | {"hexsha": "0444567abaa05e03f37e498da961da9c26936c04", "size": 4526, "ext": "py", "lang": "Python", "max_stars_repo_path": "MagniPy/Workflow/grism_lenses/he0435_satellite_convention_phys.py", "max_stars_repo_name": "dangilman/MagniPy", "max_stars_repo_head_hexsha": "820b82ea0f6559c895f11c92d93de475a92d38b0", "max_stars... |
# Module to run tests on surveys
# Most of these are *not* done with Travis yet
from __future__ import print_function, absolute_import, division, unicode_literals
# TEST_UNICODE_LITERALS
import pytest
import os
import numpy as np
from astropy.coordinates import SkyCoord
from astropy import units
from frb import rm... | {"hexsha": "0bcf3c4509e293aac8860de2b1437f644824d9c8", "size": 576, "ext": "py", "lang": "Python", "max_stars_repo_path": "frb/tests/test_frbrm.py", "max_stars_repo_name": "KshitijAggarwal/FRB", "max_stars_repo_head_hexsha": "3f732c6fa4fc79a5cfe69daf3cd88b51e6fb402b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
import numpy as np
import gensim
import string
import re
import collections
import logging
from matplotlib import pyplot as plt
from sklearn.manifold import TSNE
import time
ae_size = 250
#logging setup
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
#load 20 newsgroups d... | {"hexsha": "13bef7a81e3b5a73c0ee467bc1ee591d26fa9431", "size": 5389, "ext": "py", "lang": "Python", "max_stars_repo_path": "project4/cbow_generator.py", "max_stars_repo_name": "HoliestCow/ece692_deeplearning", "max_stars_repo_head_hexsha": "638c27e0d9c01ec9b0a8be8a85e54937645a897e", "max_stars_repo_licenses": ["MIT"], ... |
import io
import numpy as np
import sys
import tensorflow as tf
import tensorflow_addons as tfa
import tensorflow_datasets as tfds
def _normalize_img(img, label):
img = tf.cast(img, tf.float32) / 255.
return (img, label)
def get_data(data_type = 'mnist', data_kind='img'):
train_dataset, test_dataset = t... | {"hexsha": "15d5057d4d66ae62535a7227bbe3ecb4b9334709", "size": 14198, "ext": "py", "lang": "Python", "max_stars_repo_path": "demo_embeddings_rf.py", "max_stars_repo_name": "anupamme/keras-triplet-loss-mnist", "max_stars_repo_head_hexsha": "422d0feb19cffb9fd44ec1053a7ca57b47d59810", "max_stars_repo_licenses": ["MIT"], "... |
import ntlk
import numpy as np
import random
import string
import bs4 as bs
import urllib.request
import re
#scraping the website
web_data = urllib.request.urlopen('https://www.monster.com/career-advice/article/top-10-interview-questions-prep')
web_data = web_data.read()
article_html = bs.BeautifulSou... | {"hexsha": "a4462b7ad82e6edf6bbaa87c58ea03b743345515", "size": 2802, "ext": "py", "lang": "Python", "max_stars_repo_path": "AlecChat.py", "max_stars_repo_name": "kiwihero/chat-bots", "max_stars_repo_head_hexsha": "5ed378d7917953f919377f9d7ba2d3db7319abfb", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": n... |
import gtimer as gt
import numpy as np
import torch
import copy
from collections import OrderedDict
from lifelong_rl.core.rl_algorithms.torch_rl_algorithm import TorchTrainer
import lifelong_rl.torch.pytorch_util as ptu
from lifelong_rl.trainers.lstm_memory.empowerment_functions import calculate_contrastive_empowerme... | {"hexsha": "10a8f7a68d8f03b8ed8fbff43722b5988d38c7c0", "size": 17147, "ext": "py", "lang": "Python", "max_stars_repo_path": "lifelong_rl/trainers/lstm_memory/lstm_memory.py", "max_stars_repo_name": "nakamotoo/lifelong_rl", "max_stars_repo_head_hexsha": "a8376a57cdeff158810e71cd31cba089852399b7", "max_stars_repo_license... |
# Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/Python/Basic/bounding_volume.py
import numpy as np
import open3d as o3d
import os
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(dir_path, "../Misc"))
im... | {"hexsha": "8895361b87162ece104ecbfe31f79b7d998dc6cd", "size": 3341, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/Python/Basic/bounding_volume.py", "max_stars_repo_name": "JamesWang007/Open3D", "max_stars_repo_head_hexsha": "d87bafabadbe82d848ba3e0e14921a1ea445f8fe", "max_stars_repo_licenses": ["MIT"... |
#include "googletest/googletest/include/gtest/gtest.h"
#include "crypter.h"
#include <boost/algorithm/hex.hpp>
TEST(crypter_tests, basic_tests)
{
CCrypter crypter;
std::string toEncrypt("Hi, this is very secret!");
std::vector<unsigned char> cipherText;
SecureString strWalletPassphrase("abc");
CK... | {"hexsha": "0d13f8ea1bd532ea5308f85f8fd7e73bada8da65", "size": 1668, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "wallet/test/crypter_tests.cpp", "max_stars_repo_name": "qw23qw2/luxurycoin", "max_stars_repo_head_hexsha": "a9190882cd6534564d951099b9323d2c788bd123", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import numpy as np
import pytest
from mygrad.operation_base import Operation
from mygrad.tensor_base import Tensor
class Dummy(Operation):
def __call__(self, a, b):
self.variables = (a, b)
# stores output array to check memory consistency
self.array_out = a.data * b.data
return se... | {"hexsha": "ce068af72f9d6ad34add78eecf9078bcb08dffa0", "size": 1571, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/tensor_base/test_op_wrapper.py", "max_stars_repo_name": "kw-0/MyGrad", "max_stars_repo_head_hexsha": "307f1bb5f2391e7f4df49fe43a7acf9d1e8ea141", "max_stars_repo_licenses": ["MIT"], "max_star... |
PROGRAM CALL_DASPK
IMPLICIT NONE
C IN THIS CODE WE ASSUME THAT THE
C MAXIMUM # SPECIES = 1500
C MAXIMUM # REACTIONS = 100,000
C MAXIMUM # THIRDBODYREACTIONS = 100
C MAXIMUM # TROEREACTIONS = 100
INTEGER SPMAX, RMAX, TBRMAX, TROEMAX
PARAMETER (SPMAX = 1500, RMAX = 100000, TBRMAX=100, TROEMAX... | {"hexsha": "5efebc78f4d3282d6e9ff0e4e781db9c1bb47c60", "size": 7634, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "source/dassl/call_dassl.f", "max_stars_repo_name": "sean-v8/RMG-Java", "max_stars_repo_head_hexsha": "e284bb6b14f06690da157da33dab4a86d55f50d0", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
"""
Installing the SageMath Jupyter Kernel and extensions
Kernels have to register themselves with Jupyter so that they appear
in the Jupyter notebook's kernel drop-down. This is done by
:class:`SageKernelSpec`.
"""
import os
import errno
from sage.env import (
SAGE_ROOT, SAGE_DOC, SAGE_LOCAL, SAGE_EXTCODE,
... | {"hexsha": "130414998413061b0118a9282acd8c30b79e7b24", "size": 7922, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sage/repl/ipython_kernel/install.py", "max_stars_repo_name": "fredstro/sage", "max_stars_repo_head_hexsha": "c936d2cda81ec7ec3552a3bdb29c994b40d1bb24", "max_stars_repo_licenses": ["BSL-1.0"], ... |
'''
this code is for supervised learning the state-action pair
using the neural network approach
'''
from __future__ import print_function
import tensorflow as tf
import numpy as np
import random
import pickle
import matplotlib.pyplot as plt
import argparse
import math
import time
import gzip
from env_test import Reac... | {"hexsha": "d4d036a24cfbf776f80cb0164419285b4049b1da", "size": 13527, "ext": "py", "lang": "Python", "max_stars_repo_path": "prioritized_alternative/predict_test_prioritized.py", "max_stars_repo_name": "quantumiracle/Reinforcement-Learning-for-Robotics", "max_stars_repo_head_hexsha": "527befb0545d90fc278a820d85af77336b... |
module #5 where
open import Level
open import Data.Product
open import Data.Bool
open import Relation.Binary.PropositionalEquality
{-
Exercise 1.5. Show that if we define A + B :≡ ∑(x:2) rec2(U, A, B, x), then we can give a definition
of indA+B for which the definitional equalities stated in §1.7 hold.
-}
rec₂ : ∀{c... | {"hexsha": "48f127a289c8e57e6a204896353c298d2daca0d5", "size": 1401, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Chapter1/#5.agda", "max_stars_repo_name": "CodaFi/HoTT-Exercises", "max_stars_repo_head_hexsha": "3411b253b0a49a5f9c3301df175ae8ecdc563b12", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
"""
Created on Tue, Jun 30 2020
FERMI specific helper functions
@author:
Michael Schneider, MBI Berlin
Kathinka Gerlinger, MBI Berlin
"""
import numpy as np
import os
import glob
import h5py
import pandas as pd
# commonly used hdf5 entries
mnemonics = dict(
xgm_UH='photon_diagnostics/FEL01/I0_monitor/... | {"hexsha": "285d7db58d8db99a67a0bfe218d06ce3b067062c", "size": 7652, "ext": "py", "lang": "Python", "max_stars_repo_path": "process_FERMI.py", "max_stars_repo_name": "dscran/FERMI_2020-07", "max_stars_repo_head_hexsha": "8f81aa075a45735ce9a63a703ade139646693c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
from __future__ import absolute_import
import numpy as np
import editdistance
import string
import math
import torch
import torch.nn.functional as F
from ..utils import to_torch, to_numpy
def _normalize_text(text):
text = ''.join(filter(lambda x: x in (string.digits + string.ascii_letters), text))
return text.... | {"hexsha": "a13d68273b3e93875065b6d6ad57bf90c0a40fa6", "size": 6262, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/models/metric.py", "max_stars_repo_name": "adeline-cs/GTR", "max_stars_repo_head_hexsha": "889b0cda8a3c2b061371c4a63ea871821ddcd3d7", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
[STATEMENT]
lemma list_rel_pres_length[fcomp_prenorm_simps]: "(x',x)\<in>\<langle>A\<rangle>list_rel \<Longrightarrow> length x' = length x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (x', x) \<in> \<langle>A\<rangle>list_rel \<Longrightarrow> length x' = length x
[PROOF STEP]
by (rule list_rel_imp_same_length) | {"llama_tokens": 124, "file": "Refine_Imperative_HOL_IICF_Intf_IICF_List", "length": 1} |
/* For some tests, I really really really want to use C++11 features, so here
they are */
#ifdef NDEBUG
#undef NDEBUG
#endif
#define CATCH_CONFIG_MAIN
#include "common.hpp"
#include <boost/http/reader/request.hpp>
#include <boost/variant.hpp>
using boost::variant;
namespace asio = boost::asio;
namespace http = b... | {"hexsha": "00ef56ea6042a09f0313c5d9f926d17e26356a49", "size": 31922, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/request11.cpp", "max_stars_repo_name": "BoostGSoC14/boost.http", "max_stars_repo_head_hexsha": "fd8d6afb421ec58cbafe0a97f3df709bcf8ed723", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_co... |
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
x = np.random.randn(10, 2)
W1 = np.random.randn(2, 4)
b1 = np.random.randn(4)
W2 = np.random.randn(4, 3)
b2 = np.random.randn(3)
h = np.matmul(x, W1) + b1
a = sigmoid(h)
s = np.matmul(h, W2) + b2
print(s.shape) | {"hexsha": "53f4eb0414ffface72c6e4a8ed95443f0b0c98cf", "size": 278, "ext": "py", "lang": "Python", "max_stars_repo_path": "old/ch1/active_function.py", "max_stars_repo_name": "intlabSeJun/deep-learning2", "max_stars_repo_head_hexsha": "bd02497adb627e1e07b4ed71044f675d2208ddb6", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma topological_basis_open:
assumes "topological_basis B"
and "X \<in> B"
shows "open X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. open X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
topological_basis B
X \<in> B
goal (1 subgoal):
1. open X
[PROOF STEP]
by (simp add: ... | {"llama_tokens": 144, "file": null, "length": 2} |
# -*- coding: utf-8 -*-
# Author: Zhi Qiao <mingshan_ai@163.com>
# License: BSD 2 clause
import torch
import numpy as np
from PIL import Image
from .base_dataset import get_params, get_transform, BaseDataset
class DatasetReader(BaseDataset):
def __init__(self, data, params, run_type = 'train', data_type = 'di... | {"hexsha": "130db96756d62f7a076b17c9526a72d8f0313a80", "size": 1424, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyhealth/data/data_reader/image/dl_reader.py", "max_stars_repo_name": "rkalahasty/PyHealth", "max_stars_repo_head_hexsha": "1ee0859d8d39a7fc6f8df48ef8d2bf6c17dcf4a5", "max_stars_repo_licenses": ["... |
from datetime import datetime
import numpy as np
import pandas as pd
import pyarrow as pa
__all__ = ['SchemaInferrer']
_python_mapping = {
int: pa.int64,
float: pa.float64,
str: pa.string,
bytes: pa.binary,
datetime: pa.date64,
}
_SAMPLE_SIZE = 1000
class SchemaInferrer:
def infer_schema(... | {"hexsha": "b534deab593a5c1ad438fa123d898401bc437d93", "size": 3169, "ext": "py", "lang": "Python", "max_stars_repo_path": "h1st/h1st/schema/schema_inferrer.py", "max_stars_repo_name": "Mou-Ikkai/h1st", "max_stars_repo_head_hexsha": "da47a8f1ad6af532c549e075fba19e3b3692de89", "max_stars_repo_licenses": ["Apache-2.0"], ... |
import json
import os
import numpy as np
import pandas as pd
from astropy.io import fits as pyfits
from .folders import get_bin_key
def get_bin_weights(framelist, filelist):
weight_dict = {}
for frame, path in zip(framelist, filelist):
try:
weight = frame.weights.sum()
except Att... | {"hexsha": "f11ecf332f087f69ebf37d376a95a9d1ca58329f", "size": 5602, "ext": "py", "lang": "Python", "max_stars_repo_path": "yaw_tools/correlation.py", "max_stars_repo_name": "jlvdb/yet_another_wizz", "max_stars_repo_head_hexsha": "11f0cb06c85ec9a050bfb049adc65aba558bc09c", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
% Description:
%
% Create a design matrix for groups.
%
% Syntax:
%
% [ X, terms ] = mG2X(groups, offset)
%
% Inputs:
%
% groups - [ N x G ] (int) - columns of qualitative variables
% offset - [ 1 x 1 ] (int) - group offset index for terms
% options - [ 1 x P ] (cell) - see Details and Options
%... | {"author": "Sable", "repo": "mcbench-benchmarks", "sha": "ba13b2f0296ef49491b95e3f984c7c41fccdb6d8", "save_path": "github-repos/MATLAB/Sable-mcbench-benchmarks", "path": "github-repos/MATLAB/Sable-mcbench-benchmarks/mcbench-benchmarks-ba13b2f0296ef49491b95e3f984c7c41fccdb6d8/27014-mancovan/mG2X.m"} |
! not done yet
! dummy
function bulgefixeddens(r,z) result(x)
real r,z,x
x=0
end function
| {"hexsha": "bd9e12d7b3f87674eb4087579cb3ca9fcff93eef", "size": 121, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/amuse/community/galactics/gas_src/src/fixedbulgepot.f", "max_stars_repo_name": "rknop/amuse", "max_stars_repo_head_hexsha": "85d5bdcc29cfc87dc69d91c264101fafd6658aec", "max_stars_repo_licenses"... |
import numpy as np
def simulate_data(T=100, exp_omega=0.05, decay_factor=0.05, seed=1, type="constant"):
"""Simulate data with time varying average growth rate omega.
Parameters
----------
T : int
Number of time periods.
exp_omega : float
Scaling factor of omega.
decay_factor ... | {"hexsha": "2792828d94200149f3195b71d23ab49619393b89", "size": 1227, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data_simulator.py", "max_stars_repo_name": "ChristophAy/covid_case_forecasting", "max_stars_repo_head_hexsha": "cb022b12eb0551e56a736e4803da4829f35426ae", "max_stars_repo_licenses": ["Apache-2... |
import keras
import numpy as np
from keras import backend as K
from keras.layers import Reshape, Dense, Lambda
from keras.regularizers import Regularizer
def _merge_mog(inputs):
inputs, mu, sigma, alpha = inputs
intermediate = -0.5 * K.square((mu - K.expand_dims(inputs, 2)) / sigma)
return logsumexp(inter... | {"hexsha": "48374bb202deb0aac5af84ea77ec81c8472308b4", "size": 2436, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "jgrnt/keras_nade", "max_stars_repo_head_hexsha": "da39fbeaa3e8e7bd40dd08489afb557a85755dd1", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 3, "... |
@defcomp climatedynamics begin
TATM = Variable(index=[time]) # Increase in temperature of atmosphere (degrees C from 1900)
TOCEAN = Variable(index=[time]) # Increase in temperature of lower oceans (degrees C from 1900)
FORC = Parameter(index=[time]) # Increase in radiative forcing (watts per... | {"hexsha": "1ab4c77fb82468fd46cc98e6d52b65397e0056e2", "size": 1547, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/components/climatedynamics_component.jl", "max_stars_repo_name": "anthofflab/MimiDICE2013.jl", "max_stars_repo_head_hexsha": "ae2d83788d55697d25a08e46fb872476c18c20f7", "max_stars_repo_licenses... |
import numpy as np
from sklearn.pipeline import FeatureUnion, Pipeline
from sklearn.preprocessing import FunctionTransformer
from classification.features.pipeline.utils import (
get_psds_from_epochs,
)
from classification.features.constants import (
FREQ_BANDS_RANGE,
)
def _get_mean_psds(psds_with_freqs, are... | {"hexsha": "b0dfba9e0a729860a09fc05a4da0cd46a809d5a2", "size": 3511, "ext": "py", "lang": "Python", "max_stars_repo_path": "backend/classification/features/pipeline/frequency_domain.py", "max_stars_repo_name": "PolyCortex/polydodo", "max_stars_repo_head_hexsha": "473d5a8b89e9bdb68ba9592241e45d30b86b471c", "max_stars_re... |
import numpy as np
from libconform import Meta, CP
from libconform.ncs import NCSKNearestNeighbors
from sklearn.datasets import load_iris
from sklearn.neighbors import KNeighborsClassifier
X, y = load_iris(True)
# randomly permute X, y
indices = np.arange(len(X))
np.random.shuffle(indices)
X = X[indices]
y = y[ind... | {"hexsha": "05e552ac78159e8add09ab255df33143a68bd26c", "size": 854, "ext": "py", "lang": "Python", "max_stars_repo_path": "doc/arxiv/meta.py", "max_stars_repo_name": "jofas/conform", "max_stars_repo_head_hexsha": "9f8dd3c7c607269529bf4d62a729ed2ca1880baa", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "max_... |
factIter <- function(n) {
f = 1
if (n > 1) {
for (i in 2:n) f <- f * i
}
f
}
| {"hexsha": "ffd155da8da2dbc4a6669cb9fa0f27bcb79a0d69", "size": 89, "ext": "r", "lang": "R", "max_stars_repo_path": "Task/Factorial/R/factorial-2.r", "max_stars_repo_name": "mullikine/RosettaCodeData", "max_stars_repo_head_hexsha": "4f0027c6ce83daa36118ee8b67915a13cd23ab67", "max_stars_repo_licenses": ["Info-ZIP"], "max... |
/* boost random/uniform_smallint.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentatio... | {"hexsha": "60ea38480cc066ee1fe5f0636822155029256e33", "size": 3105, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/lib/boost/random/uniform_smallint.hpp", "max_stars_repo_name": "EricBoittier/vina-carb-docker", "max_stars_repo_head_hexsha": "e8730d1ef90395e3d7ed3ad00264702313b0766a", "max_stars_repo_licenses... |
function [iout] = center_crop(im,a,b)
[w,h,~] = size(im);
c1 = w-a-(w-a)/2;
c2 = h-b-(h-b)/2;
iout = im(c1+1:c1+a,c2+1:c2+b,:);
end
| {"author": "cszn", "repo": "SRMD", "sha": "c83995140baecd43f9f426710bf6330b3678746f", "save_path": "github-repos/MATLAB/cszn-SRMD", "path": "github-repos/MATLAB/cszn-SRMD/SRMD-c83995140baecd43f9f426710bf6330b3678746f/utilities/center_crop.m"} |
import re
import pandas as pd
import numpy as np
class DynamicAnalyzer:
def __init(self, tweets):
self.tweets = tweets
self.poi_list = []
def get_tweet_types(self):
'''
Input: Json of tweets
:return: {'organic':40%, 'reply':30% , 'retweet':30%}
'''
co... | {"hexsha": "08417eb2c0c48a5b0018c38e5e7de41a166fb175", "size": 3721, "ext": "py", "lang": "Python", "max_stars_repo_path": "ting/core_module/search_analytics/dynamic_analyzer.py", "max_stars_repo_name": "Stank7/Ting", "max_stars_repo_head_hexsha": "7559b9f93223da6b2c0dc732991c88244b66aa78", "max_stars_repo_licenses": [... |
import argparse
import matplotlib.pyplot as plt
import numpy as np
import tables
def accuracy(preds, labels, files, degree=15):
correct = 0
total_samples = {0: 0, 30: 0, 45: 0, 60: 0, 90: 0}
correct_samples = {0: 0, 30: 0, 45: 0, 60: 0, 90: 0}
for i, view in enumerate(labels):
angle = preds[... | {"hexsha": "b526a80e062f1cb34a4619534789ab66283f7f6c", "size": 1891, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/preprocess/plot_pose.py", "max_stars_repo_name": "PatrickPrakash/lipreading", "max_stars_repo_head_hexsha": "6380508ba3ffad64fc01ce10a5f43e4da0f652fd", "max_stars_repo_licenses": ["MIT"], "max... |
#__precompile__()
module JUDI
using PyCall, JOLI, SegyIO, Dierckx, Distributed, Pkg, Printf
export JUDIPATH
JUDIPATH = dirname(pathof(JUDI))
# submodule TimeModeling
include("TimeModeling/TimeModeling.jl")
# submodule Optimization
include("Optimization/SLIM_optim.jl")
end
| {"hexsha": "d6407e8171ae8d2a869eedff4711ce46534879be", "size": 279, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/JUDI.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/JUDI.jl-f3b833dc-6b2e-5b9c-b940-873ed6319979", "max_stars_repo_head_hexsha": "229b240173e18e9a22982c6be37a5b01c56b64aa", "max_sta... |
\chapter{Derivatives}
Derivatives describe how a function is changing.
They are one of the two fundamental operations in calculus.
\input{./derivatives/rates_of_change.tex}
\input{./derivatives/definition_of_derivative.tex}
\input{./derivatives/differentiability.tex}
\input{./derivatives/ivt.tex}
\input{./de... | {"hexsha": "7960fe07bc131e10ec71a97b8ddb16f40b640c9a", "size": 543, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "calc/derivatives/derivatives.tex", "max_stars_repo_name": "aneziac/Math-Summaries", "max_stars_repo_head_hexsha": "20a0efd79057a1f54e093b5021fbc616aab78c3f", "max_stars_repo_licenses": ["Unlicense"],... |
classdef m_22_vic_10p_3s < MARRMoT_model
% Class for hydrologic conceptual model: VIC
% Copyright (C) 2019, 2021 Wouter J.M. Knoben, Luca Trotter
% This file is part of the Modular Assessment of Rainfall-Runoff Models
% Toolbox (MARRMoT).
% MARRMoT is a free software (GNU GPL v3) and distributed WITHOUT ANY
% WARRANT... | {"author": "wknoben", "repo": "MARRMoT", "sha": "442622b3fd89bdd88420e96cfc6605770202dae9", "save_path": "github-repos/MATLAB/wknoben-MARRMoT", "path": "github-repos/MATLAB/wknoben-MARRMoT/MARRMoT-442622b3fd89bdd88420e96cfc6605770202dae9/MARRMoT/Models/Model files/m_22_vic_10p_3s.m"} |
from __future__ import division
from lasagne import init
from lasagne.layers.base import Layer
import numpy as np
import theano.tensor as T
class RBFLayer(Layer):
'''
An RBF network layer; output the RBF kernel value from each input to a set
of (learned) centers.
'''
def __init__(self, incoming, ... | {"hexsha": "e733381163fe83226ba121eeb0dbf779281226d6", "size": 2685, "ext": "py", "lang": "Python", "max_stars_repo_path": "two_sample/layers.py", "max_stars_repo_name": "Kensuke-Mitsuzawa/opt-mmd", "max_stars_repo_head_hexsha": "64f8c6eb9cdfdb1356cfbec53675e07df78c18b0", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
[STATEMENT]
theorem fermat_test_prime:
assumes "prime n"
shows "fermat_test n = return_pmf True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. fermat_test n = return_pmf True
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. fermat_test n = return_pmf True
[PROOF STEP]
interpret fermat_te... | {"llama_tokens": 469, "file": "Probabilistic_Prime_Tests_Fermat_Test", "length": 8} |
Require Export SO_sem_mods high_mods.
Require Import SO_facts1 Monotonicity_SO Correctness_ST pos SO_facts_syn.
Lemma step1_empty : forall (W : Set) (Iv : FOvariable -> W)
(Ip : predicate -> W -> Prop)
(Ir : W -> W -> Prop)
(alpha : SecOrder) (P : predicate),... | {"author": "caitlindabrera", "repo": "Sahlqvist", "sha": "d0a755fb663a6cabc0babb691564cdf575fc8b36", "save_path": "github-repos/coq/caitlindabrera-Sahlqvist", "path": "github-repos/coq/caitlindabrera-Sahlqvist/Sahlqvist-d0a755fb663a6cabc0babb691564cdf575fc8b36/vsSahlq/coq_code/Sahlqvist_Pos.v"} |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import argparse
from util import io
# plot an output file using the solver's dovis script
def makeplot(plotfile, variable, outfile, vmin=None, vmax=None):
sim = io.read(plotfile)
myd = sim.cc_data
myg = myd.grid
if variable ... | {"hexsha": "4907c8a7ee24f9231448017fe53a574705f49261", "size": 2206, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/plotcompact.py", "max_stars_repo_name": "SebastianoF/pyro2", "max_stars_repo_head_hexsha": "9d1787c2ee25d735a414db3da8c00287743a6fde", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
[STATEMENT]
lemma mids_cons: "mids (x#xs) = fronts (x#xs) \<union> mids xs" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. mids (x # xs) = fronts (x # xs) \<union> mids xs
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. mids (x # xs) \<subseteq> fronts (x # xs) \<union> mids xs
... | {"llama_tokens": 2749, "file": "Maximum_Segment_Sum_Maximum_Segment_Sum", "length": 35} |
function crossover(p_int1::Vector{Int64},p_float1::Matrix{Float64},
p_int2::Vector{Int64},p_float2::Matrix{Float64})
p_int3 = zeros(Int,size(p_int1,1)*size(p_int2,1))
p_float3 = zeros((size(p_float1,1)*size(p_float2,1),size(p_float1,2)))
add_on = 0
min_index = min(size(p_int1,1),size(p_in... | {"hexsha": "6cfb39d68a5d0d544c842d8dfdec853a322cad5d", "size": 4743, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/genetic_operators.jl", "max_stars_repo_name": "harrybooth/FractalDevelopment", "max_stars_repo_head_hexsha": "a25c1ae8bb4e43c42e14dcee0703b116ec66de5f", "max_stars_repo_licenses": ["MIT"], "max... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import numpy as np
import operator
from qsrlib_qsrs.qsr_arg_relations_abstractclass import QSR_Arg_Relations_Abstractclass
from qsrlib_io.world_qsr_trace import *
class QSR_Arg_Relations_Distance(QSR_Arg_Relations_Abstractclass):
"""Argument ... | {"hexsha": "3c26147e3b2812b32887b0de724c4699c7da84e9", "size": 2892, "ext": "py", "lang": "Python", "max_stars_repo_path": "qsrlib/src/qsrlib_qsrs/qsr_arg_relations_distance.py", "max_stars_repo_name": "alexiatoumpa/QSR_Detector", "max_stars_repo_head_hexsha": "ff92a128dddb613690a49a7b4130afeac0dd4381", "max_stars_repo... |
import numpy
print('Numpy is {}'.format(numpy.__file__))
import autograd.numpy as np
from autograd import grad
from mpi4py import MPI
import dxchange
import time
import os
import h5py
import warnings
from util import *
from misc import *
from optimizers import *
PI = 3.1415927
def reconstruct_fullfield(fname, theta_... | {"hexsha": "5a78c2c2a602cf3f97d5fea16425a49286065370", "size": 33967, "ext": "py", "lang": "Python", "max_stars_repo_path": "fullfield.py", "max_stars_repo_name": "dnoonan08/reconstruct_ptychography", "max_stars_repo_head_hexsha": "ee47b7f60f143404fb0351e4bbd84493829d5de0", "max_stars_repo_licenses": ["MIT"], "max_star... |
From Relational Require Import OrderEnrichedCategory GenericRulesSimple.
Set Warnings "-notation-overridden,-ambiguous-paths".
From mathcomp Require Import all_ssreflect all_algebra reals distr realsum
fingroup.fingroup solvable.cyclic prime ssrnat ssreflect ssrfun ssrbool ssrnum
eqtype choice seq.
Set Warnings "... | {"author": "SSProve", "repo": "ssprove", "sha": "5dce3e2eae195fc466035e314ef4463d956c9c6a", "save_path": "github-repos/coq/SSProve-ssprove", "path": "github-repos/coq/SSProve-ssprove/ssprove-5dce3e2eae195fc466035e314ef4463d956c9c6a/theories/Crypt/examples/OVN.v"} |
program t
if (.false.) then
print *,1
else
print *,'hello'
end if
end program t
| {"hexsha": "4ba903f4489b3b4acc82b158b4363ff4473da9c4", "size": 94, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/t0070r/t.f90", "max_stars_repo_name": "maddenp/ppp", "max_stars_repo_head_hexsha": "81956c0fc66ff742531817ac9028c4df940cc13e", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 2... |
[STATEMENT]
lemma (in eflowgraph) initial_starts_with_call: "
\<lbrakk> (([entry fg p],c),e,(s',c'))\<in>trss fg; initialproc fg p \<rbrakk>
\<Longrightarrow> \<exists>p'. e=LCall p' \<and> isolated_ret fg p'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>(([entry fg p], c), e, s', c') \<in> trss fg... | {"llama_tokens": 242, "file": "Program-Conflict-Analysis_Normalization", "length": 1} |
[STATEMENT]
lemma sup_0_imp_0:
assumes "sup a (- a) = 0"
shows "a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. a = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. a = (0::'a)
[PROOF STEP]
have pos: "0 \<le> a" if "sup a (- a) = 0" for a :: 'a
[PROOF STATE]
proof (prove)
goal... | {"llama_tokens": 1408, "file": null, "length": 23} |
import os
import logging
import numpy as np
import cv2
logger = logging.getLogger(__name__)
class StereoVision:
"""Stereo Vision
"""
def __init__(self):
"""Implement Stereo Vision
"""
self.cfg = None
@staticmethod
def get_disparity_map(leftimage, rightimage, **kwargs):... | {"hexsha": "140eb499dc421c8d7c05919ed928b186046f7e03", "size": 3314, "ext": "py", "lang": "Python", "max_stars_repo_path": "stereo_vision/stereo_vision.py", "max_stars_repo_name": "extra2000/stereo-vision", "max_stars_repo_head_hexsha": "031a8bcaab53064723c1f5b2f32a2754365c4a8a", "max_stars_repo_licenses": ["MIT"], "ma... |
from loguru import logger
from saving_utils import generate_experiment_ids, convert_results_to_csv, save_results
from arguments import Arguments
from dataloaders import load_data_loader, generate_data_loaders_from_distributed_dataset
from clients import create_clients, Global_Client
import data_distribution
from utilit... | {"hexsha": "d8c7f1f895cfb0c6cce6ba9878ab0f465e68c462", "size": 20059, "ext": "py", "lang": "Python", "max_stars_repo_path": "server_core_v3.py", "max_stars_repo_name": "ameldocena/StratifiedAggregation", "max_stars_repo_head_hexsha": "0031fea120bff00c739eb6c3d654a5c6d3f094bb", "max_stars_repo_licenses": ["MIT"], "max_s... |
import os
import pandas as pd
import matplotlib.pyplot as plt
from numpy.polynomial.polynomial import polyfit
import numpy as np
from calculate_mdl import preprocess_codebook
from gym_minigrid.window import Window
import gym
from collect_data import a_star
from copy import deepcopy
import imageio
from collect_data impo... | {"hexsha": "6be15a6480e36dbc3944b13f7c32959098b28712", "size": 6394, "ext": "py", "lang": "Python", "max_stars_repo_path": "plotting.py", "max_stars_repo_name": "jesbu1/gym-minigrid", "max_stars_repo_head_hexsha": "fd799f90bcd88d5418dcb074140e65862d44f064", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
#
# Valuation of European Call Option
# in Black-Scholes-Merton Model
# A_pyt/b_BSM_valuation.py
#
from scipy import stats
import math
# Option Parameters
S0 = 105.00 # initial index level
K = 100.00 # strike price
T = 1. # call option maturity
r = 0.05 # constant short rate
vola = 0.25 # constant volatility fact... | {"hexsha": "9eca7aa58c9d7c23a985d39bd61d772093767ca8", "size": 1203, "ext": "py", "lang": "Python", "max_stars_repo_path": "python36/A_pyt/b_BSM_valuation.py", "max_stars_repo_name": "aborodya/dawp", "max_stars_repo_head_hexsha": "0b34507e4b09eda677815728b46d800eedfeba3d", "max_stars_repo_licenses": ["CNRI-Python"], "m... |
# -*- coding: utf-8 -*-
# Copyright (c) 2006-2009 Filip Wasilewski <http://filipwasilewski.pl/>
# See COPYING for license details.
# $Id: numerix.py 117 2009-05-02 20:25:59Z filipw $
"""
Thin wrapper for numeric modules. Modify this to use wavelets with libraries other than NumPy.
Provides efficient mathematical fu... | {"hexsha": "ade9cad371cb712385238eaaddb76bbba1dfd3df", "size": 1738, "ext": "py", "lang": "Python", "max_stars_repo_path": "supreme/lib/pywt/numerix.py", "max_stars_repo_name": "KirillDZR/supreme", "max_stars_repo_head_hexsha": "c296722599363bd0cbcce6877bd9de9b066cb74b", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
"""Train a model for image classification
Colin Dietrich 2019
"""
import os
import pickle
import numpy as np
import sklearn.metrics # import confusion_matrix, f1_score, precision_score, recall_score
from datetime import datetime
from keras.preprocessing.image import ImageDataGenerator
from keras.callbacks import Model... | {"hexsha": "0a48fb72e65c8ce0e6154cd2c186e954d972a1b1", "size": 7430, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "crdietrich/sidewalkscanner", "max_stars_repo_head_hexsha": "62d167da930ea219f2cc638d7de29fa0a1bed65c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
# ---
# title: 964. Least Operators to Express Number
# id: problem964
# author: Tian Jun
# date: 2020-10-31
# difficulty: Hard
# categories: Math, Dynamic Programming
# link: <https://leetcode.com/problems/least-operators-to-express-number/description/>
# hidden: true
# ---
#
# Given a single positive integer `x`, we... | {"hexsha": "2b3fdcfd56d1e42d7a469cb69f523ed1d019dabc", "size": 1983, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/unresolved/964.least-operators-to-express-number.jl", "max_stars_repo_name": "jmmshn/LeetCode.jl", "max_stars_repo_head_hexsha": "dd2f34af8d253b071e8a36823d390e52ad07ab2e", "max_stars_repo_lice... |
import sys
import os
import pickle
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score
from sklearn.neighbors.kde import KernelDensity
rootpath = os.path.dirname(os.path.dirname(o... | {"hexsha": "57ffc6446cd9de7234d4b29f8c683bf8dd271ffc", "size": 31784, "ext": "py", "lang": "Python", "max_stars_repo_path": "standard/analysis_multihead.py", "max_stars_repo_name": "gyyang/olfaction_evolution", "max_stars_repo_head_hexsha": "434baa85b91f450e1ab63c6b9eafb8d370f1df96", "max_stars_repo_licenses": ["MIT"],... |
import sys
sys.path.append("/home/luisals/DeepHalos")
from dlhalos_code import CNN
import tensorflow.keras.callbacks as callbacks
from tensorflow.keras.callbacks import CSVLogger
import tensorflow
from tensorflow.keras import regularizers
import dlhalos_code.data_processing as tn
import numpy as np
from pickle import d... | {"hexsha": "ebdd9afbda50e6c70722e9882dc70e292b76b24d", "size": 9155, "ext": "py", "lang": "Python", "max_stars_repo_path": "scratch/lowmass/test_lowmass_outliers.py", "max_stars_repo_name": "finn-dodgson/DeepHalos", "max_stars_repo_head_hexsha": "86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c", "max_stars_repo_licenses": ["M... |
import os
import sys
from typing import Dict, List, Literal, Union
sys.path.append("../../../")
import cv2
import numpy as np
import skimage.io as io
import torch.utils.data as data
from torchvision import transforms
from yacs.config import CfgNode
from lib.config.config import pth
from lib.datasets.ARCdataset.ARCut... | {"hexsha": "226ee81f27b0be37b84cbbe913ae52646b4ee46a", "size": 7070, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/datasets/tasks/semantic_segm.py", "max_stars_repo_name": "rurusasu/OrigNet", "max_stars_repo_head_hexsha": "3b3384cb3d09b52c7c98bb264901285f006e51c1", "max_stars_repo_licenses": ["Apache-2.0"]... |
#!/usr/bin/env python3
import torchvision as tv
import learn2learn as l2l
from learn2learn.data.transforms import NWays, KShots, LoadData, RemapLabels, ConsecutiveLabels
from torchvision import transforms
import numpy as np
from PIL import Image
def fc100_tasksets(
train_ways=5,
train_samples=10,
test_way... | {"hexsha": "aad3f7a0d8342dbf4123c9f23a598a791047ab39", "size": 3929, "ext": "py", "lang": "Python", "max_stars_repo_path": "benchmarks/fc100_benchmark.py", "max_stars_repo_name": "hsh1108/multi-task-learning", "max_stars_repo_head_hexsha": "81ea1f5324a2a6caa6e126f4f8d309bc9382a392", "max_stars_repo_licenses": ["MIT"], ... |
SUBROUTINE W3FT10(FLN,GN,PLN,EPS,FL,WORK,TRIGS)
C$$$ SUBPROGRAM DOCUMENTATION BLOCK
C
C SUBPROGRAM: W3FT10 COMPUTES 2.5 X 2.5 S. HEMI. GRID-SCALER
C AUTHOR: JONES,R.E. ORG: W323 DATE: 84-06-28
C
C ABSTRACT: COMPUTES 2.5 X 2.5 S. HEMI. GRID OF 145 X 37 POINTS
C FROM SPECTRAL COEFFICIEN... | {"hexsha": "fb8ee53786b9bfe71bc9eda66ad5f30c5d546163", "size": 3678, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "buildscripts/libs/NCEPlibs/src/w3emc/v2.2.0/src/w3ft10.f", "max_stars_repo_name": "GMAO-SI-Team/jedi-stack", "max_stars_repo_head_hexsha": "c34e968b3f803a255a7d2d1f33c1bf8c4d1559a0", "max_stars_re... |
""" Created by Ruben Teunisse 2021 """
import nibabel as nib
import numpy as np
import os
def get_1_UCL(path, norm=True, threshold=True, ds_factor=1):
print("Start reading data")
nii_img = nib.load(path)
data = nii_img.get_fdata()
if norm:
data = (data - np.mean(data)) / np.std(da... | {"hexsha": "22a18485e78eb37540fc67a8f5e9a7f4a0915209", "size": 2727, "ext": "py", "lang": "Python", "max_stars_repo_path": "data.py", "max_stars_repo_name": "RubenTeunisse/Synthetic_Scans", "max_stars_repo_head_hexsha": "54f979fb1a794dd05cdd81b77306c7265cba711d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
[STATEMENT]
lemma bij_map: "bij f \<Longrightarrow> bij (map f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. bij f \<Longrightarrow> bij (map f)
[PROOF STEP]
using bij_betw_def inj_mapI lists_UNIV lists_image
[PROOF STATE]
proof (prove)
using this:
bij_betw ?f ?A ?B = (inj_on ?f ?A \<and> ?f ` ?A = ?B)
inj ?f \<L... | {"llama_tokens": 203, "file": "Combinatorics_Words_Reverse_Symmetry", "length": 2} |
#include <iostream>
#include <list>
#include <map>
#include <string>
#include <thread>
#include <vector>
using namespace std;
#include <leveldb/db.h>
#include <leveldb/write_batch.h>
#include <boost/format.hpp>
#include "dictmaster.hpp"
#include "log.hpp"
DictionaryMaster::DictionaryMaster(const string &path) {
... | {"hexsha": "f51dbda5c2b18f029dccb8d02ec823d3c68083f3", "size": 1674, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "watorword/dictmaster.cpp", "max_stars_repo_name": "WatorVapor/wai.native.wator", "max_stars_repo_head_hexsha": "e048df159e2952c143f8832264b20da20dcd88fa", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma mod_partition_iT_Div_Int: "
\<lbrakk> 0 < k; 0 < d \<rbrakk> \<Longrightarrow>
(A \<inter> [n * k\<dots>,d * k - Suc 0]) \<oslash> k =
(A \<oslash> k) \<inter> ([n * k\<dots>,d * k - Suc 0] \<oslash> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>0 < k; 0 < d\<rbrakk> \<Longright... | {"llama_tokens": 847, "file": "Nat-Interval-Logic_IL_IntervalOperators", "length": 7} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.