text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
from pandas.core.frame import DataFrame
import dateutil.parser as parser
import pandas as pd
import json
import transform_layer.services.data_service as data_service
import numpy as np
#data def 57
def get_service_trend_time_month(data: 'dict[DataFrame]'):
services = data[data_service.KEY_SERVICE]
skeleton_mon... | {"hexsha": "2165f2452a342d34fc3926eba0d2b4133ab7d32f", "size": 7375, "ext": "py", "lang": "Python", "max_stars_repo_path": "reporting_engine/transform_layer/calc_service_trends.py", "max_stars_repo_name": "midohiofoodbank/ftf-re-api", "max_stars_repo_head_hexsha": "47a6febb1a2ba75b883d095c4fd972c7bb33b32a", "max_stars_... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import ubelt as ub
import numpy as np
import torch
import itertools as it
class SlidingWindow(ub.NiceRepr):
"""
Slide a window of a certain shape over an array with a larger shape.
This can be used ... | {"hexsha": "21133c2eb90c27a61dcca780824e0d53f762dcc7", "size": 26544, "ext": "py", "lang": "Python", "max_stars_repo_path": "netharn/util/util_slider.py", "max_stars_repo_name": "Kitware/netharn", "max_stars_repo_head_hexsha": "9ebc8ddb33c56fe890684f3a0a6369c52ebe4742", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 11:54:37 2020
@author: Xander
"""
import pandas as pd
import numpy as np
from os import listdir
#%%
def find_csv_filenames( path_to_dir, suffix=".csv" ):
filenames = listdir(path_to_dir)
return [ filename for filename in filenames if filename.... | {"hexsha": "48f7e959509b2a51e08b31aa58bd1473288119a8", "size": 11928, "ext": "py", "lang": "Python", "max_stars_repo_path": "Results/Day Ahead/Script_to_make_tables_in_Appendix.py", "max_stars_repo_name": "xblaauw/Master_Thesis", "max_stars_repo_head_hexsha": "481eb0d6d5c8e5be956c9a374c98f6722632de78", "max_stars_repo_... |
/* test.c
An example of how to use nedalloc
(C) 2005-2007 Niall Douglas
*/
#include <stdio.h>
#include <stdlib.h>
#include <boost/detail/nedmalloc.c.h>
#define THREADS 5
#define RECORDS (100000/THREADS)
#define TORTURETEST 1
static int whichmalloc;
static int doRealloc;
static struct threadstuff_t
{
int ops;
unsig... | {"hexsha": "07d2979fcd45180640a2d4bed739f24917d562a5", "size": 7748, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "example/local_pool_test1.cpp", "max_stars_repo_name": "philippeb8/root_ptr", "max_stars_repo_head_hexsha": "3a87c726723314f52dcf93dd04f6452e76730fad", "max_stars_repo_licenses": ["BSL-1.0"], "max_st... |
#==================================================================================================
import math
import numpy as np
#==================================================================================================
def romberg(f, a, b, eps = 1e-10, nmax = 20, nmin = 2):
r = np.zeros((nmax,nmax))
... | {"hexsha": "cc07b914bdddf8930fbd8d0d6cb6a8b2f587ff54", "size": 1323, "ext": "py", "lang": "Python", "max_stars_repo_path": "cosmoslib/utils/_romberg.py", "max_stars_repo_name": "guanyilun/cosmo-codes", "max_stars_repo_head_hexsha": "a1fb44a1b61211a237080949ce4bfa9e7604083f", "max_stars_repo_licenses": ["MIT"], "max_sta... |
r"""Solve the `Cahn-Hilliard equation to generate data.
Solve the Cahn-Hilliard equation,
<https://en.wikipedia.org/wiki/Cahn-Hilliard_equation>`__, for
multiple samples in arbitrary dimensions. The concentration varies
from -1 to 1. The equation is given by
.. math::
\dot{\phi} = \nabla^2 \left( \phi^3 -
... | {"hexsha": "615d57497855824a6b1dee0418db328eefb07741", "size": 5844, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymks/fmks/data/cahn_hilliard.py", "max_stars_repo_name": "materialsinnovation/pymks", "max_stars_repo_head_hexsha": "a6c82b5cab354d804410d8fa5350bd31b0c27eae", "max_stars_repo_licenses": ["MIT"],... |
[STATEMENT]
theorem M5: "\<turnstile> \<box>[ \<box>[P]_v \<longrightarrow> \<circle>\<box>[P]_v ]_w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<turnstile> \<box>[\<box>[P]_v \<longrightarrow> \<circle>\<box>[P]_v]_w
[PROOF STEP]
proof (rule sq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. |~ \<box>[P]_v ... | {"llama_tokens": 298, "file": "TLA_Rules", "length": 4} |
# -*- coding: utf-8 -*-
##
# \file error_norm_freq.py
# \title Calculation of the relative error and the norms.
# \author Pierre Chobeau
# \version 0.1
# \license BSD 3-Clause License
# \inst UMRAE (Ifsttar Nantes), LAUM (Le Mans Université)
# \date 2017, 13 Apr.
##
import numpy as np
impo... | {"hexsha": "99472bf9af2fbfbc1ac27cce5e4eca1ee716c0f0", "size": 6331, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/error_norm_freq.py", "max_stars_repo_name": "qgoestch/sinecity_testcases", "max_stars_repo_head_hexsha": "ec04ba707ff69b5c1b4b42e56e522855a2f34a65", "max_stars_repo_licenses": ["BSD-3-Clause... |
import flow_test as ft
import helpers as hpl
import numpy as np
from PIL import Image
import matplotlib as plt
# import synthetic_tf_converter as converter
import tensorflow as tf
import data_reader as dr
# import matplotlib.mlab as mlab
# import ijremote as ij
# import losses_helper as lhpl
folder = '../dataset_sy... | {"hexsha": "1cc5ab7de4e8c93982cf962e5185601f72db7564", "size": 12512, "ext": "py", "lang": "Python", "max_stars_repo_path": "predictor.py", "max_stars_repo_name": "mozi22/ScGAN", "max_stars_repo_head_hexsha": "ce1c0bb313266c643f6b55be6f10b0d0e718a5e2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s... |
@testset "maxintfloat $T" for T in (Double16, Double32, Double64)
@test isinteger(maxintfloat(T))
# Previous integer is representable, next integer is not
@test maxintfloat(T) == (maxintfloat(T) - one(T)) + one(T)
@test maxintfloat(T) != (maxintfloat(T) + one(T)) - one(T)
@test maxintfloat(T) ... | {"hexsha": "cd06f90d0ff894d9d7924f8c8eb17182efd43e7c", "size": 2002, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/specialvalues.jl", "max_stars_repo_name": "UnofficialJuliaMirror/DoubleFloats.jl-497a8b3b-efae-58df-a0af-a86822472b78", "max_stars_repo_head_hexsha": "ccf0c6a690f81eec84caf080c99d58d11e72432d"... |
{-# LANGUAGE UndecidableInstances #-} --For the BitPack instance
module Clash.DSP.Complex where
import Clash.Prelude
import GHC.Generics
import Test.QuickCheck
import qualified Data.Complex as C
{-| I defined my own complex type so that I can write a Num instance without the RealFloat constraint. TODO: think about ... | {"hexsha": "2b1268bf411149e58714fe9c6ab520f580b0be3e", "size": 4557, "ext": "hs", "lang": "Haskell", "max_stars_repo_path": "src/Clash/DSP/Complex.hs", "max_stars_repo_name": "adamwalker/clash-utils", "max_stars_repo_head_hexsha": "f122e298b15eadce3fa5ad284a5fe49466eff3a3", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
import torch as th
import networkx as nx
import dgl
import dgl.nn.pytorch as nn
from copy import deepcopy
def _AXWb(A, X, W, b):
X = th.matmul(X, W)
Y = th.matmul(A, X.view(X.shape[0], -1)).view_as(X)
return Y + b
def test_graph_conv():
g = dgl.DGLGraph(nx.path_graph(3))
adj = g.adjacency_matrix()... | {"hexsha": "dce9a3ee98cddb61008404f57c46920702459cdd", "size": 1947, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/pytorch/test_nn.py", "max_stars_repo_name": "lgalke/dgl", "max_stars_repo_head_hexsha": "5da57663cc5c12305ac027a9a671217912f2c511", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
import unittest
from typing import Optional
from lob_data_utils import lob, model
# the goal is to compare all algorithms on test set now.
from sklearn import metrics
from sklearn.decomposition import PCA
from sklearn.svm import SVC
import pandas as pd
import numpy as np
class Test(unittest.TestCase):
def test... | {"hexsha": "d40210441c7acb5dfb4c82e130ce48219ed518d7", "size": 18642, "ext": "py", "lang": "Python", "max_stars_repo_path": "overview_val10/compare_all.py", "max_stars_repo_name": "vevurka/mt-lob", "max_stars_repo_head_hexsha": "70989bcb61f4cfa7884437e1cff2db2454b3ceff", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
from os.path import join
import os
import numpy as np
from sklearn.base import BaseEstimator,TransformerMixin
from sklearn.preprocessing import normalize
class ExtractEmbeddingSimilarities(BaseEstimator,TransformerMixin):
def __init__(self,emb_type='word2vec',
emb_dir='/10TBdrive/minje/features/e... | {"hexsha": "3d42de8deb1e21c1f2ce2bbc33c553e60a846cdf", "size": 5171, "ext": "py", "lang": "Python", "max_stars_repo_path": "features.py", "max_stars_repo_name": "minjechoi/10dimensions", "max_stars_repo_head_hexsha": "7b29423a075b98c7bf07bda26a752985e3818446", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 9, "... |
"""
$(TYPEDEF)
Structures to contain the details of a solute or solvent to
store in the results of the MDDF calculation.
$(TYPEDFIELDS)
"""
struct SolSummary
natoms::Int
nmols::Int
natomspermol::Int
end
SolSummary(s::Selection) = SolSummary(s.natoms, s.nmols, s.natomspermol)
| {"hexsha": "285479fcca34e5d9a3bac8ef5d6749318897b20c", "size": 292, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SolSummary.jl", "max_stars_repo_name": "m3g/MDDF", "max_stars_repo_head_hexsha": "efbc8e0dcf426c9b2246217eb9edaf4605318e84", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_... |
import matplotlib.pyplot as plt
import numpy as np
y = np.array([35, 25, 25, 15])
mylabels = ['Python', 'Javascript', 'C', 'Java']
myexplode = [0.2, 0, 0, 0]
plt.pie(y, labels=mylabels, explode=myexplode, shadow=True)
plt.show() | {"hexsha": "3a2257e2c58d74cc8f43524a9f12f8bd2692911a", "size": 233, "ext": "py", "lang": "Python", "max_stars_repo_path": "pizza-graphic.py", "max_stars_repo_name": "juandfr/Generate-Graphics", "max_stars_repo_head_hexsha": "f2be75e1d628d0c6105326b043d6291e59afd4e9", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#encoding=utf8
from pyltp import Segmentor
from keras.models import load_model
import numpy as np
import keras.backend as K
from keras.preprocessing.sequence import pad_sequences
import re
def get_word_dict(path):
word_dict = {}
num = 1
with open(path, 'r', encoding='utf-8')as fi:
for line in fi.re... | {"hexsha": "50c76fa3d4b7609a91d6acf20901cd92274a03a1", "size": 5053, "ext": "py", "lang": "Python", "max_stars_repo_path": "task1/predictor/predictor.py", "max_stars_repo_name": "hshrimp/Cail2018_wshong", "max_stars_repo_head_hexsha": "edc2bf59ee16c3c23d4acc6807030821f0e89176", "max_stars_repo_licenses": ["MIT"], "max_... |
#!/usr/bin/env python
import numpy
import six
n_result = 5 # number of search result to show
with open('word2vec.model', 'r') as f:
ss = f.readline().split()
n_vocab, n_units = int(ss[0]), int(ss[1])
word2index = {}
index2word = {}
w = numpy.empty((n_vocab, n_units), dtype=numpy.float32)
for... | {"hexsha": "0b10728f5864b3aa4db0c737e9850f749c014c84", "size": 1260, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/word2vec/search.py", "max_stars_repo_name": "takeratta/chainer", "max_stars_repo_head_hexsha": "02686e98cd6dc8f20979a1f3a79130f076cbfc6c", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
def data_load(name, split=0.8, seed=0, path="./data/", normalize=False):
"""
Util function to load the UCI datasets
"""
np.random.seed(seed)
df = pd.read_csv(r"" + path + name + ".csv")
if name == "boston":... | {"hexsha": "5786a6d375d68aa7bd6ea82090752275f2a154c1", "size": 4940, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/util.py", "max_stars_repo_name": "AaltoML/t-SVGP", "max_stars_repo_head_hexsha": "bfa6119ad071ca191d7a413e09b33811c18be533", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "... |
"""Proximal Policy Optimization (clip objective)."""
from copy import deepcopy
import torch
import torch.optim as optim
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
from torch.distributions import kl_divergence
import time
import numpy as np
import os
import ray
from rl.envs import WrapEn... | {"hexsha": "57b071e194fe360f0ce2cf1cd653739d17931106", "size": 13310, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl/algos/ppo.py", "max_stars_repo_name": "RohanPankaj/apex", "max_stars_repo_head_hexsha": "74e96386bf9446d1179106d6d65ea0368c1b5b27", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
# -*- coding: utf-8 -*-
"""
Script untuk menggabungkan 2 file yang terpisah (1 depan 1 belakang)
menjadi 1 file depan belakang
"""
from PyPDF2.merger import PdfFileMerger as Merger
from PyPDF2.merger import PdfFileReader as Reader
from PyPDF2.merger import PdfFileWriter as Writer
import numpy as np
def Col... | {"hexsha": "034c8874809bb91019e50093ccc4b33ade7b9f36", "size": 1036, "ext": "py", "lang": "Python", "max_stars_repo_path": "collator.py", "max_stars_repo_name": "AyahnaSyahid/a3plus", "max_stars_repo_head_hexsha": "36fd388deeb1dbe74f6f3b16506e3ceade27d57f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
import theano
import theano.tensor as T
import numpy as np
from lasagne.updates import get_or_compute_grads
from collections import OrderedDict
def graves_rmsprop(loss_or_grads, params, learning_rate=1e-4, chi=0.95, alpha=0.9, epsilon=1e-4):
r"""
Alex Graves' RMSProp [1]_.
.. math ::
n_{i} &= \ch... | {"hexsha": "ec782aed3f04cbada5d6055f30e3f448a5cc1bc9", "size": 1663, "ext": "py", "lang": "Python", "max_stars_repo_path": "ntm/updates.py", "max_stars_repo_name": "snipsco/ntm-lasagne", "max_stars_repo_head_hexsha": "65c950b01f52afb87cf3dccc963d8bbc5b1dbf69", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 316,... |
#include <huaweicloud/frs/v2/FrsClient.h>
#include <huaweicloud/core/utils/MultipartFormData.h>
#include <unordered_set>
#include <boost/algorithm/string/replace.hpp>
template <typename T>
std::string toString(const T value)
{
std::ostringstream out;
out << std::setprecision(std::numeric_limits<T>::digits10)... | {"hexsha": "e74e92b24d16297da06142ffe204caaff080fa6f", "size": 51814, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "frs/src/v2/FrsClient.cpp", "max_stars_repo_name": "huaweicloud/huaweicloud-sdk-cpp-v3", "max_stars_repo_head_hexsha": "d3b5e07b0ee8367d1c7f6dad17be0212166d959c", "max_stars_repo_licenses": ["Apache... |
# -*- coding: utf-8 -*-
"""
@author: Ana Silva
"""
import numpy as np
def _iniciateBuses(data_bus):
nP = 0
busP = np.zeros([1, 1])
text_theta = ""
text_Pinj = ""
bus = np.size(data_bus, axis=0)
for i in range(bus):
if(data_bus[i, 1] != 1):
#busP
nP = nP+1
... | {"hexsha": "d9cc771a7374273639280d2fdd5fedc0bde21be1", "size": 1076, "ext": "py", "lang": "Python", "max_stars_repo_path": "FuzzyPowerFlowDC/Functions/buses.py", "max_stars_repo_name": "anaSilva2018/TryingPy", "max_stars_repo_head_hexsha": "2698840e27c241c086471a5cb052dc4e75fa63ac", "max_stars_repo_licenses": ["MIT"], ... |
theory sort_MSortTDPermutes
imports Main
"$HIPSTER_HOME/IsaHipster"
begin
datatype 'a list = Nil2 | Cons2 "'a" "'a list"
datatype Nat = Z | S "Nat"
fun ztake :: "int => 'a list => 'a list" where
"ztake x y =
(if x = 0 then Nil2 else
case y of
| Nil2 => y
| Cons2 z xs => Cons2 z (ztak... | {"author": "moajohansson", "repo": "IsaHipster", "sha": "91f6ea3f1166a9de547722ece6445fe843ad89b4", "save_path": "github-repos/isabelle/moajohansson-IsaHipster", "path": "github-repos/isabelle/moajohansson-IsaHipster/IsaHipster-91f6ea3f1166a9de547722ece6445fe843ad89b4/benchmark/koen/sort_MSortTDPermutes.thy"} |
# Author: Quentin Bertrand <quentin.bertrand@inria.fr>
# Mathurin Massias <mathurin.massias@gmail.com>
# Salim Benchelabi
# License: BSD 3 clause
from abc import abstractmethod
import numpy as np
from numba import float64
from numba.experimental import jitclass
from numba.types import bool_
from ande... | {"hexsha": "5a2afd721bd27d6d6cad117e91f5db8bbecca15a", "size": 6757, "ext": "py", "lang": "Python", "max_stars_repo_path": "andersoncd/penalties.py", "max_stars_repo_name": "mathurinm/andersoncd", "max_stars_repo_head_hexsha": "837875b526060af58756b2cdde08124b7af3f500", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
function planC = createIMuids(planC)
% function planC = createIMuids(planC)
%
% APA, 10/21/2014
if ~exist('planC','var')
global planC
end
indexS = planC{end};
nIM = length(planC{indexS.IM});
for i = 1:nIM
% Copy beams, goals, solution, params fields from IMsetup to IMDosimetry
if ~isfield(planC{indexS.IM... | {"author": "cerr", "repo": "CERR", "sha": "d320754abad9dcb78508ab69f33ae9f644202114", "save_path": "github-repos/MATLAB/cerr-CERR", "path": "github-repos/MATLAB/cerr-CERR/CERR-d320754abad9dcb78508ab69f33ae9f644202114/CERR_core/Utilities/UID/createIMuids.m"} |
import time
import rawpy
import numpy as np
from matplotlib import pyplot
from scipy.ndimage.filters import convolve
RED_CH = 0
GREEN_CH = 1
BLUE_CH = 2
even = lambda x: x%2==0
odd = lambda x: x%2!=0
def cfa_channel(row, column):
"""Return color channel of row,column pair based on the Bayer fil... | {"hexsha": "be9a33c6f3605c4e0af40ed97f94c8774ee94960", "size": 3003, "ext": "py", "lang": "Python", "max_stars_repo_path": "demosaicing.py", "max_stars_repo_name": "rgoliveira/python-demosaicing", "max_stars_repo_head_hexsha": "76328a12b50ed8ba9473df7a6ce7b4c6ff8e36b5", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma no_error : "good_context s \<Longrightarrow> snd (execute_instruction () s) = False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. good_context s \<Longrightarrow> snd (execute_instruction () s) = False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. good_context s \<Longrig... | {"llama_tokens": 705, "file": "SPARCv8_SparcModel_MMU_Sparc_Properties", "length": 10} |
\section{Tasking}
\subsection{Introduction}
The tasking elements of PEARL are mapped on the Posix thread library
(\verb|pthread|) as far as possible.
The pthread-library suffers in Linux from the absence of a \verb|suspend|-call.
Usually this is solved by doing a blocking systemcall in a signal handler and
invoke t... | {"hexsha": "198199265bee884f422e68fb9a9c218d26c7b18b", "size": 6770, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "OpenPEARL/openpearl-code/runtime/linux/doc/tasking.tex", "max_stars_repo_name": "BenniN/OpenPEARLThesis", "max_stars_repo_head_hexsha": "d7db83b0ea15b7ba0f6244d918432c830ddcd697", "max_stars_repo_li... |
import numpy
import math
from scipy.optimize import root
from math import *
print('')
print('DARCY FRICTION FACTOR CALCULATOR')
print('')
re = float(input('Please introduce the Reynolds numer: '))
ks = float(input('Please introduce the pipe absolute roughness (inches): '))
di = float(input('Please introduce ... | {"hexsha": "47083b89fced00b96648c6b2a06ddb11018916fd", "size": 929, "ext": "py", "lang": "Python", "max_stars_repo_path": "Darcy_friction_factor_calculator.py", "max_stars_repo_name": "kjabra/hydraulic-calculations", "max_stars_repo_head_hexsha": "3f51c16b4dde5534d2179a8f807c93ed2de43962", "max_stars_repo_licenses": ["... |
import time, picamera
import numpy as np
with picamera.PiCamera() as camera:
camera.resolution = (320, 240)
camera.framerate = 24
time.sleep(2)
image = np.empty((240 * 320 * 3, ), dtype=np.uint8)
camera.capture(image, 'bgr')
image = image.reshape((240, 320, 3))
print(type(image))
| {"hexsha": "88391f5c316645c578953bf1e41f2a55edd14146", "size": 290, "ext": "py", "lang": "Python", "max_stars_repo_path": "Chapter04/programs/prog18.py", "max_stars_repo_name": "gits00/raspberry-pi-computer-vision-programming", "max_stars_repo_head_hexsha": "dfd5588c5d3e410945f862427c0f987536b04d9f", "max_stars_repo_li... |
# Copyright 2020 The DDSP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | {"hexsha": "92e8e717f2f33bdbb20f6ca43e29ec4f0d4cf806", "size": 21805, "ext": "py", "lang": "Python", "max_stars_repo_path": "ddsp/colab/colab_utils.py", "max_stars_repo_name": "jhartquist/ddsp", "max_stars_repo_head_hexsha": "31b42c2ef0bb17bf6751302bb65f4eb18bfd6c13", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
import unittest
from spn.algorithms.Inference import likelihood, log_likelihood
from spn.structure.Base import Context
from spn.structure.StatisticalTypes import MetaType
from spn.structure.leaves.histogram.Histograms import create_histogram_leaf
from spn.structure.leaves.histogram.Inference import add_histogram_infer... | {"hexsha": "f45c1ebbcc2674f6486ac0ea05b44b7ac2dd1c12", "size": 1426, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/spn/tests/test_pwl.py", "max_stars_repo_name": "tkrons/SPFlow_topdownrules", "max_stars_repo_head_hexsha": "6227fc973f4f36da7fbe25fa500d656eb7273033", "max_stars_repo_licenses": ["Apache-2.0"]... |
# AUTOGENERATED! DO NOT EDIT! File to edit: ttbarzp.ipynb (unless otherwise specified).
__all__ = ['get_elijah_ttbarzp_cs', 'get_manuel_ttbarzp_cs', 'import47Ddata', 'get47Dfeatures']
# Cell
import numpy as np
import tensorflow as tf
# Cell
def get_elijah_ttbarzp_cs():
r"""
Contains cross section information... | {"hexsha": "d8a9231416df4329b68705f67027a39e5c572589", "size": 3401, "ext": "py", "lang": "Python", "max_stars_repo_path": "bcml4pheno/ttbarzp.py", "max_stars_repo_name": "sheride/bcml4pheno", "max_stars_repo_head_hexsha": "c9629dafcdbee0a4c28ceb7b28c9862de8479a24", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
/*
* File: RoundRobinPolicy.hpp
* Author: Paolo D'Apice
*
* Created on March 5, 2012, 2:59 PM
*/
#ifndef ROUNDROBINPOLICY_HPP
#define ROUNDROBINPOLICY_HPP
#include "RoutingPolicy.hpp"
#include "net/sf1r/distributed/NodeContainer.hpp"
#include <boost/ptr_container/ptr_map.hpp>
#include <map>
NS_IZENELIB_SF1R_... | {"hexsha": "a6df1856786c62b15202b7c8add40993ea12d237", "size": 1855, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "source/net/sf1r/distributed/RoundRobinPolicy.hpp", "max_stars_repo_name": "izenecloud/izenelib", "max_stars_repo_head_hexsha": "9d5958100e2ce763fc75f27217adf982d7c9d902", "max_stars_repo_licenses": ... |
"""Custom strategies for hypothesis testing. """
import hypothesis.extra.numpy as hnp
import hypothesis.strategies as st
import numpy as np
from hypothesis import assume
# constants for various tests
COVARIANCE_MODES = ["diag", "half", "full"]
# array comparison helpers robust to precision loss
def assert_eq(x, y,... | {"hexsha": "4efec8e9b989f9d0a8a2e90d2912d5e7c5516d16", "size": 5070, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/strategies.py", "max_stars_repo_name": "jmaces/keras-adf", "max_stars_repo_head_hexsha": "e86cde14fd09a6c6cdaa5b5eebb5ae725bedc76d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 11... |
# Introduction to Linear Algebra
## What is Linear Algebra?
Linear algebra is the branch of mathematics concerning linear equations such as linear maps such as and their representations in vector spaces and through matrices. Linear algebra is central to almost all areas of mathematics [See More](https://en.wikipedia... | {"hexsha": "009f8db46b58c213321245d2b9f81b134eb0b962", "size": 2163, "ext": "py", "lang": "Python", "max_stars_repo_path": "book/_build/jupyter_execute/numpy/05-linear_algebra.py", "max_stars_repo_name": "hossainlab/dsnotes", "max_stars_repo_head_hexsha": "fee64e157f45724bba1f49ad1b186dcaaf1e6c02", "max_stars_repo_lice... |
import cv2
import numpy as np
import PostProcessing
from abc import ABCMeta, abstractmethod
"""
Author: Luqman A. M.
BackgroundSubtraction.py
Background Subtraction Algorithms Object Detection in Video Processing (Abstract Class)
Frame Difference, Running Average, Median, Online K-Means, 1-G, KDE
"""
class Backgroun... | {"hexsha": "6b62dc88cb76c077e0352a84b61faf173329dac8", "size": 2863, "ext": "py", "lang": "Python", "max_stars_repo_path": "BackgroundSubtraction.py", "max_stars_repo_name": "umanium/trafficmon", "max_stars_repo_head_hexsha": "86c138bda3c8a3e38fff273e5d61610acee123b5", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import theano.tensor as T
def binxent(output, target):
r"""Return the mean binary cross entropy cost.
The binary cross entropy of two :math:`n`-dimensional vectors :math:`o` and
:math:`t` is
.. math::
c = -\sum_{i=1}^n t_i\log(o_i) + (1-t_i)\log(1-o_i)
Parameters
----------
outp... | {"hexsha": "a73f846765cfb33b7914c36f82e9bb0b02a7d4aa", "size": 4980, "ext": "py", "lang": "Python", "max_stars_repo_path": "dlearn/utils/costfuncs.py", "max_stars_repo_name": "Cysu/dlearn", "max_stars_repo_head_hexsha": "7a2c96802ece7356a1574fbb100480f8e92dc120", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4... |
#!/usr/bin/env python
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
import argparse
import datetime
import os
import re
import sys
import traceback
import numpy as np
im... | {"hexsha": "0c3c0daee13020faba4e7c8e31c64b07911a2836", "size": 17611, "ext": "py", "lang": "Python", "max_stars_repo_path": "pipelines/toast_planck_exchange_madam.py", "max_stars_repo_name": "planck-npipe/toast-npipe", "max_stars_repo_head_hexsha": "ca3e92ea3a81a6146e246ec1d0c5bdcaea3b49f2", "max_stars_repo_licenses": ... |
try:
import pickle as pickle
except ImportError:
raise RuntimeError("Please install _pickle & pickle package")
from implementation.solver.knowledge_base import KnowledgeBase
from implementation.model.dependency_graph import DependencyGraph
from collections import defaultdict
from typing import Dict, Tuple
from... | {"hexsha": "5f43f07ffbb5f5af6aff34f1e51816b27d86f9b1", "size": 6999, "ext": "py", "lang": "Python", "max_stars_repo_path": "implementation/util/data_management.py", "max_stars_repo_name": "StijnVerdenius/KR_SAT-solver", "max_stars_repo_head_hexsha": "c8fbcca39e8640b6ecdffa67512c1d0d72d0e0be", "max_stars_repo_licenses":... |
import numpy as np
import unicodedata
import os
class OneHot(object):
def __init__(self, be, nclasses):
self.be = be
self.output = be.iobuf(nclasses, parallelism='Data')
def transform(self, t):
self.output[:] = self.be.onehot(t, axis=0)
return self.output
def image_reshape(i... | {"hexsha": "ad8592b51e88f46abac41b861ce1183cdeb22de2", "size": 4185, "ext": "py", "lang": "Python", "max_stars_repo_path": "ArtGAN/utils/utils.py", "max_stars_repo_name": "cs-chan/painting-classification", "max_stars_repo_head_hexsha": "ad9cd090c669ca636f6c048d97608092d52dd3e0", "max_stars_repo_licenses": ["BSD-3-Claus... |
```python
```
```python
from sympy import *
from math import *
x, y = Symbol('x'), Symbol('y')
from sympy.plotting import plot
from sympy.vector import Vector
from sympy.vector import CoordSys3D
from sympy.geometry import Point
N = CoordSys3D('N')
```
```python
class taylor_polys:
def __init__(self):
... | {"hexsha": "c6a30e2c7e56cc6bfbf1326f1391fd82bc263789", "size": 23198, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "Math/Math - Calculus II.ipynb", "max_stars_repo_name": "AlephEleven/awesome-projects", "max_stars_repo_head_hexsha": "871c9cd6ef12ad7b0ee9f1bf4b296e2d1ff78493", "max_stars_repo_licen... |
# -*- coding:utf-8 -*-
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 ... | {"hexsha": "68dfd038bd0d559314b399ba8a1246ac6f37f87e", "size": 4054, "ext": "py", "lang": "Python", "max_stars_repo_path": "built-in/MindSpore/Official/ocr/CTPN_for_MindSpore/infer/SDK/main_ctpn_ms_opencv.py", "max_stars_repo_name": "Ascend/modelzoo", "max_stars_repo_head_hexsha": "f018cfed33dbb1cc2110b9ea2e233333f71cc... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Program to reconstruct Phantom-Head Model using Algebraic %%%%%%%%%
%%%% Reconstruction Method. %
%%%% This code is implemented By : %% ... | {"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/41709-reconstruction-of-image-from-projectio... |
import pandas as pd
import numpy as np
class Data():
"Class for manage the data base"
client_table = pd.read_csv('./DataBase/client.csv').set_index('id')
corporation_table = pd.read_csv('./DataBase/corporation.csv').set_index('id')
contract_table = pd.read_csv('./DataBase/contract.csv').set_index('i... | {"hexsha": "5e9b44be195da81050b89b440736b84c45f1288d", "size": 3198, "ext": "py", "lang": "Python", "max_stars_repo_path": "broker-manager/Data.py", "max_stars_repo_name": "victor-prado/broker-manager", "max_stars_repo_head_hexsha": "b056cf59247e41e890b1443c0c9e44832b79c51a", "max_stars_repo_licenses": ["MIT"], "max_st... |
import sklearn
from sklearn.utils.validation import check_array, check_random_state, _deprecate_positional_args
from sklearn.model_selection._split import _BaseKFold, _RepeatedSplits
class GroupKFold(_BaseKFold):
"""K-fold iterator variant with non-overlapping groups.
The same group will not appear in two diff... | {"hexsha": "fc35fa77756464e55ca81cba17bf752b42eb81c3", "size": 8447, "ext": "py", "lang": "Python", "max_stars_repo_path": "sklearn_repeated_group_k_fold.py", "max_stars_repo_name": "BbChip0103/sklearn_repeated_group_k_fold", "max_stars_repo_head_hexsha": "386f267f8e632f6167600e75812c3539710e16a2", "max_stars_repo_lice... |
import os
import numpy as np
from matplotlib.tri import Triangulation
from shapely.geometry import Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon,GeometryCollection
import mshapely
from mshapely.misc import add_method
from .io import createGEO,createMSH
#
# Create Gmsh
#
@add_method(GeometryCollecti... | {"hexsha": "1e60c0a933d918134744915d5b9ff267d95d1070", "size": 799, "ext": "py", "lang": "Python", "max_stars_repo_path": "mmesh/mmesh.py", "max_stars_repo_name": "meracan/mmesh", "max_stars_repo_head_hexsha": "b73b52b56d8f8f3127ebd5bbd2c13605ef30f88f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
[STATEMENT]
lemma rt_fresh_asI [intro!]:
assumes "rt1 \<sqsubseteq>\<^bsub>dip\<^esub> rt2"
and "rt2 \<sqsubseteq>\<^bsub>dip\<^esub> rt1"
shows "rt1 \<approx>\<^bsub>dip\<^esub> rt2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. rt1 \<approx>\<^bsub>dip\<^esub> rt2
[PROOF STEP]
using assms
[PROOF STATE... | {"llama_tokens": 365, "file": "AODV_variants_e_all_abcd_E_Fresher", "length": 3} |
from typing import List, Tuple
import numpy as np
from PIL import Image
import pytorch_lightning as pl
import torch
from torchvision.models import resnet18
from torchvision import transforms
from ml_models.model_initializer import ModelInitializer
class PredPostureNet(pl.LightningModule):
def __init__(self):
... | {"hexsha": "c2f113da6fba50760487979b0fa64608a781a203", "size": 2148, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml_models/classify_images/infer.py", "max_stars_repo_name": "siruku6/ml_sample", "max_stars_repo_head_hexsha": "d35fd456ee6376fa69c2ff6abbd0790585d7917b", "max_stars_repo_licenses": ["MIT"], "max_... |
import os
import random
import numpy as np
import pandas as pd
def set_random_seed(seed=42):
random.seed(seed)
os.environ["PYTHONHASHSEED"] = str(seed)
np.random.seed(seed)
def set_display_options():
pd.set_option("max_colwidth", 1000)
pd.set_option("max_rows", 50)
pd.set_option("max_column... | {"hexsha": "d98213a54bed6fe63049234194f24aa16f814a04", "size": 384, "ext": "py", "lang": "Python", "max_stars_repo_path": "ds_utils/config.py", "max_stars_repo_name": "dylanjcastillo/nlp-snippets", "max_stars_repo_head_hexsha": "1cb2a9d4ad5de72714a617ca223f5f822ca72aea", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# importing libraries
## importing RDKIT packages
from rdkit import Chem,DataStructs,RDLogger
from rdkit.Chem import AllChem
from rdkit.Chem.rdmolfiles import SDWriter
from rdkit.Chem.Subshape import SubshapeAligner, SubshapeBuilder, SubshapeObjects
## importing open drug dicovery packages
import oddt
import oddt.doc... | {"hexsha": "dbde90a343c072d17ca44dd214a229ddfe052292", "size": 9046, "ext": "py", "lang": "Python", "max_stars_repo_path": "molpro/shape_alignment/predict.py", "max_stars_repo_name": "boltzmannlabs/boltpro", "max_stars_repo_head_hexsha": "3ddebbeb10191150a29fc81ef4336ec2dbe88092", "max_stars_repo_licenses": ["Apache-2.... |
import Data.Vect
import Decidable.Equality
myExactLength : {m : _} -> (len : Nat) -> (input : Vect m a) -> Maybe (Vect len a)
myExactLength len input = case decEq m len of
Yes Refl => Just input
No contra => Nothing | {"hexsha": "dc0af84185f2418b539900a5258e18dc05fb467d", "size": 282, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "src/ch8/ExactLengthDec.idr", "max_stars_repo_name": "trevarj/tdd_idris_examples", "max_stars_repo_head_hexsha": "63a7128a797b64cb0ba54562778cdf9712b4d9f5", "max_stars_repo_licenses": ["Unlicense"],... |
#!/usr/bin/env python3
import logging
import coloredlogs
import sys
import time
import socket
from io import BytesIO
import numpy as np
from radar_display import TCP_PORT, IMAGE_DIMENSIONS
def main():
coloredlogs.install(level="DEBUG")
data = np.zeros((IMAGE_DIMENSIONS[0], IMAGE_DIMENSIONS[1]), dtype="f")
... | {"hexsha": "8e8b6d025085c65d07d62f1641b1fa54a99c79b4", "size": 1612, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sock_server.py", "max_stars_repo_name": "creikey/radar-display", "max_stars_repo_head_hexsha": "d8a7f829a00652fc4d3d6aa8dbec67361425c06f", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy as np
from semisup_learn.frameworks.SelfLearning import SelfLearningModel
from six import print_ as print
from examples.plotutils import evaluate_and_plot
from semisup_learn.frameworks.CPLELearning import CPLELearningModel
from semisup_learn.methods.scikitWQDA import WQDA
# number of data points
N = 60
s... | {"hexsha": "42c83af640e4cbaa29579ef2db19f859e4842dbb", "size": 1601, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/compare_gaussian_methods.py", "max_stars_repo_name": "oroszgy/semisup-learn", "max_stars_repo_head_hexsha": "03c1e0ba6a3c748ea146cac07776743dd37b3641", "max_stars_repo_licenses": ["MIT"],... |
import numpy as np
from sklearn.metrics import mean_squared_error
from sklearn.metrics import roc_auc_score as roc_auc
from fedot.core.composer.metrics import RMSE, ROCAUC, Silhouette
from fedot.core.data.data import InputData, OutputData
from fedot.core.repository.tasks import TaskTypesEnum
class MetricByTask:
... | {"hexsha": "d322ba52a6a4068b30d3e9f748c4d5b87390b0c7", "size": 2555, "ext": "py", "lang": "Python", "max_stars_repo_path": "fedot/utilities/define_metric_by_task.py", "max_stars_repo_name": "technocreep/FEDOT", "max_stars_repo_head_hexsha": "c11f19d1d231bd9c1d96d6e39d14697a028f6272", "max_stars_repo_licenses": ["BSD-3-... |
## Set up and plot hypothetical paths of productivity process
## Set up scenarios
# Each scenario has ID, theta, lambda, phi, gR, R0, A0
scenario <- c('A','B','C','D','E')
theta <- c(.01,.01,.01,.01,.01)
lambda <- c(1,1,1,1,.8)
phi <- c(0,.8,-.8,0,0)
gR <- c(.02,.02,.01,.04,.02)
R0 <- c(1,1,2,1,1)
A0 <- c(1,10,1,.9,10... | {"hexsha": "cf68f9cb1bd57c29f99ef5ccd3027b7365fa6299", "size": 2557, "ext": "r", "lang": "R", "max_stars_repo_path": "code/Guide_Sim_Prod.r", "max_stars_repo_name": "dvollrath/StudyGuide", "max_stars_repo_head_hexsha": "b4bb0b794ecf3953cd93b2614ab850253e48d7e2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 8,... |
import numpy as np
import copy
class Solution:
def checkall(self, grid: [[int]]) -> bool:
for i in range(len(grid)):
for j in range(len(grid[i])):
if grid[i][j] == 1:
return False
return True
def rot_helper(self, rx, ry, grid:[[int]]) -> bool:
... | {"hexsha": "317cb41ba11fb1707cc51553bba85f78953fcc6f", "size": 1566, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/Solution994.py", "max_stars_repo_name": "ArkiWang/LeetcodePy", "max_stars_repo_head_hexsha": "6b4af8da843910823f7f53989bbda4ec8e6dad15", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
'''
This Python Script uses Scikit-Learn's KNeighborsRegressor for Regression and
calculates the Mean Squared Error
Python : 3.6
Modules : Pandas, Scikit-learn
'''
#Imports
import numpy as np
from pandas import read_csv
from sklearn.neighbors import KNeighborsRegressor
#No of Neighbors
no_of_neighbors = 3
Train_D... | {"hexsha": "c05737357209205b7a6209a384c1e62cac5aeef9", "size": 1009, "ext": "py", "lang": "Python", "max_stars_repo_path": "Machine Learning/knn.py", "max_stars_repo_name": "souvik3333/Group-G", "max_stars_repo_head_hexsha": "9bbde5bc3d43e55f329df4690b677fee70405fb5", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
parse_repo(res::AbstractString) =
parse(Core.ResRepoTree, joinpath(get_working_dir(), extract_basename(res)));
parse_repo(res::AbstractString, tt) =
Core.ResRepoTree(get_working_dir(),res,tt);
function extract_basename(res::AbstractString)
res_name = basename(res);
res != res_name && warn("Only the fil... | {"hexsha": "fa973d431c40b4471041cb4100ad94e412ed9c2b", "size": 400, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/interface/Parser.jl", "max_stars_repo_name": "josePereiro/MyResults.jl", "max_stars_repo_head_hexsha": "18193b0a79b471e4770663a993d0972051c66bc0", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
"Sparse eigenvalue solvers"
from info import __doc__
from arpack import *
from lobpcg import *
__all__ = filter(lambda s:not s.startswith('_'),dir())
from numpy.testing import Tester
test = Tester().test
bench = Tester().bench
| {"hexsha": "49c1e8c455dbaa961e169ce6673c7215909b6c66", "size": 230, "ext": "py", "lang": "Python", "max_stars_repo_path": "scipy/sparse/linalg/eigen/__init__.py", "max_stars_repo_name": "lesserwhirls/scipy-cwt", "max_stars_repo_head_hexsha": "ee673656d879d9356892621e23ed0ced3d358621", "max_stars_repo_licenses": ["BSD-3... |
module PyFOOOF
using PyCall
#####
##### init
#####
const fooof = PyNULL()
function __init__()
# all of this is __init__() so that it plays nice with precompilation
# see https://github.com/JuliaPy/PyCall.jl/#using-pycall-from-julia-modules
copy!(fooof, pyimport("fooof"))
# don't eval into the module... | {"hexsha": "a52019a2efa36dda7ca784ebda18ad8a671db95e", "size": 709, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/PyFOOOF.jl", "max_stars_repo_name": "beacon-biosignals/PyFOOOF.jl", "max_stars_repo_head_hexsha": "51b40ebbc302564c717ec0a7c2822f3c5d91fa24", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import commentjson
import logging
import os
import sys
import numpy as np
import time
import collections
from net.monodepth_dataloader impo... | {"hexsha": "d0633382502ece4ef933447d8e4ad7cb23b721ea", "size": 5611, "ext": "py", "lang": "Python", "max_stars_repo_path": "fusion_net/train.py", "max_stars_repo_name": "ClovisChen/LearningCNN", "max_stars_repo_head_hexsha": "cd9102a3d71f602024558d818039f5b759c92fa5", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | {"hexsha": "7cfe8ef3d7df2a0faf0ed9d0b5e9a66ff7f534cd", "size": 14295, "ext": "py", "lang": "Python", "max_stars_repo_path": "framework/DataObjects/HistorySet.py", "max_stars_repo_name": "sonatsen/raven", "max_stars_repo_head_hexsha": "30764491e7ecaa16de2a4e0ddab3bc9e169e5f95", "max_stars_repo_licenses": ["Apache-2.0"],... |
##### MTBdelay_app -- view.py
##### (C) Mark Mace 2019
##### Gets data and makes plot for web-app
#!/home/ubuntu/anaconda3/bin/python
from flask import Flask, Markup, render_template, request, send_file
from mbtdelay import app
import pandas as pd
import numpy as np
from io import BytesIO
import matplotlib.pyplot as p... | {"hexsha": "6ea28a27c3aa3d272c6a9d4bded974f3785c7b91", "size": 6953, "ext": "py", "lang": "Python", "max_stars_repo_path": "mbtdelay/views.py", "max_stars_repo_name": "markfmace/MBTdelay_webapp", "max_stars_repo_head_hexsha": "e51b806cc22a25cd602ae8d8512e30acdfcb6ec0", "max_stars_repo_licenses": ["Unlicense"], "max_sta... |
# 5 actions - 0, 1(Buy), 2(Sell)
import numpy as np
import math
import random
import enum
import gym
#import policyopt
#from policyopt import util
#MAX_pIndex = 100.
# returns the sigmoid
def sigmoid(x):
return 1 / (1 + math.exp(-x))
class Actions(enum.Enum):
Skip = 0
Buy = 1
Sell = 2
class dayt... | {"hexsha": "dc1b0f1870e32b2bc4897b075fa009ecbdd35b00", "size": 3592, "ext": "py", "lang": "Python", "max_stars_repo_path": "daytradeEnv101.py", "max_stars_repo_name": "alanyuwenche/spinningup_DT", "max_stars_repo_head_hexsha": "fefd982917bd792e7f408e32d0b0f9a554fb329b", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
from .tools import add_constant, categorical
from statsmodels.tools._testing import PytestTester
__all__ = ['test', 'add_constant', 'categorical']
test = PytestTester()
| {"hexsha": "0050de350fb8188263624d74f59532fb0bd614d5", "size": 171, "ext": "py", "lang": "Python", "max_stars_repo_path": "venv/Lib/site-packages/statsmodels/tools/__init__.py", "max_stars_repo_name": "EkremBayar/bayar", "max_stars_repo_head_hexsha": "aad1a32044da671d0b4f11908416044753360b39", "max_stars_repo_licenses"... |
[STATEMENT]
lemma inj_on_compose_f': "inj_on (\<lambda>g. compose (f ` J) g f') (extensional J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. inj_on (\<lambda>g. compose (f ` J) g f') (extensional J)
[PROOF STEP]
proof (rule inj_on_inverseI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>x. x \<in> extens... | {"llama_tokens": 476, "file": null, "length": 6} |
import numpy as np
graphical_import = True
To_Svg = False
n_trials = 100
n_omega = 10
n_shifts = 16
# Figure 8
num_channels = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
omega_range_M_channels = np.arange(1 * np.pi, 21 * np.pi, np.pi)
omega_range_M_channels_string = [
r"$\pi$",
r"$2\pi$",
r"$3\pi$",
r"$4\pi$",... | {"hexsha": "c7c44bd69cacd7c2c2490e086748aa138ab5e4ee", "size": 1711, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/SimulationSettings.py", "max_stars_repo_name": "karenadam/Sampling-and-Reconstruction-of-Bandlimited-Signals-with-Multi-Channel-Time-Encoding", "max_stars_repo_head_hexsha": "d4d9d41bf82002e8... |
"""
Test spectra_wave_shape_5 against analytical fields evaluated by sympy
"""
import sys, os
import math, cmath
import pytest
import numpy as np
import shape_5
import corsys
import tfun
from spectral_wave_data import SpectralWaveData
assert sys.version_info > (3, 4)
# We check all permutations of...
ipols = [0,... | {"hexsha": "7c1d27c762f3dceffb38ec124491af82f5450046", "size": 13013, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/python/tests_using_sympy/test_shape5.py", "max_stars_repo_name": "TormodLandet/spectral_wave_data", "max_stars_repo_head_hexsha": "c43710e769c3d7d3c4f832ab74e456706b361493", "max_stars_repo... |
[STATEMENT]
lemma higher_differentiable_Taylor1:
fixes f::"'a::real_normed_vector \<Rightarrow> 'b::banach"
assumes hd: "higher_differentiable_on S f 2" "open S"
assumes cs: "closed_segment X (X + H) \<subseteq> S"
defines "i \<equiv> \<lambda>x. ((1 - x)) *\<^sub>R nth_derivative 2 f (X + x *\<^sub>R H) H"
s... | {"llama_tokens": 754, "file": "Smooth_Manifolds_Smooth", "length": 2} |
from __future__ import print_function
#Transpose and Flatten
import numpy
mat=[]
n, m = map(int, input().split())
for i in range(n):
mat.append(list(map(int, input().split())))
matrix=numpy.array(mat)
print (numpy.transpose(matrix))
print (matrix.flatten())
#Shape and Reshape
import numpy
a=list(m... | {"hexsha": "066b9c02bece4dbffdc8997a84788247516470f3", "size": 10376, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts.py", "max_stars_repo_name": "stephanie-tahtouh/adm-hw1", "max_stars_repo_head_hexsha": "9d236e04e77ec8610b5dbfa3193aa2a2d0934c29", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import numpy as np
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms.functional as TF
import torch.nn.functional as F
from torch.autograd import Variable
from learning.minicity import MiniCity
from learning.model import convert_bn_to_instancenorm, convert_bn_to_evonorm, convert_bn_to_... | {"hexsha": "850f28d86229118ab83b4299dc6ec7cd369e5838", "size": 10252, "ext": "py", "lang": "Python", "max_stars_repo_path": "learning/utils.py", "max_stars_repo_name": "hoya012/semantic-segmentation-tutorial-pytorch", "max_stars_repo_head_hexsha": "9fee8f5db3806a35ba62f827974e87223e018083", "max_stars_repo_licenses": [... |
#ifndef TREEDAG_DECOMPOSITIONDAG_HPP
#define TREEDAG_DECOMPOSITIONDAG_HPP
#include "separatorConfig.hpp"
#include "separation.hpp"
#include <boost/graph/adjacency_list.hpp>
#include <boost/unordered_map.hpp>
#include <boost/bimap.hpp>
#include <boost/bimap/unordered_set_of.hpp>
namespace treeDAG {
struct Separato... | {"hexsha": "02e9c95078d9ee9411b56d2e858d000736eb56ca", "size": 4846, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "treeDAG/decompositionDAG.hpp", "max_stars_repo_name": "thomasfannes/treeDAG", "max_stars_repo_head_hexsha": "c29eec45f0f08fec2d41bc163b26d8aaf9a68f6c", "max_stars_repo_licenses": ["MIT"], "max_stars... |
"""
Feature Importance Evaluator Table Comparator for feature importance measures
Classes:
- :class:`~seqgra.comparator.fietablecomparator.FIETableComparator`: collects feature importance evaluator information in text file
"""
from typing import List, Optional
import os
import numpy as np
import pandas as pd
imp... | {"hexsha": "144ece96cd4b03ba0405ccd5051c27ab74004724", "size": 7075, "ext": "py", "lang": "Python", "max_stars_repo_path": "seqgra/comparator/fietablecomparator.py", "max_stars_repo_name": "gifford-lab/seqgra", "max_stars_repo_head_hexsha": "3c7547878ecda4c00572746b8a07e0d614c9dbef", "max_stars_repo_licenses": ["MIT"],... |
import numpy as np
import plotly.graph_objects as go
from scipy import stats
from tqdm import tqdm
from src.implem.data import DataTransformers
from src.implem.orchester import AdmissionGroup
PLOT_LEGEND_LAYOUT = { "height":800,
"width":1500,
"legend_orientation":"h"}
c... | {"hexsha": "8ef87bb956a2d95887f7f188afbe2f9f90fc4a70", "size": 6675, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments_track/ab_bayes/src/implem/plots.py", "max_stars_repo_name": "elisarchodorov/ML-Recipes", "max_stars_repo_head_hexsha": "a648151f6c88b3e0068df551c41a0c84081645f1", "max_stars_repo_licen... |
section "Closest Pair Algorithm"
theory Closest_Pair
imports Common
begin
text\<open>
Formalization of a slightly optimized divide-and-conquer algorithm solving the Closest Pair Problem
based on the presentation of Cormen \emph{et al.} \<^cite>\<open>"Introduction-to-Algorithms:2009"\<close>.
\<close>
subsecti... | {"author": "isabelle-prover", "repo": "mirror-afp-devel", "sha": "c84055551f07621736c3eb6a1ef4fb7e8cc57dd1", "save_path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel", "path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel/mirror-afp-devel-c84055551f07621736c3eb6a1ef4fb7e8cc57dd1/thys/Closest_Pair_... |
! MIT License
!
! Copyright (c) 2010-present David A. Kopriva and other contributors: AUTHORS.md
!
! 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 l... | {"hexsha": "83d267b5ea09c57041f7366a7682ae996452f6d6", "size": 3661, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Source/Categories/ObjectArrayAdditions.f90", "max_stars_repo_name": "HigherOrderMethods/HOHQMesh", "max_stars_repo_head_hexsha": "2fc5ff1a1f7bef464b41a435d9c8411662de84b1", "max_stars_repo_licen... |
using SpatialGrids
using StaticArrays
using Test
include("spatial_grid_test.jl")
| {"hexsha": "ee9428ec62f9cbdcc7aab21b0218a6007d7aa416", "size": 82, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "JuliaTagBot/SpatialGrids.jl", "max_stars_repo_head_hexsha": "bb6526394b4812064a4fca4d883c72e409d86dd5", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
\section{Decay models}
\label{sect:newmodel}
\subsection{Introduction to decay models}
{\it Anders put text here...}
%EvtGen is
%organized as a framework in which decays are added as
%modules, as known as models.
%This section explains the process of writing
%modules for new decay processes.
Each decay model is a... | {"hexsha": "20db0755008f73a89b5a2f663d9f98283081452b", "size": 16464, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "EvtGen1_06_00/doc/evt_wrtmodel.tex", "max_stars_repo_name": "klendathu2k/StarGenerator", "max_stars_repo_head_hexsha": "7dd407c41d4eea059ca96ded80d30bda0bc014a4", "max_stars_repo_licenses": ["MIT"]... |
module cooling
use gas ! Contains gas structure and gas exploitation functions
public
!*****************************************************************************************************************
!
! OVERVIEW
!
! SUBROUTINES IN THIS MODULE
!
! cooling_read_cooling_efficiency : Read the c... | {"hexsha": "56c9e514da437c0d75b2edfee92445c8e4c0d2a4", "size": 13663, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/lib/cooling.f90", "max_stars_repo_name": "cousinm/G.A.S.", "max_stars_repo_head_hexsha": "965f762c365f054bf3d59013593fdb9849d79b42", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
# ----------------------------------------------------------------------------
# Title: Scientific Visualisation - Python & Matplotlib
# Author: Nicolas P. Rougier
# License: BSD
# ----------------------------------------------------------------------------
import numpy as np
import matplotlib.pyplot as plt
import m... | {"hexsha": "88a9377893db4fc2f5048d2336cea72ff934579e", "size": 888, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/animation/sine-cosine.py", "max_stars_repo_name": "geo7/scientific-visualization-book", "max_stars_repo_head_hexsha": "71f6bac4db7ee2f26e88052fe7faa800303d8b00", "max_stars_repo_licenses": ["B... |
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
Version of the inference script that writes all output to a single directory.
"""
import argparse
import datetime
import os
import time
import numpy as np
import pandas as pd
import rasterio
import rasterio.mask
import torch... | {"hexsha": "b7458aaa3b5c3cbf2372fc54ddff646cab5927ae", "size": 5989, "ext": "py", "lang": "Python", "max_stars_repo_path": "inference.py", "max_stars_repo_name": "microsoft/poultry-cafos", "max_stars_repo_head_hexsha": "ee89f99b912eab3080a98cb9c2aaf3665a19b8cf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14... |
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import numpy as np
import theano
import theano.tensor as T
import treeano
fX = theano.config.floatX
def test_variable1():
i = T.iscalar()
o = treeano.core.variable.VariableWrapper("foo", variable=i).var... | {"hexsha": "96c80c142ad05732b35bb1a5432d036705649235", "size": 1382, "ext": "py", "lang": "Python", "max_stars_repo_path": "u24_lymphocyte/third_party/treeano/core/tests/variable_test.py", "max_stars_repo_name": "ALSM-PhD/quip_classification", "max_stars_repo_head_hexsha": "7347bfaa5cf11ae2d7a528fbcc43322a12c795d3", "m... |
import io
import numpy as np
import pandas as pd
import json
import pickle
from flask import current_app
from flask_restx import Namespace, Resource
from src.vendor.IBM import cloudant, cos
from src.data.make_dataset import get_dataset
def make_namespaces(api):
cloudant_client = cloudant.get_client(
cur... | {"hexsha": "6299c88734fae1adffee473319efa73cddfa8281", "size": 6086, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/api_factory.py", "max_stars_repo_name": "jcarlosgalvezm/ue_master-TFM", "max_stars_repo_head_hexsha": "57cd0264e4893b641d73450f18838671b1b0d4a4", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import numpy as np
import pandas as pd
# Preprocessing
def to_float(x):
x = x.replace('$', '')
x = x.replace(',', '')
x = float(x)
return x
def zip_5d(Zip, State):
# fix zip code with error
zero_head = ['CT','MA','ME','NH','NJ','NY','PR','RI','VT','VI','AE','AE']
if (Zip == 9999) or (Zip =... | {"hexsha": "3e96b8888cab42f21cff594b95f69a7354d033df", "size": 9866, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocessing.py", "max_stars_repo_name": "calvinccs/MBA_dissertation", "max_stars_repo_head_hexsha": "237a590ae06041b468751bdb725c985872d01603", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
Definition Unique (X: Type) ( p : X -> Prop) := exists x : X, and (p x) (forall y : X, ( p y -> (x = y))).
Axiom the : forall (X: Type) (p : X -> Prop), Unique X p -> X.
Axiom the_def : forall (X: Type) (p : X -> Prop) (e :Unique X p), p ( (the X p) e ).
Theorem uni : forall ( X: Type) (p : X -> Prop) (e : U... | {"author": "owl77", "repo": "ModalTypeCoq", "sha": "952fa26f60c74d0a51a8cb21e466dcd66a90c578", "save_path": "github-repos/coq/owl77-ModalTypeCoq", "path": "github-repos/coq/owl77-ModalTypeCoq/ModalTypeCoq-952fa26f60c74d0a51a8cb21e466dcd66a90c578/meixner.v"} |
[STATEMENT]
lemma sorted_induct [consumes 1, case_names Nil Cons, induct pred: sorted]:
"P xs" if "sorted cmp xs" and "P []"
and *: "\<And>x xs. sorted cmp xs \<Longrightarrow> P xs
\<Longrightarrow> (\<And>y. y \<in> set xs \<Longrightarrow> compare cmp x y \<noteq> Greater) \<Longrightarrow> P (x # xs)"
[... | {"llama_tokens": 5334, "file": null, "length": 49} |
from io import BytesIO
import cv2
import numpy as np
from lxml import html
from reportlab.graphics import renderPM
from svglib.svglib import svg2rlg
def captcha_preprocessing(svg_data: str) -> np.array:
"""
Parsing SVG file body. remove useless element, save SVG as image
:param svg_data: string with full... | {"hexsha": "b8adbfad4b8f531e32658ff5dbf25aeaeabaf285", "size": 2390, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/MathCaptcha/math_captcha_solve/preprocesing.py", "max_stars_repo_name": "parkun-by/mvd.gov.by-captcha", "max_stars_repo_head_hexsha": "6e76ba08f98d6b2ea2709bca579355d5a9d9656c", "max_stars_rep... |
\section{Design}
This chapter describes the general design of Tsukiji.
We will discuss the architecture of the code base of Tsukiji and the dependencies that the program relies on.
For more detailed issues during the process of implementation, see section \ref{implementation}.
\subsection{Architecture}
Tsukiji consist... | {"hexsha": "667caa1c7627a3a16b83f02008546618e90982e9", "size": 3225, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/design.tex", "max_stars_repo_name": "Tribler/decentral-market", "max_stars_repo_head_hexsha": "77e64d9e08936cbcdaa735e241a7d89355fb6eb3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
# coding: utf-8
# # The Excel Autograder
# In[49]:
# get_ipython().run_cell_magic('javascript', '', "\nJupyter.keyboard_manager.command_shortcuts.add_shortcut('/', {\n help : 'run all cells',\n help_index : 'zz',\n handler : function (event) {\n IPython.notebook.execute_all_cells();\n return... | {"hexsha": "d17d71089a4856de98fb2fe84a039a9f0280e044", "size": 153359, "ext": "py", "lang": "Python", "max_stars_repo_path": "Autograder-unzipped-Excel.py", "max_stars_repo_name": "digitaldatastreams/excel-grader", "max_stars_repo_head_hexsha": "57caca6f9c00396ff81576adc04566945fde2bf7", "max_stars_repo_licenses": ["Un... |
/*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
** **
** This file forms part of the Underworld geophysics modelling application. **
** ... | {"hexsha": "8f8b5cf72a34e3e0d5f3aee2225b85b7e30f577b", "size": 51252, "ext": "c", "lang": "C", "max_stars_repo_path": "underworld/libUnderworld/StgFEM/Discretisation/src/FeEquationNumber.c", "max_stars_repo_name": "rbeucher/underworld2", "max_stars_repo_head_hexsha": "76991c475ac565e092e99a364370fbae15bb40ac", "max_sta... |
[STATEMENT]
lemma DERIV_unique: "DERIV f x :> D \<Longrightarrow> DERIV f x :> E \<Longrightarrow> D = E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>(f has_field_derivative D) (at x); (f has_field_derivative E) (at x)\<rbrakk> \<Longrightarrow> D = E
[PROOF STEP]
unfolding DERIV_def
[PROOF STATE]
proof ... | {"llama_tokens": 244, "file": null, "length": 2} |
using Test
@testset "SAC tests" begin
include("construction.jl")
include("io.jl")
include("operations.jl")
include("diff.jl")
include("integrate.jl")
include("stack.jl")
include("great_circle.jl")
include("rotate_to_gcp.jl")
include("statistics.jl")
include("util.jl")
end
| {"hexsha": "841bbb45360c31e2a8ee13e9696f904a8f2ee56f", "size": 314, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "anowacki/SAC.jl", "max_stars_repo_head_hexsha": "fd992b59b5416dd55a0917ad42c03df2d8d86ac9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 10, "max... |
"""
Elements of Infinite Polynomial Rings
AUTHORS:
- Simon King <simon.king@nuigalway.ie>
- Mike Hansen <mhansen@gmail.com>
An Infinite Polynomial Ring has generators `x_\\ast, y_\\ast,...`, so
that the variables are of the form `x_0, x_1, x_2, ..., y_0, y_1,
y_2,...,...` (see :mod:`~sage.rings.polynomial.infinite_p... | {"hexsha": "f4168592a1e8f6f4a163213cdca8a71a3aa8b800", "size": 53150, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sage/rings/polynomial/infinite_polynomial_element.py", "max_stars_repo_name": "fredstro/sage", "max_stars_repo_head_hexsha": "c936d2cda81ec7ec3552a3bdb29c994b40d1bb24", "max_stars_repo_licens... |
import numpy, sys
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
from scipy.signal import decimate
from numpy import zeros
def get_samples(filename):
f = open(filename, "rb")
bytestream = numpy.fromfile(f, dtype=numpy.uint8)
f.close()
iq = get_iq(bytestream)
return iq
def get_iq(bytes):
i... | {"hexsha": "f675b9eafba45b4b6980473494f710caef111ca2", "size": 1929, "ext": "py", "lang": "Python", "max_stars_repo_path": "experimental/rf_stream.py", "max_stars_repo_name": "VedantParanjape/sdr-demodulator", "max_stars_repo_head_hexsha": "89dc7aa6cbf8d4abb2459cfdce767b6ae9aceb2f", "max_stars_repo_licenses": ["MIT"], ... |
import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as functional
import torch.nn.init as init
import numpy as np
import dgl
class GCN(nn.Module):
def __init__(self, input_size, output_size, k_node2choose):
super(GCN, self).__init__()
self.k_node2choose = k_node2c... | {"hexsha": "ad44fb5ba721077fb47292ab232c01ab51a8edb0", "size": 5887, "ext": "py", "lang": "Python", "max_stars_repo_path": "model.py", "max_stars_repo_name": "GSL4Rec/GSL4Rec", "max_stars_repo_head_hexsha": "9cf8964957a6d9962bef42bd4908b4f10ef0771c", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 1, "max... |
[STATEMENT]
lemma divisors_base_zero:
fixes a b :: "('a :: ring_no_zero_divisors) hyperdual"
assumes "Base (a * b) = 0"
shows "Base a = 0 \<or> Base b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Base a = (0::'a) \<or> Base b = (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Bas... | {"llama_tokens": 201, "file": "Hyperdual_Hyperdual", "length": 2} |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from unittest.mock import MagicMock
from xml.etree.ElementTree import Element, tostring
import numpy as np
from openvino.tools.mo.back.ie_ir_ver_2.emitter import soft_get, xml_shape, serialize_runtime_info
from openvino... | {"hexsha": "b14451e5a1f9204c97a2389f4ac98b1014d17390", "size": 5138, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/mo/unit_tests/mo/back/ie_ir_ver_2/emitter_test.py", "max_stars_repo_name": "pazamelin/openvino", "max_stars_repo_head_hexsha": "b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48", "max_stars_repo_lic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.