text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
# Copyright 2022 Maximilien Le Clei.
#
# 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 w... | {"hexsha": "cfbae4e5c55bb13a487a0d2dab4a9a780cb016b1", "size": 3175, "ext": "py", "lang": "Python", "max_stars_repo_path": "bots/network/dynamic/conv_rnn/gravity.py", "max_stars_repo_name": "MaximilienLC/nevo", "max_stars_repo_head_hexsha": "c701a1202bc18d89a622472918733bf78ba5e304", "max_stars_repo_licenses": ["Apache... |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
with open("../data/raw/tasks_train_addprim_jump.txt", "r", encoding="utf8") as f:
IN_seq = []
OUT_seq = []
for i, line in enumerate(f):
line = line.split(' OUT: ')
IN_seq.append(line[0][4:].s... | {"hexsha": "3f85fb7b5a794ec1a1921c41dcafcc3e55fc375a", "size": 856, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data_process.py", "max_stars_repo_name": "QianyunZhang/SCAN", "max_stars_repo_head_hexsha": "6d42007daecb5e6b27db230ccb2fee39fa4ad4cc", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_c... |
import numpy as np
import matplotlib.pyplot as plt
plt.subplots_adjust(hspace=0.4)
t = np.arange(0.01, 20.0, 0.01)
# log y axis
plt.subplot(221)
plt.semilogy(t, np.exp(-t/5.0))
plt.title('semilogy')
plt.grid(True)
# log x axis
plt.subplot(222)
plt.semilogx(t, np.sin(2*np.pi*t))
plt.title('semilogx')
plt.grid(True)
... | {"hexsha": "bf7372191fc1c7c230556e12b4682d3ad508f791", "size": 758, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/pylab_examples/log_demo.py", "max_stars_repo_name": "argriffing/matplotlib", "max_stars_repo_head_hexsha": "5555f5463fb5f995a59f7651c0034a5d6a4c7e84", "max_stars_repo_licenses": ["MIT", "B... |
#*****************************************************************************
#
# Project: Automatic Mosaicing of Rectified, Collared Historic Aerial Imagery
# Purpose: Automatically tile and merge a directory of overlapping
# georectified aearial images, choosing from overlapping tiles based
# ... | {"hexsha": "bc86c8e5ec16958c5219d467c7f9b99b9addea5c", "size": 20723, "ext": "py", "lang": "Python", "max_stars_repo_path": "rectified_mosaic.py", "max_stars_repo_name": "cachecounty/general_scripts", "max_stars_repo_head_hexsha": "c1d3bb24c1fa4a36128728870147f4f07d10fceb", "max_stars_repo_licenses": ["MIT"], "max_star... |
# ******************
# MODULE DOCSTRING
# ******************
"""
LOMAP: Graph generation
=====
Alchemical free energy calculations hold increasing promise as an aid to drug
discovery efforts. However, applications of these techniques in discovery
projects have been relatively few, partly because of the difficulty of... | {"hexsha": "0a96cdffdfdbecd376dd8fdb1b0191ae182b8eaa", "size": 45403, "ext": "py", "lang": "Python", "max_stars_repo_path": "lomap/graphgen.py", "max_stars_repo_name": "MobleyLab/Lomap", "max_stars_repo_head_hexsha": "20bf91dced66b15c48f62e0ee1274b58ea1a8be2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 31, ... |
! { dg-do compile }
!
! Fixes of "accepts invalid".
! Note that the undeclared parameter 'y' in 't1' was originally in the
! type 't'. It turned out to be convenient to defer the error until the
! type is used in the declaration of 'z'.
!
! Contributed by Janus Weil <janus@gcc.gnu.org>
!
implicit none
type :: t(i,a,x)... | {"hexsha": "aeec407fb4bea637992d7342011a91faaecd004f", "size": 880, "ext": "f03", "lang": "FORTRAN", "max_stars_repo_path": "validation_tests/llvm/f18/gfortran.dg/pdt_8.f03", "max_stars_repo_name": "brugger1/testsuite", "max_stars_repo_head_hexsha": "9b504db668cdeaf7c561f15b76c95d05bfdd1517", "max_stars_repo_licenses":... |
from sklearn.metrics import davies_bouldin_score
from glob import glob
import pandas as pd
import numpy as np
def _ravel_and_annotate(df1, df2, df1_class, cat, div, e1, e2, f1_e1, f1_e2):
df = pd.DataFrame({
"x": df1.values.ravel(),
"y": df2.values.ravel(),
"class": df1_class.values.ravel... | {"hexsha": "c8380d63822a25d1c96b06324aadf6b257c0d3ee", "size": 4242, "ext": "py", "lang": "Python", "max_stars_repo_path": "nodes/vis/sds_5_Diversity/scripts/pairwise_diversity.py", "max_stars_repo_name": "spaenigs/peptidereactor", "max_stars_repo_head_hexsha": "17efcb993505934f5b9c2d63f5cc040bb244dde9", "max_stars_rep... |
function val=intCotPow(u,n)
%%INTCOTPOWER Evaluate the integral of cot(u)^n du. A definite integral
% can be evaluated, or an indefinite integral (with a
% particular additive constant).
%
%INPUTS: u A 2XN (for definite integral) or a 1XN (for indefinite
% integrals) set of N points. F... | {"author": "USNavalResearchLaboratory", "repo": "TrackerComponentLibrary", "sha": "9f6e329de5be06a371757c4b853200beb6def2d0", "save_path": "github-repos/MATLAB/USNavalResearchLaboratory-TrackerComponentLibrary", "path": "github-repos/MATLAB/USNavalResearchLaboratory-TrackerComponentLibrary/TrackerComponentLibrary-9f6e3... |
@testset "$TEST $G" begin
vm = ConstVertexMap(0)
@test typeof(vm) <: AVertexMap
@test get(vm, 1, 1) == 0
@test get(vm, -1, 1) == 0
vm[1] = 1
@test vm[1] == 0
@test haskey(vm, 1)
@test haskey(vm, -1)
@test length(vm) == typemax(Int)
g = G()
vm = VertexMap(g, rand(1:10,10))
@test typeof(vm) <: AVertexMap
@test haskey(v... | {"hexsha": "578f651687d2c39c844e0182b02d20f7bebe56c6", "size": 1150, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/maps/vertexmap.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/Erdos.jl-90d7349d-81aa-5495-813a-883243abfe31", "max_stars_repo_head_hexsha": "2eb248772a05eac35823a07373dd5644913c6d... |
import warnings
import numpy as np
import scipy
import matplotlib.pyplot as plt
from scipy.ndimage.filters import gaussian_filter1d
from scipy.interpolate import UnivariateSpline
from astropy import log
from astropy.table import Table
from ..crossspectrum import AveragedCrossspectrum, normalize_crossspectrum
from ..po... | {"hexsha": "162dcab3605ff57bb719e60a8d38e0295ed5f2bd", "size": 13024, "ext": "py", "lang": "Python", "max_stars_repo_path": "stingray/deadtime/fad.py", "max_stars_repo_name": "jdswinbank/stingray", "max_stars_repo_head_hexsha": "1a96e9fb78d1129feb7f28a4c49bd4bac25bdba6", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import numpy as np
from sklearn.preprocessing import LabelBinarizer
class GaussianNB(object):
"""
朴素贝叶斯分类器,适用于连续型数据。
"""
@staticmethod
def gaussfunc(x, mu, singma):
"""高斯函数
:param x: 数据集
:param mu: 均值
:param singma: 方差
:return:
"""
sqsing... | {"hexsha": "ebec2d5979871f692178f522264b4f6542c093ee", "size": 2781, "ext": "py", "lang": "Python", "max_stars_repo_path": "plume/naive_bayes.py", "max_stars_repo_name": "KEVINYZY/plume", "max_stars_repo_head_hexsha": "ae7b688d0d7b5f3dd5eeb975a302e8a5524d4255", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 22,... |
[STATEMENT]
lemma store_instr_privilege:
assumes a1: "s' = snd (fst (store_instr instr
(s::(('a::len) sparc_state))))
\<and> (((get_S (cpu_reg_val PSR s)))::word1) = 0"
shows "(((get_S (cpu_reg_val PSR
(s'::(('a::len) sparc_state)))))::word1) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. get_S (cpu_re... | {"llama_tokens": 3299, "file": "SPARCv8_SparcModel_MMU_Sparc_Properties", "length": 6} |
C @(#)newptibs.f 20.2 3/29/99
C****************************************************************
C
C File: newptibs.f
C
C Purpose: Routine to create a mew, unique bus name
C
c Return code: n = 0 : Success
c n = 1 : Error - cannot create a unique name
c ... | {"hexsha": "3fb0af42f59f7c2e541837c4aa25da36c225e928", "size": 1812, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ipf/newptibs.f", "max_stars_repo_name": "mbheinen/bpa-ipf-tsp", "max_stars_repo_head_hexsha": "bf07dd456bb7d40046c37f06bcd36b7207fa6d90", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14,... |
! =============================================================================
! Test netCDF time series
!
! This unit test checks to write multiple time steps.
! =============================================================================
program test_netcdf_time_series_2
use ... | {"hexsha": "93c6fb232eb8ea4ed3f4b6c42e908d533bb2f1cb", "size": 1740, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "unit-tests/netcdf/test_netcdf_time_series_2.f90", "max_stars_repo_name": "matt-frey/epic", "max_stars_repo_head_hexsha": "954ebc44f2c041eee98bd14e22a85540a0c6c4bb", "max_stars_repo_licenses": ["... |
# -*- coding: utf-8 -*-
"""
Created on 10/25/2021
@author: maxcurie
"""
import pandas as pd
import numpy as np
import csv
import time
import random
import concurrent.futures as future #for CPU parallelization
import sys
sys.path.insert(1, './../Tools')
from DispersionRelationDeterminantFullConductivityZeff import Di... | {"hexsha": "4988be8eafcc9f1eea84b1b23d9ebec5d2a20217", "size": 2413, "ext": "py", "lang": "Python", "max_stars_repo_path": "SLiM_NN/0MTMDispersion_list_Calc_parallel.py", "max_stars_repo_name": "maxcurie1996/SLiM", "max_stars_repo_head_hexsha": "bdb480f7e73ce9d9b3ff58e4b0245c514e2c64ed", "max_stars_repo_licenses": ["MI... |
import os
import numpy as np
import matplotlib as mpl
mpl.rcParams['axes.formatter.useoffset'] = False
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.collections as collections
import matplotlib.lines as mpll
import matplotlib.colors as mplc
from mpl_toolkits.axes_grid1.inset... | {"hexsha": "a6fde66bfcadb7ddda978b60dd5828be90d7de88", "size": 32861, "ext": "py", "lang": "Python", "max_stars_repo_path": "theresa/lib/plots.py", "max_stars_repo_name": "rychallener/theresa", "max_stars_repo_head_hexsha": "886c6b74bee2edef7df9b6b54ce6d97de4aa4421", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
from BurstCube.NoahSim import burstutils
import numpy as np
def test_length():
x = [0,1,0]
testmag = burstutils.length(x)
assert (np.abs(testmag - 1) < 1e-7)
def test_angle():
#used to find one separation
x = [1,0,0]
y = [0,1,0]
testang = burstutils.angle(x,y)
assert (np.abs(testang - np.pi/2) < 1e-7)
... | {"hexsha": "347dd6f16bd47bf14b71adfd89cc3c22761c7708", "size": 1270, "ext": "py", "lang": "Python", "max_stars_repo_path": "BurstCube/tests/test_utils.py", "max_stars_repo_name": "nkasmanoff/Simulation", "max_stars_repo_head_hexsha": "38d47db79cebe8504a03424c564f2207ae2275ac", "max_stars_repo_licenses": ["MIT"], "max_s... |
/*
* This file is part of the Geneva library collection.
*
* See the NOTICE file in the top-level directory of the Geneva library
* collection for a list of contributors and copyright information.
*
* The following license applies to the code IN THIS FILE:
*
* ***************************************************... | {"hexsha": "92ae767ec4be6b8aaf93fd8d05d7d4e09a55c089", "size": 22622, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/common/GLogger.hpp", "max_stars_repo_name": "madmongo1/geneva", "max_stars_repo_head_hexsha": "15f1046ce578cb83f3ed5c2b3ae9f52f7cf4934f", "max_stars_repo_licenses": ["Apache-2.0", "BSD-3-Cl... |
import unittest
from vnpy.analyze.util.cal_returns import CalReturns
import pandas as pd
from sympy import *
class TestDict(unittest.TestCase):
def test_cal_annual_returns(self):
trades = {pd.Timestamp('2015-01-01'): 50000, pd.Timestamp('2016-01-01'): 50000, pd.Timestamp('2017-01-01'): 50000}
end... | {"hexsha": "0c0e4ad2305d1d537759261079c6eede1f0b5ca9", "size": 1321, "ext": "py", "lang": "Python", "max_stars_repo_path": "vnpy/analyze/test/cal_test.py", "max_stars_repo_name": "CatTiger/vnpy", "max_stars_repo_head_hexsha": "7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
module Othermethods
using Random,Distributions
using LinearAlgebra
using FastGaussQuadrature
#using DoubleExponentialFormulas
#using DifferentialEquations
#using QuadGK
import ..CGmethods:bicg,cg,shiftedcg,reducedshiftedcg
import ..Diracoperators:DdagD_operator,DdagD_Stagge... | {"hexsha": "648489c121a655e49ae9e20965ee908733ff6aaa", "size": 20498, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/fermions/misc.jl", "max_stars_repo_name": "RJaBi/LatticeQCD.jl", "max_stars_repo_head_hexsha": "a900545295a981a50a33c8aea8f5994b5bf1650a", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#define BOOST_TEST_MODULE MyTest
#include <boost/test/unit_test.hpp>
#include "../src/shared/helpers.hpp"
#include <ostream>
std::ostream& operator<<(std::ostream& os, const vec_t& vec) {
os << "[";
int sz = vec.size();
for (const auto& v : vec) {
os << v;
sz--;
if (sz) {
... | {"hexsha": "9f38521c28ec315b0f00d7bbad3d9781e5672253", "size": 1866, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/test_main.cpp", "max_stars_repo_name": "justefg/ultra_ha", "max_stars_repo_head_hexsha": "681d4a5db7c03742fad8e0357d4d3c818afb7737", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
{-# OPTIONS --without-K --safe #-}
module PlainPi where
open import Data.Empty
open import Data.Unit
open import Data.Sum
open import Data.Product
open import Relation.Binary.PropositionalEquality
infixr 70 _×ᵤ_
infixr 60 _+ᵤ_
infixr 50 _⊚_
---------------------------------------------------------------------------... | {"hexsha": "6589a2e144c3fd7bb0922286f07048f5d57d9e99", "size": 3159, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "fracGC/PlainPi.agda", "max_stars_repo_name": "JacquesCarette/pi-dual", "max_stars_repo_head_hexsha": "003835484facfde0b770bc2b3d781b42b76184c1", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_s... |
#! /usr/bin/env python
import math
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append('../')
import macrodensity as md
# import argparse
# parser = argparse.ArgumentParser()
# # Input argument
# parser.add_argument('--input_file', default=f'{homedir}/task1/models/two_stream/test/test1.mp4', ... | {"hexsha": "15dbf08db1b6584619e8fc545269ae1070aea1fd", "size": 2012, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/PlanarAverage.py", "max_stars_repo_name": "Zarand3r/MacroDensity", "max_stars_repo_head_hexsha": "dc1afd60e2c3e8f6f81ef0cad85619bc1469c7ea", "max_stars_repo_licenses": ["MIT"], "max_stars... |
[STATEMENT]
lemma fmap_resT_simps [simp]:
"fmap\<cdot>f\<cdot>(\<bottom>::'a\<cdot>'f::functor resT) = \<bottom>"
"fmap\<cdot>f\<cdot>(Done\<cdot>x :: 'a\<cdot>'f::functor resT) = Done\<cdot>(f\<cdot>x)"
"fmap\<cdot>f\<cdot>(More\<cdot>m :: 'a\<cdot>'f::functor resT) = More\<cdot>(fmap\<cdot>(fmap\<cdot>f)\<cdot>... | {"llama_tokens": 682, "file": "Tycon_Resumption_Transformer", "length": 2} |
# _*_coding:utf-8_*_
# @auther:FelixFu
# @Date: 2021.4.14
# @github:https://github.com/felixfu520
import os
import time
import numpy as np
from tqdm import tqdm
import torch
from torchvision import transforms
from utils import transforms as local_transforms
from base import BaseTrainer, DataPrefetcher
from utils.met... | {"hexsha": "ec89576629d21c42f3167d580722ce02904e0e3a", "size": 10658, "ext": "py", "lang": "Python", "max_stars_repo_path": "trainer.py", "max_stars_repo_name": "FelixFu520/classification", "max_stars_repo_head_hexsha": "2e8119c229bc978ecaecac0361bf8b573c553d43", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import cv2
import numpy as np
class SiftMatchScorer:
# score_names = 'sift_matches', 'sift_inliers'
score_names = 'SMatches', 'SPrecision'
def __init__(self, example):
self.example = example
self.sift_matches = example['pred_sift']
resized_tg_arr, resized_tg_mask = np.array(examp... | {"hexsha": "8f2a80ae27733a763741b54626e9d814aacdcbb6", "size": 3412, "ext": "py", "lang": "Python", "max_stars_repo_path": "baselines/sift/siftscorer.py", "max_stars_repo_name": "siddancha/FlowVerify", "max_stars_repo_head_hexsha": "a1b80e7c47a23479b91e87fd12b09b59a346c464", "max_stars_repo_licenses": ["MIT"], "max_sta... |
from __future__ import division
import os
import time
from glob import glob
import tensorflow as tf
import numpy as np
from six.moves import xrange
from utils import *
from loss_functions import *
from scipy.misc import imsave
class MR2CT(object):
def __init__(self, sess, batch_size=10, depth_MR=32, height_MR=32,... | {"hexsha": "f726815c9d9c875e611e685946fa5bb15c9a3094", "size": 13843, "ext": "py", "lang": "Python", "max_stars_repo_path": "3dversion/g_model.py", "max_stars_repo_name": "ginobilinie/medSynthesis", "max_stars_repo_head_hexsha": "fee24e955313b4032855901327a7485390866e91", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma wf_design_implies:
assumes "(\<And> b . b \<in># \<B> \<Longrightarrow> b \<subseteq> V)"
assumes "\<And> b . b \<in># \<B> \<Longrightarrow> b \<noteq> {}"
assumes "finite V"
assumes "\<B> \<noteq> {#}"
assumes "V \<noteq> {}"
shows "design V \<B>"
[PROOF STATE]
proof (prove)
goal (1 sub... | {"llama_tokens": 262, "file": "Design_Theory_Design_Basics", "length": 2} |
'''This module provides functions to visualise the terrain'''
from terrain import Hex, HexGrid
from matplotlib.patches import RegularPolygon
import matplotlib.pyplot as plt
import numpy as np
def display_graph(colour_map):
'''display_graph displays a colour map'''
# Define plot figure and axes
fig, ax =... | {"hexsha": "6b566f185c2fe01b7c83242a544e48a25016ca34", "size": 1053, "ext": "py", "lang": "Python", "max_stars_repo_path": "nuclear_confusion/visualisation.py", "max_stars_repo_name": "will-albuquerque/nuclear-confusion", "max_stars_repo_head_hexsha": "9e717aac6a29acd8c66632ea9ddb16bf510c8ca1", "max_stars_repo_licenses... |
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import, division, prin... | {"hexsha": "e671d162088a81205cf4fcc171851e7e16dbccf2", "size": 5992, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/frcnn/frcnn/layer_utils/anchor_target_layer.py", "max_stars_repo_name": "TTTREE/Trackor_base", "max_stars_repo_head_hexsha": "12ed78c736695bf039cd8b94f7010c815938b86c", "max_stars_repo_license... |
%!TEX root = ../thesis.tex
%*******************************************************************************
%****************************** Second Chapter *********************************
%*******************************************************************************
\chapter{\ont{} sequencing for \mtb{} transmissio... | {"hexsha": "484e177400a9bdcc04d68620498e53a092545cb9", "size": 101633, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Chapter2/chapter2.tex", "max_stars_repo_name": "mbhall88/thesis", "max_stars_repo_head_hexsha": "29d60859a88bd72a7e2233c06e83121b3f8383a6", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_cou... |
SUBROUTINE A16(X, Y)
!$OMP PARALLEL
!$OMP CRITICAL(XAXIS)
CALL DEQUEUE()
!$OMP END CRITICAL(XAXIS)
CALL WORK()
!$OMP CRITICAL
CALL DEQUEUE()
!$OMP END CRITICAL
CALL WORK()
!$OMP END PARALLEL
END SUBROUTINE A16
| {"hexsha": "de81e71df1e38d66e3d166c31593dba8a75ec73b", "size": 252, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/CompileTests/OpenMP_tests/fortran/critical.f90", "max_stars_repo_name": "maurizioabba/rose", "max_stars_repo_head_hexsha": "7597292cf14da292bdb9a4ef573001b6c5b9b6c0", "max_stars_repo_licens... |
subroutine read_seviri(mype,val_sev,ithin,rmesh,jsatid,&
gstime,infile,lunout,obstype,nread,ndata,nodata,twind,sis, &
mype_root,mype_sub,npe_sub,mpi_comm_sub,nobs, &
nrec_start,dval_use)
!$$$ subprogram documentation block
! . . . .
! subprogr... | {"hexsha": "030002c43339ff7770531242e5d9ffc2ca12de7d", "size": 20818, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "GEOSaana_GridComp/GSI_GridComp/read_seviri.f90", "max_stars_repo_name": "GEOS-ESM/GEOSana_GridComp", "max_stars_repo_head_hexsha": "cf33607613754313a2383bb7e7b3d29c856b9daf", "max_stars_repo_li... |
import numpy as np
import cv2
import struct
import random
from torchvision.transforms import ToTensor, ToPILImage
img_transform = ToTensor()
def get_pred_data(file_paths,width=1600):
for file_path in file_paths:
with open(file_path, 'rb') as f:
header_size = np.fromfile(f, dtype='uint32', coun... | {"hexsha": "e3b6a5e5964254eae34b6237f7c52a26d485c0c6", "size": 16566, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/get_dgrl_data.py", "max_stars_repo_name": "grsgth/Offline-Chinese-Handwriting-Text-Page-Spotter-with-Text-Kernel", "max_stars_repo_head_hexsha": "00334215b63b12284a74e26fa0fbf15f09a046a2", ... |
import numpy as np
class ReplayBuffer():
'''Experience Replay buffer. Implemented as a cyclic array
of fixed size for efficiency.
'''
def __init__(self, config):
self.max_size = config['size']
self.array = []
self.position = 0
self.rng = np.random.default_rng(config[... | {"hexsha": "a70c632d436b735c12e9bb7fae4bdfe1008e62df", "size": 721, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "EhsanEI/pytorch-rl", "max_stars_repo_head_hexsha": "d473e465607087b75bc958fb0407fb6c8f41097e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s... |
"""
Copyright 2018 Johns Hopkins University (Author: Jesus Villalba)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
import logging
import numpy as np
from sklearn.svm import LinearSVC as SVC
from ..hyp_defs import float_cpu
from ..hyp_model import HypModel
from ..utils.math import softmax
class Li... | {"hexsha": "244e0dc01864a058179b70274cb3fd7c2909597f", "size": 12475, "ext": "py", "lang": "Python", "max_stars_repo_path": "hyperion/classifiers/linear_svmc.py", "max_stars_repo_name": "hyperion-ml/hyperion", "max_stars_repo_head_hexsha": "c4c9eee0acab1ba572843373245da12d00dfffaa", "max_stars_repo_licenses": ["Apache-... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 00:59:12 2020
@author: Jon
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib
matplotlib.rcParams['figure.figsize'] = (10.0, 8.0)
true_kon = 0.070353336309323 # This is to Matlab
true_koff = 0.464397161485740
t... | {"hexsha": "52187ce04c8fd469ae564917b5fbbd69a3a9670a", "size": 4630, "ext": "py", "lang": "Python", "max_stars_repo_path": "example_datasets/reproduce_paper_figures/hindsight_parameter_convergence.py", "max_stars_repo_name": "ManchesterBioinference/burstInfer", "max_stars_repo_head_hexsha": "933bc76ae8e7fadc36bab1b6bf0... |
#include <vector>
#include "Drone.h"
#include <math.h>
#include <boost/asio/io_service.hpp>
#include <Fullnavdata.h>
#include <gnuplot_iostream.h>
#include <deque>
/*
* PRIVATE HEADER
*/
#define DRONE_IP "10.42.0.10"
#define CALIBRATION_FILE "res/calib_bd2.xml"
#define HULLPROTECTIONO... | {"hexsha": "4d4e80515878864461d80c13600a8914d2bdd5e7", "size": 2562, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Bebop2cpp-master/demo/timestamp.cpp", "max_stars_repo_name": "jmenden1/SNAP", "max_stars_repo_head_hexsha": "a253aa052e4568cdc35e7ff5789b3e716ccbb4da", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import json, urllib.request
import requests
from collections import Counter
import pandas as pd
import numpy as np
import matplotlib
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
import re
import matplotlib.pyplot as plt
%matplotlib inline
Username = input("What's your Username?")
P... | {"hexsha": "13c3d5ae79eff8b75243a4b17e0439f7f9333d74", "size": 6802, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "Rothamsted/wordcloud", "max_stars_repo_head_hexsha": "06f26f13126f5599b57485da292a2177b42e2b72", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_st... |
#!/usr/bin/python
"""Given a GT and a Prediction file, evaluate predictions
"""
import json
import time
import pickle
import sys
import csv
import argparse
import os
import os.path as osp
import shutil
import copy
from collections import defaultdict as dd
import datetime
import numpy as np
import matplotlib.pyplot as... | {"hexsha": "c6dd07a811d6e90bb589c2d0e616bf450894f1f6", "size": 21661, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/evaltools/evaluate.py", "max_stars_repo_name": "tribhuvanesh/visual_redactions", "max_stars_repo_head_hexsha": "93fac7b5cd9fc7e81341380408df6a8a4f8f6189", "max_stars_repo_licenses": ["Apach... |
import time
import numpy
import struct
import threading
from . import tunePDNR_covMat_v3
from .touchcomm_manager import TouchcommManager
debug = False
def log(message):
if debug:
print(message)
else:
pass
def convert_chunk(i):
return struct.unpack('<f', bytearray(i))[0]
def convert_to_fl... | {"hexsha": "d6fafe56f059cf9fe177c57b57664860c14ca25c", "size": 14432, "ext": "py", "lang": "Python", "max_stars_repo_path": "webds_api/gear_selection_manager.py", "max_stars_repo_name": "qmao/webds_api", "max_stars_repo_head_hexsha": "ca5bf9ad3c1304be223b7e47c57ee10fb40d92e1", "max_stars_repo_licenses": ["BSD-3-Clause"... |
[STATEMENT]
lemma path_append_target:
"target q (p1@p2) = target (target q p1) p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. target q (p1 @ p2) = target (target q p1) p2
[PROOF STEP]
by (induction p1) (simp+) | {"llama_tokens": 97, "file": "FSM_Tests_FSM", "length": 1} |
#!/usr/bin/env python3
import os
import sys
from scipy.spatial.transform import Rotation as R
import numpy as np
import torch as tr
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Line3DCollection
# import kornia.geometry
from raycast import ray_trian... | {"hexsha": "b18097ac7d73674bf13f62bb9e6b10a6fa1f2a54", "size": 15905, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "yycho0108/PyTorchRayTracer", "max_stars_repo_head_hexsha": "51ca7f952b8774b13526e1b2ac8df2536c83e822", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
# *****************************************************************************
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions... | {"hexsha": "2f59fee0e4166b5be21f9244a7f13851218ea072", "size": 3638, "ext": "py", "lang": "Python", "max_stars_repo_path": "common/utils.py", "max_stars_repo_name": "leijue222/tacotron2", "max_stars_repo_head_hexsha": "5950728a91e7a9355f42f658e00db2a2aef94247", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_co... |
import numpy as np
from dateutil.parser import parse
from statistics import median
class GraphDatas:
def __init__(self):
self.names = list()
self.values = list()
self.files = list()
self.legends = list()
# Filtre
self.xf = None
self.yf = None
self.n... | {"hexsha": "d3ae9d343bfbd634f35203e19e1f8367ef588b8d", "size": 21060, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/GraphDatas.py", "max_stars_repo_name": "AntoineMeresse/Terminal-chart", "max_stars_repo_head_hexsha": "eff66c32d78c394849176c7777bf7c203dbac5b3", "max_stars_repo_licenses": ["MIT"], "max_star... |
import numpy as np
a = np.ones([2, 3, 2], np.float32)
a = [[[0.1, 0.2],
[-0.3, 0.4],
[0.5, 0.6]],
[[0.7, 0.8],
[0.9, 1.0],
[1.1, 1.2]]]
b = np.ones([2], np.float32)
b = [0.2, 0.3]
print np.multiply(a, b)
| {"hexsha": "d4cf693112d5fa2680cd7e92cedc1cc43c1d8fdc", "size": 236, "ext": "py", "lang": "Python", "max_stars_repo_path": "blaze/blaze/test/utest_data/operator/op/elementwise/elementwise_mul.py", "max_stars_repo_name": "Ru-Xiang/x-deeplearning", "max_stars_repo_head_hexsha": "04cc0497150920c64b06bb8c314ef89977a3427a", ... |
# pylint: disable-msg=E1101,W0612
from __future__ import division
from datetime import datetime, timedelta, time
import nose
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
from pandas import (Index, Series, DataFrame, Timestamp, Timedelta, TimedeltaIndex, isnull, notnull,
... | {"hexsha": "bc51e01ca9bdffdd24fc615243df12aab021cd6f", "size": 56923, "ext": "py", "lang": "Python", "max_stars_repo_path": "pandas/tseries/tests/test_timedeltas.py", "max_stars_repo_name": "jnmclarty/pandas", "max_stars_repo_head_hexsha": "b7c32718ae987a46b69e11496c8d042af86be514", "max_stars_repo_licenses": ["PSF-2.0... |
import cv2
import numpy as np
from matplotlib import pyplot as plt
import os
def get_path_list(root_path):
# Obtains list of path directories from root path
# Returns: list(s) containing the names of the sub-directories in the root directory
train_root_path_content = []
for i in os.listdir(root_path... | {"hexsha": "d103b13830f6bac39ee8b3f4a26f8b73f268eb6b", "size": 7649, "ext": "py", "lang": "Python", "max_stars_repo_path": "Main.py", "max_stars_repo_name": "AimAndIgnite/face-recognition", "max_stars_repo_head_hexsha": "29a2e98955f73b28c19ef9b76aeeb911c7bbd345", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
###################################################################################################
# Repository: https://github.com/lgervasoni/urbansprawl
# MIT License
###################################################################################################
import numpy as np
import pandas as pd
import net... | {"hexsha": "ed5af093981696667d13fc8d69429526e50081f9", "size": 6495, "ext": "py", "lang": "Python", "max_stars_repo_path": "urbansprawl/sprawl/utils.py", "max_stars_repo_name": "welegent2010/urban-sprawl", "max_stars_repo_head_hexsha": "b26bdf7889fdba1382259be7c14e7e0d8f535cd9", "max_stars_repo_licenses": ["MIT"], "max... |
from src.agent.agent import Agent
from src.config.config import Config
from config.key import CONFIG_KEY
import numpy as np
from src.util.sampler import Sampler
import easy_tf_log
from src.core import Basic
from src.util.noiseAdder import noise_adder
class TargetAgent(Agent):
key_list = Config.load_json(file_path... | {"hexsha": "c150b88a37c341fec57ffdb46e36dca4a2120b15", "size": 10836, "ext": "py", "lang": "Python", "max_stars_repo_path": "demo/dong/targetAgent.py", "max_stars_repo_name": "Lukeeeeee/DataCenterJobSchedulingSolution", "max_stars_repo_head_hexsha": "9c62c0039b2dd9e0a1ca5474dc46c8be98a972b3", "max_stars_repo_licenses":... |
#include <iostream>
#include <typeinfo>
#include <map>
using std::cout;
using std::endl;
#include "viennagrid/forwards.hpp"
#include "viennagrid/storage/view.hpp"
#include "viennagrid/storage/container_collection.hpp"
#include "viennagrid/storage/inserter.hpp"
#include "viennagrid/storage/id_generator.hpp"
#includ... | {"hexsha": "4f8397322e170427d439dac4de8dcc7f34e3087f", "size": 10045, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "examples/tutorial/old/mesh_test_2.cpp", "max_stars_repo_name": "viennagrid/viennagrid-dev", "max_stars_repo_head_hexsha": "6e47c8d098a0b691d6b9988f2444cd11d440f4c2", "max_stars_repo_licenses": ["MI... |
# file for homotopy functions
# TODO: add mechanism for selecting which homotopy function to use
# TODO: better idea: move the homotopy function to NLSolver, because it is
# physics agnostic
import PDESolver.evalHomotopy
"""
This function calls the appropriate homotopy function for the Euler modu... | {"hexsha": "2dcbae277de512f3bc72604a7b8c47e90e46401c", "size": 7328, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/solver/euler/homotopy.jl", "max_stars_repo_name": "OptimalDesignLab/PDESolver.jl", "max_stars_repo_head_hexsha": "328ef45f764ab99a9d5cc3c5e4c0a4c56b263279", "max_stars_repo_licenses": ["MIT"], ... |
function chooseBestModels_HN(pathExperimentsBinary,pathExperimentsTime,fSetNames,nameOutcomes,metric,maxOrder)
% -------------------------------------------------------------------------
% function chooseBestModels_HN(pathWORK,nExp,fSetName,nameOutcomes,maxOrder)
% ------------------------------------------------------... | {"author": "mvallieres", "repo": "radiomics", "sha": "d3a61737730e1b2b46d04c9e22a3fcc390912f1a", "save_path": "github-repos/MATLAB/mvallieres-radiomics", "path": "github-repos/MATLAB/mvallieres-radiomics/radiomics-d3a61737730e1b2b46d04c9e22a3fcc390912f1a/STUDIES/HN_study/Functions/MULTIVARIABLE_MODELING/chooseBestModel... |
(* Author: Tobias Nipkow, Alex Krauss, Christian Urban *)
section "Regular sets"
theory Regular_Set
imports Main
begin
type_synonym 'a lang = "'a list set"
definition conc :: "'a lang \<Rightarrow> 'a lang \<Rightarrow> 'a lang" (infixr "@@" 75) where
"A @@ B = {xs@ys | xs ys. xs:A & ys:B}"
text \<open>checks th... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/SeLFiE/Evaluation/Regular-Sets/Regular_Set.thy"} |
# A script that takes a model as input, predicts the
# validation set of Semeval2017A and save the results
# in y_preds.txt
import os
import warnings
import argparse
import errno
from sklearn.exceptions import UndefinedMetricWarning
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import f1_score, a... | {"hexsha": "61546c736edf212bfb167d64c488d2c238306e44", "size": 3047, "ext": "py", "lang": "Python", "max_stars_repo_path": "Lab3/Lab/predict-validation.py", "max_stars_repo_name": "PanosAntoniadis/slp-ntua", "max_stars_repo_head_hexsha": "f144cd82fddbdfab27dd1ed025fb0d4c9a83a15f", "max_stars_repo_licenses": ["MIT"], "m... |
#include <bluetoe/options.hpp>
#include <string>
#define BOOST_TEST_MODULE
#include <boost/test/included/unit_test.hpp>
#include <type_traits>
template < typename >
struct template_a {};
template < typename >
struct template_b {};
BOOST_AUTO_TEST_CASE( select_type )
{
BOOST_CHECK( ( std::is_same< typename blue... | {"hexsha": "4476dceb95af3c34b72edeae2e1a1baa70f073ae", "size": 31167, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/options_tests.cpp", "max_stars_repo_name": "obruns/bluetoe", "max_stars_repo_head_hexsha": "de13682bce39335878262212f3615254e0af1702", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010 *)
(* \VV/ **************************************************************)
(* // * Th... | {"author": "coq-contribs", "repo": "legacy-ring", "sha": "6aa7bb505bd40523bb9a5cf6151f13abd21eae65", "save_path": "github-repos/coq/coq-contribs-legacy-ring", "path": "github-repos/coq/coq-contribs-legacy-ring/legacy-ring-6aa7bb505bd40523bb9a5cf6151f13abd21eae65/LegacyArithRing.v"} |
import os
import networkx as nx
import numpy as np
from six import iteritems
from opensfm import types
import opensfm.dataset
def normalized(x):
return x / np.linalg.norm(x)
def camera_pose(position, lookat, up):
'''
Pose from position and look at direction
>>> position = [1.0, 2.0, 3.0]
>>> ... | {"hexsha": "40a5fe77fef07a7efa70eaf873671a285f0d182a", "size": 2995, "ext": "py", "lang": "Python", "max_stars_repo_path": "opensfm/test/data_generation.py", "max_stars_repo_name": "Oktosha/OpenSfM", "max_stars_repo_head_hexsha": "17d34c16cdb62b383af1c671ee3237098d183ec2", "max_stars_repo_licenses": ["BSD-2-Clause"], "... |
from abc import ABCMeta, abstractmethod
from IPython import embed
import numpy as np
import torch
from torch.autograd import Variable
from torch.nn import CrossEntropyLoss
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from typing import Optional
class Attacker(metaclass=ABCMeta):
... | {"hexsha": "cee82be06fdb15b38a5cb93654120c3960af1ad2", "size": 5453, "ext": "py", "lang": "Python", "max_stars_repo_path": "PythonClient/robustness_challenge/robustness/tools/attacks.py", "max_stars_repo_name": "Hadisalman/AirSim", "max_stars_repo_head_hexsha": "ed0a1aba69ef4aa8941aac9bdecc9c4e7a21bbf6", "max_stars_rep... |
import numpy as np
def SY_StdNthDer(y, n=2):
'''
SY_StdNthDer Standard deviation of the nth derivative of the time series.
Based on an idea by Vladimir Vassilevsky, a DSP and Mixed Signal Design
Consultant in a Matlab forum, who stated that You can measure the standard
deviation of the nth deriv... | {"hexsha": "6ff6572cbfd910a1808c1d4d2e7a061fedea54c9", "size": 1164, "ext": "py", "lang": "Python", "max_stars_repo_path": "Operations/SY_StdNthDer.py", "max_stars_repo_name": "ClarkLabUVA/hctsa-py", "max_stars_repo_head_hexsha": "4382a7e852d21cdfefdac1a4a09ea6e11abd9be1", "max_stars_repo_licenses": ["MIT"], "max_stars... |
"""Implementation of MPI based remote operators."""
from bempp.api.assembly.blocked_operator import BlockedOperator as _BlockedOperator
from bempp.api.assembly.discrete_boundary_operator import _DiscreteOperatorBase
from mpi4py import MPI
import numpy as _np
MPI_SIZE = MPI.COMM_WORLD.Get_size()
MPI_RANK = MPI.COMM_W... | {"hexsha": "9d63b1daf79eec46e9770671e81fd72a0aea8688", "size": 13117, "ext": "py", "lang": "Python", "max_stars_repo_path": "bempp/api/utils/remote_operator.py", "max_stars_repo_name": "pescap/bempp-cl", "max_stars_repo_head_hexsha": "3a68666e8db0e873d418b734289067483f68f12e", "max_stars_repo_licenses": ["MIT"], "max_s... |
import numpy as np
with open("./input.txt", "r") as f:
connections = [line.strip().split("-") for line in f.readlines()]
class Node():
def __init__(self, name):
self.big = name[0].isupper()
self.visited = False
self.name = name
self.connections = set()
def __hash__(self):... | {"hexsha": "8b4a00f179de56bb85b8bf7a795ad6eeb9b7d2b4", "size": 1478, "ext": "py", "lang": "Python", "max_stars_repo_path": "Day_12_1/main.py", "max_stars_repo_name": "SV-97/AdventOfCode2021", "max_stars_repo_head_hexsha": "f86040af489b965eece7d27258b4ea1078fd88fd", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# -*- coding: utf-8 -*-
""" utils/plot_tools """
import copy
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
from lcksvd.constants import PlotFilter
from lcksvd.core.exceptions.plot_tools import ColourMapInvalid, ColourListInvalid
class LearnedRepresentationPlotter:
"""
Hold me... | {"hexsha": "574739bf30ce7b399fc07cb854b2009fb641f4bc", "size": 13819, "ext": "py", "lang": "Python", "max_stars_repo_path": "lcksvd/utils/plot_tools.py", "max_stars_repo_name": "QNZhang/LC-KSVD", "max_stars_repo_head_hexsha": "08a7810bf7913422859f14fadcb51c8fbe5f5ef3", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
"""
# KNN
k nearest neighbours
Pro
- Relatively simple
Cons
- Computationally intensive
- Hard to represent relationships between features
"""
from sklearn import tree
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# set up
iri... | {"hexsha": "65958dc1f01020460be3c7962f4e67331c01ad29", "size": 1189, "ext": "py", "lang": "Python", "max_stars_repo_path": "google-machine-learning-recipes/implement-knn-classifier.py", "max_stars_repo_name": "NicholasTD07/demos", "max_stars_repo_head_hexsha": "1eb346bdbb3db764d977a202a662b8e3b4b8ef51", "max_stars_repo... |
# -*- coding: utf-8 -*-
"""Demo182_RareCategories_HighCardinality.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1oGG64IaKf-Oavjh6VAY0q8H9R2CLNq3B
## Rare Labels
- Values present for a small percentage
- Usually present less than 5%
- Conc... | {"hexsha": "bd6349c8b34430aab3f90a84b04c7d951885e79a", "size": 6211, "ext": "py", "lang": "Python", "max_stars_repo_path": "FeatureEngineeringPy_DataScience/demo182_rarecategories_highcardinality.py", "max_stars_repo_name": "mahnooranjum/Programming_DataScience", "max_stars_repo_head_hexsha": "f7a4215d4615b3f8460c3a194... |
"""
Tests for simple_sbml
"""
from SBMLKinetics.common import constants as cn
from SBMLKinetics.common import simple_sbml
from SBMLKinetics.common.simple_sbml import SimpleSBML
from SBMLKinetics.common.reaction import Reaction
from SBMLKinetics.common import util
from tests.common import helpers
import copy
import num... | {"hexsha": "2b7f36816beb1119aa43d99bef44ca8cc00f2f35", "size": 2579, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_simple_sbml.py", "max_stars_repo_name": "ModelEngineering/Kinetics-Validator", "max_stars_repo_head_hexsha": "9350da492fd9c1482b50332f386632e6db0e7ed2", "max_stars_repo_licenses": ["MIT... |
#
# Copyright (c) Sinergise, 2019 -- 2021.
#
# This file belongs to subproject "field-delineation" of project NIVA (www.niva4cap.eu).
# All rights reserved.
#
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
#
from typing import Iterable, Dict,... | {"hexsha": "1aed84ceab6d8609f094b45af88e6c26e337a3bf", "size": 2188, "ext": "py", "lang": "Python", "max_stars_repo_path": "fd/compute_normalization.py", "max_stars_repo_name": "SFrav/field-delineation", "max_stars_repo_head_hexsha": "205530069d716d8bb69a1fc9fd8d523178f470a1", "max_stars_repo_licenses": ["MIT"], "max_s... |
import csv
import logging
import os
from tempfile import NamedTemporaryFile
from pprint import pformat
from typing import Mapping
from dateutil import parser as DatetimeParser
import attr
import pydicom
from hashlib import md5
import numpy as np
from crud.abc import Serializable
from .report import RadiologyReport
from... | {"hexsha": "3bb8b4eeb8ad9c3694864ed56795e0c9ad94a98c", "size": 16817, "ext": "py", "lang": "Python", "max_stars_repo_path": "package/diana/dixel/dixel.py", "max_stars_repo_name": "thomasyi17/diana2", "max_stars_repo_head_hexsha": "2167053dfe15b782d96cb1e695047433f302d4dd", "max_stars_repo_licenses": ["MIT"], "max_stars... |
#/usr/bin/env python3
import numpy as np
from scipy.special import jn
import scipy.constants as sc
## Shared Helper Functions
def beta_from_gamma(gamma):
return(np.sqrt(1-np.power(gamma,-2)))
def k_beta_(gamma_0, k_p):
return(k_p/np.sqrt(2*gamma_0))
def r_beta_(a_beta, gamma_0, k_beta):
return(a_beta/... | {"hexsha": "4fa8d19ed593878d8680bf3472393719966c81b0", "size": 3497, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/pyutils/radiation.py", "max_stars_repo_name": "Telemin/pyutils", "max_stars_repo_head_hexsha": "923185eb06bc37af4640d12f7cc52df68331e20f", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
[STATEMENT]
lemma f_last_message_hold_length[simp]: "length (xs \<longmapsto>\<^sub>f k) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. length (xs \<longmapsto> k) = length xs
[PROOF STEP]
apply (case_tac "k = 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. k \<noteq> 0 \<Longrightarrow> len... | {"llama_tokens": 629, "file": "AutoFocus-Stream_AF_Stream", "length": 6} |
from fides import Optimizer, BFGS, SR1, DFP, HybridUpdate, SubSpaceDim, \
StepBackStrategy
import numpy as np
import logging
import pytest
import fides
import time
def rosen(x):
f = 100 * (x[1] - x[0] ** 2) ** 2 + (1 - x[0]) ** 2
return f
def rosengrad(x):
f = rosen(x)
g = np.array([-400 * (x... | {"hexsha": "54471c6f222c9af3d76690a0655e18be177f9d0d", "size": 7910, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_minimize.py", "max_stars_repo_name": "dweindl/fides", "max_stars_repo_head_hexsha": "3124c664d301c12499eb052047be7833577c4e74", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c... |
function CssiSpaceWeatherData(arg0::JString)
return CssiSpaceWeatherData((JString,), arg0)
end
function CssiSpaceWeatherData(arg0::JString, arg1::DataProvidersManager, arg2::TimeScale)
return CssiSpaceWeatherData((JString, DataProvidersManager, TimeScale), arg0, arg1, arg2)
end
function equals(obj::Object, ar... | {"hexsha": "db86dc8567f4c6b04ba5381d65b5f849850e6caf", "size": 2454, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "gen/OrekitWrapper/ModelsWrapper/EarthWrapper/AtmosphereWrapper/DataWrapper/cssi_space_weather_data.jl", "max_stars_repo_name": "JuliaAstrodynamics/Orekit.jl", "max_stars_repo_head_hexsha": "e2dd3d8... |
import os
import time
import pickle
import collections
import numpy as np
import scipy.ndimage as ndimage
import sgolay2
from .focus_stacker import FocusStacker
class ImageStackCollector:
DEFAULT_IMAGES_PER_STEP = 20
DEFAULT_SETTLING_TIME = 2.0
DEFAULT_FOCUS_STACKER_PARAM = {
'laplacian_kern... | {"hexsha": "cf351e547abe9a556b40e173b71d1e1230e0f99a", "size": 4275, "ext": "py", "lang": "Python", "max_stars_repo_path": "flasercutter/image_stack_collector.py", "max_stars_repo_name": "willdickson/flasercutter", "max_stars_repo_head_hexsha": "a248599fa9c726798836407c39d69aa7c916025c", "max_stars_repo_licenses": ["MI... |
\section{Rice Krispy Treats}
\label{riceKrispyTreats}
\setcounter{secnumdepth}{0}
Time: 45 minutes (5 minutes cooking, 40 minutes cooling)
Serves: 8
\begin{multicols}{2}
\subsection*{Ingredients}
\begin{itemize}
\item 2 ounces unsalted butter
\item 10 ounces marshmallows
\item 6 ounces rice krispies
\i... | {"hexsha": "abdc43a5d8c6d2728095c494024af9f79081a9d2", "size": 2133, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "chapters/desserts/riceKrispyTreats.tex", "max_stars_repo_name": "calebwatt15/caleb-watt-cookbook", "max_stars_repo_head_hexsha": "abddcdb60e9422d63d945e7a9ec019c0288e34d7", "max_stars_repo_licenses"... |
# encoding: utf-8
import cairo
import pango
import pangocairo
from font_draw import fontnames, trim
from random import randint
from PIL import Image
from utils import add_padding
import numpy as np
import codecs
import os
import re
allmatch = 0
# fontnames = ['serif']
def draw_line(line, outpath, spacing='normal', gt... | {"hexsha": "72b1dd5cd7304c5cb29129207391f17140c3e77a", "size": 7150, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_generation/line_draw.py", "max_stars_repo_name": "BuddhistDigitalResourceCenter/namsel", "max_stars_repo_head_hexsha": "f6f112b7e1710db07d47cbaed1dee33a33bfd814", "max_stars_repo_licenses": [... |
@testset "SOM training helper functions" begin
@testset "gridRectangular" begin
grid = GigaSOM.gridRectangular(5, 5)
@test size(grid) == (25, 2)
end
@testset "Kernels" begin
@test isapprox(
gaussianKernel(Vector{Float64}(1:7), 2.0),
[0.1760326, 0.1209853, 0.... | {"hexsha": "57b3d58eabb5849afc15c1c354a1ac0c70e2db87", "size": 1868, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/testTrainutils.jl", "max_stars_repo_name": "oHunewald/GigaSOM.jl", "max_stars_repo_head_hexsha": "dd00899e514bea125306a1926452222eca007a10", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{url}
\newcommand{\vwi}{{\bf w}_i}
\newcommand{\vw}{{\bf w}}
\newcommand{\vx}{{\bf x}}
\ne... | {"hexsha": "6584b30ae7c14617d2fbad6dff78cb7eaa99e0b1", "size": 13123, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "main.tex", "max_stars_repo_name": "motian12ps/Bigdata_Project", "max_stars_repo_head_hexsha": "43d10cbb230e7988197cd9d08ee3fb9eaec567d9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "... |
# ***************************************************************
# Copyright (c) 2021 Jittor. All Rights Reserved.
# Maintainers:
# Wenyang Zhou <576825820@qq.com>
# Dun Liang <randonlang@gmail.com>.
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this... | {"hexsha": "54b75265e45751473305bb2b3eb2376e6994a7c0", "size": 5099, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/jittor/test/test_distributions.py", "max_stars_repo_name": "maxint/jittor", "max_stars_repo_head_hexsha": "0b6a2e32f64acaeefcea63df1ea35fd0d729c604", "max_stars_repo_licenses": ["Apache-2.0... |
#!/usr/bin/env python
"""
Created on Mon Mar 7 11:48:11 2016
Author: Oren Freifeld
Email: freifeld@csail.mit.edu
"""
import numpy as np
from of.utils import ipshell
from scipy import sparse
from cpab.cpaNd import Tessellation as TessellationNd
class Tessellation(TessellationNd):
dim_domain = 2
_Lar... | {"hexsha": "50968be9197946111a8fd310702daa4521cab82a", "size": 20410, "ext": "py", "lang": "Python", "max_stars_repo_path": "cpab/cpa2d/Tessellation.py", "max_stars_repo_name": "freifeld/cpabDiffeo", "max_stars_repo_head_hexsha": "22df6cdbd7111b9ae3e7f1c0e31ff85e92d281a6", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import sys
import argparse
import numpy as np
import pandas as pd
import LSTM.LSTM as lstm
def info():
"""
System information
"""
print('Python version: ', sys.version)
print('Numpy version: ', np.__version__)
print('Pandas version: ', pd.__version__)
def main():
parser = argparse.... | {"hexsha": "a0a4c866f6f9d27d25ca0e25140e7b922cc04c2d", "size": 1972, "ext": "py", "lang": "Python", "max_stars_repo_path": "LSTM/__main__.py", "max_stars_repo_name": "melanieihuei/Web-Traffic-Forecasting", "max_stars_repo_head_hexsha": "d40c3e9c3900eccde271a0e82401f4f5283ee426", "max_stars_repo_licenses": ["MIT"], "max... |
include("../../MaximinOPF/src/MaximinOPF.jl")
using PowerModels
using JuMP
using SCS
using Ipopt
using ProxSDP
PowerModels.silence()
function SolveFP(pm_data,pm_form,pm_optimizer; x_vals=Dict{Int64,Float64}() )
pm = MaximinOPF.PF_FeasModel(pm_data, pm_form, x_vals)
JuMP.set_optimizer(pm.model,pm_optimizer)
JuMP.... | {"hexsha": "dd54b75e215a21a2ea6b29418909ca38f013c09c", "size": 3988, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/SolveFeas.jl", "max_stars_repo_name": "Argonne-National-Laboratory/MaximinOPF.jl", "max_stars_repo_head_hexsha": "c24f001336d11d98ffcaa5a08a04ba53ed7f7dce", "max_stars_repo_licenses": ["MI... |
"""
After using reinforcement learning to train a network, e.g. policy_gradient.py, to play a game well. We then want to
learn to estimate weather that network would win, lose or draw from a given position.
Alpha Go used a database of real positions to get it's predictions from, we don't have that for tic-tac-toe so i... | {"hexsha": "f682f0699e2a20c6ab6ff8b11869e1d76d9759dd", "size": 5304, "ext": "py", "lang": "Python", "max_stars_repo_path": "value_network.py", "max_stars_repo_name": "alphagamatoe/AlphaToe", "max_stars_repo_head_hexsha": "a7cd0969aa46dfd151a22ed8b9aec1a894747b17", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import os
import sys
import time
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
init_time = str(time.asctime()).replace(' ', '-')
FLAGS = t... | {"hexsha": "2a3dc4ebedf6d0b3886dad9cbb839daa81504851", "size": 8492, "ext": "py", "lang": "Python", "max_stars_repo_path": "gan.py", "max_stars_repo_name": "huiEric/gan_lg", "max_stars_repo_head_hexsha": "897379208e76cbfe32bd48a978c21be4d053cf5d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_... |
#importing the libraries
from keras.preprocessing.image import img_to_array
from keras.models import load_model
from imutils import build_montages
from imutils import paths
import numpy as np
import argparse
import random
import cv2
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser(... | {"hexsha": "608f3563440e59c277e424aabd16134dd41b2d85", "size": 2369, "ext": "py", "lang": "Python", "max_stars_repo_path": "load.py", "max_stars_repo_name": "Chashmyar/ChashmyarTeam", "max_stars_repo_head_hexsha": "dc77bbc1d0da528a41ae92500db56fa62850197e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "max... |
import unittest, gmsh, subprocess, gmsh, json, os, time, glob
import numpy as np
from neuronmi.mesh.mesh_utils import *
from neuronmi.mesh.shapes import *
class TestEmiMesh(unittest.TestCase):
@classmethod
def tearDownClass(cls):
trash = ('h5', 'json', 'pvd', 'vtu', 'msh', 'geo_unrolled')
ma... | {"hexsha": "de3514381b020ca6751951a556c537e8843f151d", "size": 2678, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/mesh/test_emi_mesh.py", "max_stars_repo_name": "MiroK/nEuronMI", "max_stars_repo_head_hexsha": "227b26598fa2cde5aabec68db898f308fb44aa31", "max_stars_repo_licenses": ["Apache-2.0"], "max_star... |
import Base: filter, map, reduce
"""
map(f, d::DTable) -> DTable
Applies `f` to each row of `d`.
The applied function needs to return a `Tables.Row` compatible object (e.g. `NamedTuple`).
# Examples
```julia
julia> d = DTable((a = [1, 2, 3], b = [1, 1, 1]), 2);
julia> m = map(x -> (r = x.a + x.b,), d)
DTable wi... | {"hexsha": "a68c6e6e6bc3cc1643adbfee3f67d5120b31dff7", "size": 7035, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/table/operations.jl", "max_stars_repo_name": "mattwigway/Dagger.jl", "max_stars_repo_head_hexsha": "63b9553d44dc44472a7d61d7ddbb116024e1c9f3", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
from unittest import TestCase
import numpy as np
from numpy.testing import assert_almost_equal
from skfem.assembly import CellBasis
from skfem.element import ElementTriP1
from skfem.mesh import MeshTri
from skfem.utils import projection, enforce, condense, solve
from skfem.models import laplace, mass, unit_load
cla... | {"hexsha": "db64d15b42e190908fbf5fb08c8495bd647b8cbb", "size": 1637, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_utils.py", "max_stars_repo_name": "gatling-nrl/scikit-fem", "max_stars_repo_head_hexsha": "04730d80d612470b7e802eed4c21dd96b89cef61", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
(* (c) Copyright Microsoft Corporation and Inria. You may distribute *)
(* under the terms of either the CeCILL-B License or the CeCILL *)
(* version 2 License, as specified in the README file. *)
(* version 2 License, as specified in the README file. *)
(* ... | {"author": "Wassasin", "repo": "ssreflect", "sha": "45cf056aa48bec1e7e2bbb77cb4458d4bddf43e4", "save_path": "github-repos/coq/Wassasin-ssreflect", "path": "github-repos/coq/Wassasin-ssreflect/ssreflect-45cf056aa48bec1e7e2bbb77cb4458d4bddf43e4/theories/normal.v"} |
from src.Utils.Fitness import *
from src.Utils.Population import *
import matplotlib.pyplot as plt
import pandas as pd
from scipy.spatial import distance
from src.Utils.Graphs import *
from time import time
from src.Utils.HyperParameters import *
class MOSOSARM:
def __init__(self,nbItem,populationSize,nbIteration,... | {"hexsha": "9236ef0362195b69eb5d519dfe8c2fcdecca4da6", "size": 4780, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/Algorithm/MOSOSARM.py", "max_stars_repo_name": "TheophileBERTELOOT/MOEA-ARM", "max_stars_repo_head_hexsha": "ef1736049814c998ddbdf49fefa1e31e4908fb71", "max_stars_repo_licenses": ["MIT"], "max... |
"""
This module contains the class OffloadingCommon, which is the base class of all algorithms (benchmarks, cco and decor).
OffloadingCommon defines several points in a computation offloading problem.
[--
In order to avoid Multiple Inheritance, CcoAlgorithm only inherit from Racos. Similar methods and properties are
c... | {"hexsha": "853111e25a0baed875486a8889e29aa5f6689edb", "size": 9406, "ext": "py", "lang": "Python", "max_stars_repo_path": "cross_edge_offloading/offloading_common.py", "max_stars_repo_name": "cnetboy/Cross-edge-Computation-Offloading", "max_stars_repo_head_hexsha": "64b7d9fe6b94e6e6f5fe934d97304549d21868b9", "max_star... |
[STATEMENT]
lemma (in is_functor) cf_is_functor_if_ge_Limit:
assumes "\<Z> \<beta>" and "\<alpha> \<in>\<^sub>\<circ> \<beta>"
shows "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<beta>\<^esub> \<BB>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<beta>\<^esu... | {"llama_tokens": 238, "file": "CZH_Elementary_Categories_czh_ecategories_CZH_ECAT_Functor", "length": 1} |
from io import StringIO
from numbers import Integral
import numpy as np
import pandas
import pickle
import sklearn
from sklearn import tree
from sklearn.tree import export_text
from sklearn.tree import _tree
from sklearn.tree import DecisionTreeClassifier
filename = 'final_rf_model.sav'
rf = pickle.load(open(file... | {"hexsha": "571871937c82b50aa4bb650badcd33f0a99053f8", "size": 4918, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/rftop4_v2.py", "max_stars_repo_name": "ksingh25/switchtree", "max_stars_repo_head_hexsha": "8a15a3a11100bb9444cea0a51c0ef5c141ec0b36", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy
from src.stats.bulk_stats import BulkStats
class GlobalStats(object):
def __init__(self):
super(GlobalStats, self).__init__()
self.bulks = []
def __del__(self):
# print 'GlobalStats.__del__'
del self.bulks
def get_new_bulk_stats(self, **info):
self.bu... | {"hexsha": "924a0cf65fd13c1a4055d9c5428cbae446e24873", "size": 1225, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/stats/global_stats.py", "max_stars_repo_name": "igorcoding/os-simulation", "max_stars_repo_head_hexsha": "1e76fdda75c138025950876a2e7b68e99a55c54a", "max_stars_repo_licenses": ["MIT"], "max_st... |
#include <cstdlib>
#include <iostream>
#include <functional>
#include <iomanip>
#include <list>
#include <boost/fusion/adapted/struct.hpp>
#include <boost/spirit/home/x3.hpp>
#include <boost/spirit/home/x3/support/ast/variant.hpp>
#include <boost/foreach.hpp>
namespace client {
namespace x3 = boost::spirit::x3;
typede... | {"hexsha": "3009d2ee0e98de35b483f178cdc583e8532ecf08", "size": 25591, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/plurals-parser.cpp", "max_stars_repo_name": "limitz404/plurals-parser-boost", "max_stars_repo_head_hexsha": "c90f226c5b54647e13cc07d83bd9895e8783737b", "max_stars_repo_licenses": ["MIT"], "max_... |
import torch
from torch.utils.data import Dataset
from torchvision import transforms
import os
import pandas as pd
import numpy as np
class ToTensor(object):
"""Transform the numpy array to a tensor."""
def __init__(self, dtype=torch.float):
self.dtype = dtype
def __call__(self, input):
... | {"hexsha": "e609ff2d405ad4fbbe2b1885ac793ac21544493e", "size": 5935, "ext": "py", "lang": "Python", "max_stars_repo_path": "cnns/nnlib/datasets/remy/dataset.py", "max_stars_repo_name": "adam-dziedzic/time-series-ml", "max_stars_repo_head_hexsha": "81aaa27f1dd9ea3d7d62b661dac40cac6c1ef77a", "max_stars_repo_licenses": ["... |
#include <windows.h>
#include <atlbase.h>
#include <boost/test/unit_test.hpp>
#include "../DispSvr.h"
#include "../Exports/Inc/VideoMixer.h"
#include "../Exports/Inc/VideoPresenter.h"
using namespace std;
using namespace boost::unit_test;
using namespace DispSvr;
static HWND g_hwndDevice = 0;
struct CoInit
{
CoInit(... | {"hexsha": "6369114b2fa92f3bc0a0b51edc178721d922e81f", "size": 5258, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Video/Render/Core/DispSvr/Main/test/test.cpp", "max_stars_repo_name": "goodspeed24e/2011Corel", "max_stars_repo_head_hexsha": "4efb585a589ea5587a877f4184493b758fa6f9b2", "max_stars_repo_licenses": [... |
from __future__ import print_function
import numpy as np
import reader
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
def _fit_linear_function(x, y):
X = np.array(x).reshape((-1, 1))
Y = np.array(y)
print('x: ', X)
print('y: ', Y)
model = LinearRegression()
m... | {"hexsha": "ab91dff51bc4b87945048ee38db5d9e8ec3a69f7", "size": 1786, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/comm_models.py", "max_stars_repo_name": "lzhangbv/kfac_pytorch", "max_stars_repo_head_hexsha": "159e7ef9541bb960d79c438622780cdcc71b3210", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
"""
- Blockchain for Federated Learning -
Blockchain script
"""
import hashlib
import json
import time
from flask import Flask,jsonify,request
from uuid import uuid4
from urllib.parse import urlparse
import requests
import random
from threading import Thread, Event
import pickle
import codecs
import data.federate... | {"hexsha": "69f3602ed7b2e601ec6352873d3da173a491e9aa", "size": 11546, "ext": "py", "lang": "Python", "max_stars_repo_path": "Blockchain+Federated-Learning/blockchain.py", "max_stars_repo_name": "raja21068/BLOCKCHAIN-FEDERATED-LEARNING-MINST-DATASET", "max_stars_repo_head_hexsha": "20e46a5b37677b2cffa780a19eeefb1b702f1d... |
# Model project - Externalities and Pigou taxes
Our model project consists of a microeconomic model describing the inefficiencies of pollution from production from a social economic point of view. We introduce a demand and a supply function, but the production of the suppliers is associated with a negative externality... | {"hexsha": "1ffc16f806f5661b5d2def54860dfbb75de641b9", "size": 88480, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "1312/modelproject/Model-project.ipynb", "max_stars_repo_name": "NumEconCopenhagen/projects-2019-1312", "max_stars_repo_head_hexsha": "46356ec3ad338642152f6667a0761697d1c4cbdf", "max_... |
#include <boost/hana/fwd/fold_right.hpp>
| {"hexsha": "19136574f8f2621e64a43c3bea95e372e695958d", "size": 41, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_hana_fwd_fold_right.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0"]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.