text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
# -*- coding: utf-8 -*-
"""Copy of custom_aggregators.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/10kN7CyYJzxVIz36jNSbigmQ99JERqt2B
##### Copyright 2021 The TensorFlow Federated Authors.
"""
#@title Licensed under the Apache License, Version... | {"hexsha": "cb12da446c900e26aee0ca7ab61bbc5944ba5001", "size": 27422, "ext": "py", "lang": "Python", "max_stars_repo_path": "tff_tutorials/copy_of_custom_aggregators.py", "max_stars_repo_name": "luke-who/TFF", "max_stars_repo_head_hexsha": "fe9f44a504bc51b603a3ab9a181148da0aa9612f", "max_stars_repo_licenses": ["MIT"], ... |
/-example : 1 + 2222 = 2223 :=
begin
reflexivity
end
theorem foo : 1 + (2222222222222 : nat) = 2222222222223 :=
begin
reflexivity
end
-/
theorem bar : 100003 + 100003 = 200006 :=
rfl
| {"author": "avigad", "repo": "embed", "sha": "0e3612028d4039d29d06239ef03bc50576ca0f8b", "save_path": "github-repos/lean/avigad-embed", "path": "github-repos/lean/avigad-embed/embed-0e3612028d4039d29d06239ef03bc50576ca0f8b/src/test.lean"} |
theory Executable_Relation
imports Main
begin
subsection \<open>A dedicated type for relations\<close>
subsubsection \<open>Definition of the dedicated type for relations\<close>
typedef 'a rel = "UNIV :: (('a * 'a) set) set"
morphisms set_of_rel rel_of_set by simp
setup_lifting type_definition_rel
lift_definition... | {"author": "seL4", "repo": "isabelle", "sha": "e1ab32a3bb41728cd19541063283e37919978a4c", "save_path": "github-repos/isabelle/seL4-isabelle", "path": "github-repos/isabelle/seL4-isabelle/isabelle-e1ab32a3bb41728cd19541063283e37919978a4c/src/HOL/ex/Executable_Relation.thy"} |
from datasets.base import DataLoader
from datasets.preprocessing import center_data, normalize_data, rescale_to_unit_interval, \
global_contrast_normalization, zca_whitening, extract_norm_and_out, learn_dictionary, pca
from utils.visualization.mosaic_plot import plot_mosaic
from utils.misc import flush_last_line
fr... | {"hexsha": "7efe854624c9b78c48dd53746f02887680a0e887", "size": 20748, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/datasets/smile.py", "max_stars_repo_name": "ErikKratzCth/Deep-SVDD", "max_stars_repo_head_hexsha": "f77209b85f654aa68d29ab636ecb422207f437e1", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
[STATEMENT]
lemma (in normal) oInv_equality:
"\<lbrakk>F x \<le> a; a < F (oSuc x)\<rbrakk> \<Longrightarrow> oInv F a = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>F x \<le> a; a < F (oSuc x)\<rbrakk> \<Longrightarrow> oInv F a = x
[PROOF STEP]
apply (subgoal_tac "F 0 \<le> a")
[PROOF STATE]
proof (p... | {"llama_tokens": 1063, "file": "Ordinal_OrdinalInverse", "length": 9} |
subroutine foo()
PRINT *, 'Hello World! (single quoted string)'
end subroutine
| {"hexsha": "a163403e7191c473f0f2d907230c80b4b47f79b5", "size": 81, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/CompileTests/Fortran_tests/test2007_121.f90", "max_stars_repo_name": "maurizioabba/rose", "max_stars_repo_head_hexsha": "7597292cf14da292bdb9a4ef573001b6c5b9b6c0", "max_stars_repo_licenses":... |
# With realistic parameters, how many posts do I need for user to
# propery re-esmite their cluster given that I know the real parameters for each cluster?
source('thread_generator.r')
# In Gomez 2013, they generate 100 different sets of parameters and estimate then in N=50, 500, 5000, 50000 threads
# we can also do t... | {"hexsha": "5e826e09515e9640eccc1539763d7906033f5ea8", "size": 2393, "ext": "r", "lang": "R", "max_stars_repo_path": "sandbox/learnability.r", "max_stars_repo_name": "alumbreras/dynamic-thread-stochastic-model", "max_stars_repo_head_hexsha": "96b7943754bcdba688391244f4fc8251a60a36ce", "max_stars_repo_licenses": ["MIT"]... |
#! /usr/bin/env python
# Copyright 2021 Intel Corporation
#
# 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... | {"hexsha": "0a7ef4dfd485e70e5e7b7bf2b89da7976904e748", "size": 1134, "ext": "py", "lang": "Python", "max_stars_repo_path": "numba_dppy/tests/debugging/test_side_by_side.py", "max_stars_repo_name": "akharche/numba-dppy", "max_stars_repo_head_hexsha": "f12dac64b149bd72f305f341ff64b796bbb648c1", "max_stars_repo_licenses":... |
#include "DownloadTask.h"
#include <boost/filesystem.hpp>
#include "Core/Utils/CoreUtils.h"
#include "Core/3rdpart/UriParser.h"
#include "Core/Utils/StringUtils.h"
DownloadTask::DownloadTask(std::shared_ptr<INetworkClientFactory> factory, const std::string& tempDirectory, const std::vector<DownloadItem>& files):
... | {"hexsha": "0e1bbbccd9cccdca918f0b70f20e8bfa0b03c3a5", "size": 2966, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Source/Core/DownloadTask.cpp", "max_stars_repo_name": "igor-sadchenko/image-uploader", "max_stars_repo_head_hexsha": "d559aa0d7319660a93b036821b7b99cc53e70c7e", "max_stars_repo_licenses": ["Apache-2... |
#ifndef __VSIM_SCENE_HPP__
#define __VSIM_SCENE_HPP__
#include <string>
#include <vector>
#include <memory>
#include <map>
#include <vsim/util/variant.hpp>
#include <boost/optional.hpp>
#include <Eigen/Core>
#include <vsim/env/scene_fwd.hpp>
namespace vsim {
// class defining a complete scene
class Scene {
public... | {"hexsha": "123c7955c2bc725684657391aac9b4e50403b943", "size": 543, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/vsim/env/scene.hpp", "max_stars_repo_name": "malasiot/vsim", "max_stars_repo_head_hexsha": "2a69e27364bab29194328af3d050e34f907e226b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import re
import torch
import numpy as np
from torchmetrics import Metric, MetricCollection, F1, Precision, Recall, RetrievalNormalizedDCG, AUROC, AUC
from torchmetrics.utilities.data import select_topk
class RPrecision(Metric):
"""R-precision calculates precision at k by adjusting k to the minimum value of the ... | {"hexsha": "25467ab1b69097b2166d21fa7d2d945afb287e39", "size": 3694, "ext": "py", "lang": "Python", "max_stars_repo_path": "libmultilabel/metrics.py", "max_stars_repo_name": "Abhinav43/LibMultiLabel", "max_stars_repo_head_hexsha": "805a66c13bf44e547f4b6976cae923172b96800f", "max_stars_repo_licenses": ["MIT"], "max_star... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import csv
import sys
import time
import numpy as np
import xgboost
from sklearn import ensemble
from sklearn import svm
from sklearn import preprocessing
from datasetcreator import damerau_levenshtein, jaccard, jaro, jaro_winkler,monge_elkan, cosine, strike_a_match, soft_... | {"hexsha": "20c1c849c25a6b283329808ee5fb1ba041f8f6c9", "size": 7455, "ext": "py", "lang": "Python", "max_stars_repo_path": "featureclassifiers.py", "max_stars_repo_name": "ruipds/Toponym-Matching", "max_stars_repo_head_hexsha": "0b5a0ff2da2a12dfe481c538213387f658acccf3", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (jd.jdhp@gmail.com)
import numpy as np
import matplotlib.pyplot as plt
import math
import argparse
import json
def main():
"""Main function"""
# PARSE OPTIONS ###################
parser = argparse.ArgumentParser(descrip... | {"hexsha": "2cf1f35894fa2115d7aa8c14dcf3b94d22ea0f30", "size": 1600, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/plot_part_json.py", "max_stars_repo_name": "jeremiedecock/botsim", "max_stars_repo_head_hexsha": "73262092a8769c331edb96e083e32156f33bf948", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import tensorflow as tf
import os
import numpy as np
import sentencepiece as spm
import math
import time
import json
from shutil import copy2
from utils import calculate_model_hash
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('run_dir', './run', 'Path for storing model')
tf.app.flags.DEFINE_string('dataset',... | {"hexsha": "bff3d2002d47d53007cefde0b64d31614f9347d0", "size": 14524, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "wallarm/wallnet", "max_stars_repo_head_hexsha": "51e91e203cdd1ce479ce2dc15d9846a3f9b61bef", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16, "max_star... |
program easydop853_test
use iso_fortran_env, only: wp => real64
use easydop853_module
implicit none
procedure(deriv_func) :: fcn
!! subroutine computing the value of \(dy/dx=f(x,y)\)
real(wp) :: x = 0.0_wp
!! `x` value (input is initial value and output ... | {"hexsha": "f9d45f4487f10ee9360903fabb37446c5c9599d1", "size": 697, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "easydop853_test.f90", "max_stars_repo_name": "GasinAn/easydop853", "max_stars_repo_head_hexsha": "b65193dbe43c1000958b77c1050296ef916d17f1", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_star... |
import numpy as np
import time
import distributions
import scipy.stats
import scipy.special
import mxnet as mx
from mxnet import nd
mx.random.seed(13343)
np.random.seed(2324)
def test_bernoulli_sampling():
n_samples = 10000
K = 10 # num factors
C = 2 # num classes
# latent variable is of size [n_samples, ... | {"hexsha": "797c93a728304d926ba6e3a81a8ab8956466548f", "size": 1551, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_fast_bernoulli.py", "max_stars_repo_name": "altosaar/deep-exponential-families-gluon", "max_stars_repo_head_hexsha": "80d69b54081f622c0012bb181aa6d8ab9a740f15", "max_stars_repo_licenses... |
[STATEMENT]
lemma in_\<P>_charslength:
assumes p_dom: "p \<in> \<P> k u"
shows "\<exists> v. p \<in> \<P> (charslength p) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>v. p \<in> \<P> (charslength p) v
[PROOF STEP]
proof (cases "charslength p \<ge> k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
... | {"llama_tokens": 3658, "file": "LocalLexing_TheoremD5", "length": 44} |
/-
Copyright (c) 2020 Robert Y. Lewis. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis
-/
import data.rat.meta_defs
import tactic.norm_num
import data.tree
import meta.expr
/-!
# A tactic for canceling numeric denominators
This file defines tactics th... | {"author": "leanprover-community", "repo": "mathlib", "sha": "5e526d18cea33550268dcbbddcb822d5cde40654", "save_path": "github-repos/lean/leanprover-community-mathlib", "path": "github-repos/lean/leanprover-community-mathlib/mathlib-5e526d18cea33550268dcbbddcb822d5cde40654/src/tactic/cancel_denoms.lean"} |
%% Example
% real time control of the KUKA iiwa 7 R 800
% Moving EEF of the robot in Z direction using a sinisoidal function
% An example script, it is used to show how to use the different
% functions of the KUKA Sunrise matlab toolbox
% First run the following script in Matlab
% Then start the client on the KUKA ii... | {"author": "Modi1987", "repo": "KST-Kuka-Sunrise-Toolbox", "sha": "9299bed2b46058aeb4105d7fbff6d2290ce68bba", "save_path": "github-repos/MATLAB/Modi1987-KST-Kuka-Sunrise-Toolbox", "path": "github-repos/MATLAB/Modi1987-KST-Kuka-Sunrise-Toolbox/KST-Kuka-Sunrise-Toolbox-9299bed2b46058aeb4105d7fbff6d2290ce68bba/OtherFlavou... |
#this script is responsible for the capturing the table with the leads and extracting the leads from it
import numpy as np
from PIL import ImageGrab, Image
import cv2
import time
from keras.models import load_model
import matplotlib.pyplot as plt
import time
from win32api import GetSystemMetrics
#load model
num_ep... | {"hexsha": "ee758cb3adb02827bd3941ed1fd32f72b086e6ca", "size": 4392, "ext": "py", "lang": "Python", "max_stars_repo_path": "ScreenCapture.py", "max_stars_repo_name": "tlohr/nfsu2-ai", "max_stars_repo_head_hexsha": "e93dd2161c332a901c5d64e5166099215ce826f7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 8, "max... |
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include "O... | {"hexsha": "93501362f952b0cf2b97257e63c67cb4444c5283", "size": 6911, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "predictor/Optimize.cpp", "max_stars_repo_name": "fakeNetflix/facebook-repo-fb-caffe-exts", "max_stars_repo_head_hexsha": "5e95a5df428bf9a769d71a465fb38247846bcf84", "max_stars_repo_licenses": ["BSD-... |
\section{Problem Formulation and Overview}\label{pf}
\subsection{Problem Formulation}
Given a certain number of modular SMORES robots with randomized initial positions and orientations, assemble the robots into a goal configuration specified by the user.
\subsection{Project Overview}\label{overview}
In this work, we... | {"hexsha": "68db15d4f4ab9d520ebbce6d30d55dd2ca482cda", "size": 1127, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "final_report/problem_formulation.tex", "max_stars_repo_name": "jimjing/MAndM", "max_stars_repo_head_hexsha": "efd6581851814ace386cc59285d6290ea096630b", "max_stars_repo_licenses": ["MIT"], "max_star... |
import pathlib
import methods
import torch
from torch import utils
import dataset
import logging
import json
import time
import integrators
import numpy as np
from collections import namedtuple
import copy
import functools
TRAIN_DTYPES = {
"float": (torch.float, np.float32),
"double": (torch.double, np.float6... | {"hexsha": "ee6ed466fd142e1ba2f4fa33990fa02f893326e2", "size": 22540, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/train.py", "max_stars_repo_name": "karlotness/nn-benchmark", "max_stars_repo_head_hexsha": "65ddb2f3d9934db5718417fd800278a97f627ba2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
module jlgr
import GR
@static if VERSION >= v"0.7.0-DEV.3476"
using Serialization
using Sockets
end
const None = Union{}
@static if VERSION < v"0.7.0-DEV.3137"
const Nothing = Void
end
@static if VERSION < v"0.7.0-DEV.3155"
const popfirst! = shift!
end
@static if VERSION >= v"0.7.0-DEV.3272"
f... | {"hexsha": "70670bfaaaa20297762e5bd7756d7473874a7fcc", "size": 78980, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/jlgr.jl", "max_stars_repo_name": "yhls/GR.jl", "max_stars_repo_head_hexsha": "5abb7b97e629cb4f568d23302465786341dbc526", "max_stars_repo_licenses": ["RSA-MD"], "max_stars_count": 1, "max_stars... |
import unittest
import numpy as np
from gradient_checker import GradientChecker, create_op
from op_test_util import OpTestMeta
def stable_softmax(x):
"""Compute the softmax of vector x in a numerically stable way."""
shiftx = x - np.max(x)
exps = np.exp(shiftx)
return exps / np.sum(exps)
class Tes... | {"hexsha": "e670d93653e07d35e5019c9daac45c214eddf367", "size": 902, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/paddle/v2/framework/tests/test_softmax_op.py", "max_stars_repo_name": "yu239/Paddle", "max_stars_repo_head_hexsha": "1730a3b22a6e0b44d8f925a9226c7c4f5d0e4ff8", "max_stars_repo_licenses": ["A... |
using Distributed
using Random
# @everywhere using JuliaRL
@everywhere include("test_tilecoder_mountaincar.jl")
function run_mountain_car_parallel(n_runs=10, n_episodes=10000)
experiment(run) = mountain_car_test(0.5/8, 0.1, 1.0, 32, 8; n_episodes=n_episodes, seed=1002349+run)
futures = Array{Future, 1}()
... | {"hexsha": "161b1094b66aa965636f77b03501733f474a0613", "size": 583, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "misc/parallel_mountain_car.jl", "max_stars_repo_name": "mkschleg/JuliaRL", "max_stars_repo_head_hexsha": "beb5fea9b8c9186917aab91a83836c646816e1c1", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
{-# OPTIONS --cubical #-}
module Type.Cubical.Equiv where
import Lvl
open import Type.Cubical
open import Type.Cubical.Path.Equality
import Type.Equiv as Type
open import Type
private variable ℓ₁ ℓ₂ : Lvl.Level
-- `Type.Equiv._≍_` specialized to Path.
_≍_ : (A : Type{ℓ₁}) → (B : Type{ℓ₂}) → Type
A ≍ B = A... | {"hexsha": "a684813675219e3b9927fd6a0a132ca6fb8bccf7", "size": 702, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Type/Cubical/Equiv.agda", "max_stars_repo_name": "Lolirofle/stuff-in-agda", "max_stars_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import random
import numpy as np
import matplotlib.pyplot as plt
d = 10 # total no of strategies
N = 10000 # total number of users
#SIMULATION:
conversion_rates = [0.05,0.13,0.09,0.16,0.11,0.04,0.20,0.08,0.01,0.21]
X = np.array(np.zeros([N,d]))
for i in range(N):
for j in range(d):
if np.random.rand(... | {"hexsha": "62dce3121a0ca07cd5c4573696e85c6dfc86c3c6", "size": 2060, "ext": "py", "lang": "Python", "max_stars_repo_path": "thomson_sampling.py", "max_stars_repo_name": "R4j4n/Maximizing-Revenue-of-an-Online-Retail-Business", "max_stars_repo_head_hexsha": "38890ba90c20bcca882e5d64add233ad905631a0", "max_stars_repo_lice... |
!$omp target teams distribute parallel do simd [clauses]
do-loops
!$omp end target teams distribute parallel do simd
| {"hexsha": "8d7fb483ca72b01324d3ca31fcd72521c3bbc9e1", "size": 127, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "content/syntax/v4.5.0/composite.f90", "max_stars_repo_name": "qianglise/openmp-gpu", "max_stars_repo_head_hexsha": "9bf28b6f210a58ee0ad63d60a67a90c9911bb5ef", "max_stars_repo_licenses": ["CC-BY-4... |
# Copyright 2018 Gaëtan Cassiers
#
# 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 writi... | {"hexsha": "ea2fb2bf1f4821acd4da9d8b305d11fd9307de2c", "size": 976, "ext": "py", "lang": "Python", "max_stars_repo_path": "plot_multi_agreg.py", "max_stars_repo_name": "cassiersg/lrpm-bounder", "max_stars_repo_head_hexsha": "248d959dd5dde148cff7525a42650a7dd0333c5f", "max_stars_repo_licenses": ["Apache-2.0"], "max_star... |
SUBROUTINE unique_boundary(rbc, zbs, rhobc, mmax, nmax,
1 mpol, ntor, mrho,pexp)
USE stel_kinds
IMPLICIT NONE
!-----------------------------------------------
C D u m m y A r g u m e n t s
!-----------------------------------------------
INTEG... | {"hexsha": "f52485c119903005f79cbcef4802b51cfb221e57", "size": 3097, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "LIBSTELL/Sources/Optimization/unique_boundary.f", "max_stars_repo_name": "joseluisvelasco/STELLOPT", "max_stars_repo_head_hexsha": "e064ebb96414d5afc4e205f43b44766558dca2af", "max_stars_repo_licen... |
#coding:utf-8
"""
@auther tk0103
@date 2018-07-04
"""
from chainer.training import extensions
from chainer.dataset import convert
from chainer.dataset import iterator as iterator_module
import numpy as np
import chainer
from chainer import reporter as reporter_module
from chainer.training import extension
import chain... | {"hexsha": "3860efe4d32abd0ab28402300d3b6091c8e67802", "size": 2874, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluator.py", "max_stars_repo_name": "tk0103/3D-Unet", "max_stars_repo_head_hexsha": "51f12c43871d4139c4203adc036f49741d46f1c4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
[STATEMENT]
lemma bool_to_ternary_simp2: "bool_to_ternary Y = TernaryFalse \<longleftrightarrow> \<not> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (bool_to_ternary Y = TernaryFalse) = (\<not> Y)
[PROOF STEP]
by (metis bool_to_ternary.elims ternaryvalue.distinct(1)) | {"llama_tokens": 116, "file": "Iptables_Semantics_Common_Ternary", "length": 1} |
# test
import torch
from models.ResNet import ResNet50, ResNet101
from config import *
import os
import numpy as np
import random
import torchvision.transforms as standard_transforms
from PIL import Image
from torch.autograd import Variable
from config import *
from dataset.label_preprocess import *
from sklearn.metric... | {"hexsha": "214b13f714ec1d0d55ea4154369bd66f892bce8d", "size": 2397, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "MagazzuGaetano/Weather-Classifier", "max_stars_repo_head_hexsha": "2bfac1918eea4aaa37563ef4ffabdc290e411d76", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
/*
ODE: a program to get optime Runge-Kutta and multi-steps methods.
Copyright 2011-2019, Javier Burguete Tolosa.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above cop... | {"hexsha": "34f65a4bd481a8ff05fa18b4d79593e5e70d9fce", "size": 9374, "ext": "c", "lang": "C", "max_stars_repo_path": "rk_4_3.c", "max_stars_repo_name": "jburguete/ode", "max_stars_repo_head_hexsha": "463b8402ed4aac140a4c4ca2295a69dcce98b061", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count": null, "max_st... |
!> Module handling standard output to the screen
!> or to text files for monitoring purposes.
module monitor_class
use precision, only: WP
use string, only: str_medium,str_long
implicit none
private
! Expose constructor for monitor object
public :: monitor
!> Preset some length a... | {"hexsha": "3c2799394af8cb0d3f18c4cf9838ccd24f409ca0", "size": 7776, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/libraries/monitor_class.f90", "max_stars_repo_name": "jvg723/NGA2", "max_stars_repo_head_hexsha": "f9c877140382011fbd51ee83f2c6933f09f8979e", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
! { dg-do compile }
!
! PR 42335: [OOP] ICE on CLASS IS (bad_identifier)
!
! Contributed by Harald Anlauf <anlauf@gmx.de>
implicit none
type, abstract :: vector_class
end type vector_class
type, extends(vector_class) :: trivial_vector_type
real :: elements(100)
end type trivial_vector_type
contains
... | {"hexsha": "c3bd9bac8d5346bff93dd673307c065d3117c861", "size": 680, "ext": "f03", "lang": "FORTRAN", "max_stars_repo_path": "validation_tests/llvm/f18/gfortran.dg/select_type_11.f03", "max_stars_repo_name": "brugger1/testsuite", "max_stars_repo_head_hexsha": "9b504db668cdeaf7c561f15b76c95d05bfdd1517", "max_stars_repo_l... |
!>-----------------------------------------------------------------------------------------------
!!
!> @brief Implementation of an object-oriented String class
!!
!> @author Sven Müller
!!
!> @details This class represents a simple dynamic character array which resembles
!! the object-orien... | {"hexsha": "85fdc886dcfee36fff4b23cb81ff509eba036b84", "size": 9475, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/oop/slam_string_class.f90", "max_stars_repo_name": "Space-Systems/libslam", "max_stars_repo_head_hexsha": "9a7bd64475fb48050abf33050764c192fc650876", "max_stars_repo_licenses": ["Apache-2.0"... |
'''
Utility methods to load and save data to S3
'''
import boto3
import numpy
from io import BytesIO
BUCKET='cropland-ds'
IMAGE_FOLDER = 'cropland/data'
NUMPY_FOLDER = 'cropland/numpy'
# use this command to generate this list:
# ! aws s3 ls cropland-ds/cropland/data/ | awk '{ print $4 }'
IMAGE_KEYS = '''20170306.ti... | {"hexsha": "cefecd881e606dd07c58ed759be139cff61e3e11", "size": 1426, "ext": "py", "lang": "Python", "max_stars_repo_path": "common.py", "max_stars_repo_name": "jgodwin/cropland-ds-2020", "max_stars_repo_head_hexsha": "fc5c5ed410439608bcf8377cf032ef7874321351", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
[STATEMENT]
lemma meeting_paths_produce_cycle:
assumes xs: "path (v # xs)" "xs \<noteq> Nil"
and ys: "path (v # ys)" "ys \<noteq> Nil"
and meet: "last xs = last ys"
and diverge: "hd xs \<noteq> hd ys"
shows "\<exists>zs. cycle zs \<and> hd zs = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ... | {"llama_tokens": 5456, "file": "Tree_Decomposition_Graph", "length": 60} |
import numpy as np
import util
import roc
import random
import algo.core.dtw as dtw
import algo.core.template as tpl
def single_tpl_min_based_classify(read_fun, users_num: int, training: int, genuine: int, forged: int, penalty=0):
if training <= 0 or genuine < training or forged < 0:
raise Exce... | {"hexsha": "4877d39faf6dcde96beda67adfd8e0a4a127c445", "size": 2276, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/algo/single_tpl.py", "max_stars_repo_name": "MMMMMMMingor/SCUT-OFSV", "max_stars_repo_head_hexsha": "6db6b162bd9442217e7acb84e6bf4cda2976b95f", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from scipy.signal import deconvolve
__all__ = ['xcorr', 'levinson', 'lsf2poly', 'poly2lsf']
def xcorr(x, y=None, maxlags=None, norm='biased'):
"""Cross-correlation using np.correlate
Estimates the cross-correlation (and autocorrelation) sequenc... | {"hexsha": "2f8455270966bbc5644f79e136cc639c978cae8a", "size": 9340, "ext": "py", "lang": "Python", "max_stars_repo_path": "spectrum_decoder.py", "max_stars_repo_name": "mkurop/stpltpdecoder", "max_stars_repo_head_hexsha": "9381fbff4fbc565a0d90c306d4aa0a5c658d6a68", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
function [trans,rot,scale,skew] = affineDecompose(A)
%
% [trans,rot,scale,skew] = affineDecompose(A)
%
% Decomposes an affine (orthogonal linear) transformation matrix into its
% four componets: translations, rotations scales and skews.
%
% (See affineBuild for more info.)
%
% HISTORY:
% 2004.03.12 RFD (bob@white.sta... | {"author": "vistalab", "repo": "vistasoft", "sha": "7f0102c696c091c858233340cc7e1ab02f064d4c", "save_path": "github-repos/MATLAB/vistalab-vistasoft", "path": "github-repos/MATLAB/vistalab-vistasoft/vistasoft-7f0102c696c091c858233340cc7e1ab02f064d4c/mrBOLD/RSVista/mrMethods/coords/affineDecompose.m"} |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | {"hexsha": "7160b1f7366a6cc31ea137e06e8498c9fd613a79", "size": 3956, "ext": "py", "lang": "Python", "max_stars_repo_path": "bigg/bigg/torch_ops/tensor_ops.py", "max_stars_repo_name": "egonrian/google-research", "max_stars_repo_head_hexsha": "8177adbe9ca0d7e5a9463b54581fe6dd27be0974", "max_stars_repo_licenses": ["Apache... |
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
expnum = 2
sizes = [500000, 1000000, 1500000, 2000000]
CRPQ = [2,3]
Disj = [1,2,3]
Conj = [1,3,5]
mapping = {'1':0, '3':1, '5':2}
ylabels = ["Query", "Parsing Memory", "Translating Memory", "Reasoning Memory"]
filenames = ["query", "pa... | {"hexsha": "57534a2eb46b6c52181a2d9aebdde90de15c2a53", "size": 17054, "ext": "py", "lang": "Python", "max_stars_repo_path": "rulewerk-examples/src/main/data/output/rpq/memgrapher.py", "max_stars_repo_name": "RidhwanD/rulewerk", "max_stars_repo_head_hexsha": "bce844e89febaf559c96b3f1b529548426bcb7c6", "max_stars_repo_li... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import chumpy as ch
import numpy as np
import cPickle as pkl
import scipy.sparse as sp
from chumpy.ch import Ch
from vendor.smpl.posemapper import posemap, Rodrigues
from vendor.smpl.serialization import backwards_compatibility_replacements
VERT_NOSE = 331
VERT_EAR_L = ... | {"hexsha": "8233217dd9bfcb09964c46bbecafb29f8708f8fe", "size": 6785, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/smpl.py", "max_stars_repo_name": "Pandinosaurus/videoavatars", "max_stars_repo_head_hexsha": "febcbb8f514ed9c404aa11a92447f5dce8937bda", "max_stars_repo_licenses": ["Unlicense"], "max_stars... |
#!/usr/bin/env python
# coding: utf-8
# ## CIND820 Project Course Code
# #### Ryan Boyd - 501072988
# ### Assignment 3
# ### Initial Results and Code
# In[1]:
#import libraries
import laspy as lp, sklearn as skl, numpy as np, matplotlib as mp, pandas as pd
# In[2]:
from sklearn import cluster
from sklearn impor... | {"hexsha": "fd8a842b7f4bed5333259d678442e80b384ec210", "size": 22019, "ext": "py", "lang": "Python", "max_stars_repo_path": "Sample_Results/CIND820 - Assignment 4 - Final Results.py", "max_stars_repo_name": "rboyd-ryerson/CIND820", "max_stars_repo_head_hexsha": "5df9460d68ad3775d187f309eee9bb3de9ae1f13", "max_stars_rep... |
import torch.utils.data as data
import numpy as np
import ref
import torch
from h5py import File
import cv2
from utils.utils import Rnd, Flip, ShuffleLR
from utils.img import Crop, DrawGaussian, Transform
class MPII(data.Dataset):
def __init__(self, opt, split):
print('==> initializing 2D {} data.'.format(... | {"hexsha": "ab8944ff0c8e5e7373fb580617d774b93d1c7abc", "size": 2340, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/mpii.py", "max_stars_repo_name": "IcewineChen/pytorch-pyranet", "max_stars_repo_head_hexsha": "2cb56bbda10b3c90efa5baed87381063cb180420", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import matplotlib.pyplot as plt
import numpy as np
import sys
from data import *
from module import *
from pytorch_lightning.metrics.functional import accuracy
import pickle
from argparse import Namespace
import os
import torch
import argparse
corruptions = ['brightness', 'contrast', 'defocus_blur', 'elastic',
... | {"hexsha": "cacb4f3240f673527449c9b077d47e672e140dcc", "size": 5717, "ext": "py", "lang": "Python", "max_stars_repo_path": "eval_shift.py", "max_stars_repo_name": "bkompa/PyTorch_CIFAR10_GAU", "max_stars_repo_head_hexsha": "2c6da19b251a9536167df473dabcb5cc34c66133", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
# Copyright (c) 2019 J. Alvarez-Jarreta and C.J. Brasher
#
# This file is part of the LipidFinder software tool and governed by the
# 'MIT License'. Please see the LICENSE file that should have been
# included as part of this software.
"""Set of methods aimed to remove in-source fragments:
> remove_in_src_frags():
... | {"hexsha": "37562532555690e0076f4e734e8ffb2a14674294", "size": 8357, "ext": "py", "lang": "Python", "max_stars_repo_path": "LipidFinder/PeakFilter/InSrcFragRemoval.py", "max_stars_repo_name": "s-andrews/LipidFinder", "max_stars_repo_head_hexsha": "c91d6caa8008e0a67188914e48f30913deff888d", "max_stars_repo_licenses": ["... |
import math
import os
import numpy as np
import matplotlib.pyplot as plt
def limpiar():
command = 'cls' if os.name == 'nt' else 'clear'
try:
from IPython import get_ipython
get_ipython().magic(command)
except:
os.system(command)
def ejemplo_tramas():
# np.linspace indica e... | {"hexsha": "0a244a8892b91ab15762b88caa4e1592e963d2c2", "size": 1848, "ext": "py", "lang": "Python", "max_stars_repo_path": "05-tramas/tramas.py", "max_stars_repo_name": "Agc96/matplotlib-examples", "max_stars_repo_head_hexsha": "bc2db2d14c1822b05f99356ebf538ebcd14f262a", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# The entire non-mutating rod sequence.
# For organization, the entire front half accepts arrays and
# returns tuples of arrays. Convenience overloads are at the
# end of the file
"""
cross3(a,b)
Cross products of the columns of two 3 x N arrays. Output is also 3 x N
"""
function cross3(a,b)
hcat(a[:,2].*... | {"hexsha": "0efb6b83180087af80c0a702f8a05b09cb0b9529", "size": 6241, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/rod_nonmutating.jl", "max_stars_repo_name": "jamesgabbard/DiscreteElasticRods.jl", "max_stars_repo_head_hexsha": "2621bb0b2a126745c0353c9532a6f8ce7560da33", "max_stars_repo_licenses": ["MIT"], ... |
from fastai.basics import *
from fastai.callback.all import *
from fastai.data.all import *
from fastai.vision.all import *
from functools import partial
from pathlib import Path
from nbdev.imports import test_eq
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from IPython.display... | {"hexsha": "66850d58e06fe81e9692450dd655add5c652c94a", "size": 451, "ext": "py", "lang": "Python", "max_stars_repo_path": "speechsep/imports.py", "max_stars_repo_name": "holyfiddlex/Speech-Separation", "max_stars_repo_head_hexsha": "fda075665021e6f176cbd14b31788912799ad6e2", "max_stars_repo_licenses": ["Apache-2.0"], "... |
(* Exercise 35 *)
Require Import BenB.
Variable D : Set.
Variables P Q S T : D -> Prop.
Variable R : D -> D -> Prop.
Theorem exercise_035 : (forall y, Q y -> ~ exists x, P x) /\ (forall x, P x) -> (forall y, ~ Q y).
Proof.
imp_i a1.
all_i a.
neg_i (exists x:D, P x) a2.
imp_e (Q a).
all_e (forall y:D, Q y -> ~(exist... | {"author": "KiOui", "repo": "total5", "sha": "b47117bc43a775b525813af56d54350394c22356", "save_path": "github-repos/coq/KiOui-total5", "path": "github-repos/coq/KiOui-total5/total5-b47117bc43a775b525813af56d54350394c22356/html/Uitwerkingen/BB/Coq/Taak13/Taak13_pred035.v"} |
import gym
import numpy as np
from rware import Action
from gym import spaces
from gym import ObservationWrapper
import math
class FlattenAgents(gym.Wrapper):
def __init__(self, env):
super().__init__(env)
sa_action_space = [len(Action), *env.msg_bits * (2,)]
if len(sa_action_space) == 1 ... | {"hexsha": "0af68d9f29f2dc31f2bdaf15447e7ae19bcea00b", "size": 3220, "ext": "py", "lang": "Python", "max_stars_repo_path": "rware/utils/wrappers.py", "max_stars_repo_name": "semitable/robotic-warehouse", "max_stars_repo_head_hexsha": "be626e41898d91ff4359d215960ab9b6d9943d27", "max_stars_repo_licenses": ["MIT"], "max_s... |
using BenchmarkTools, Compat, DataFrames, IntervalRootFinding, IntervalArithmetic, StaticArrays
function randVec(n::Int)
a = randn(n)
A = Interval.(a)
mA = MVector{n}(A)
sA = SVector{n}(A)
return A, mA, sA
end
function randMat(n::Int)
a = randn(n, n)
A = Interval.(a)
mA = MMatrix{n, n}... | {"hexsha": "a418bfba947c46042f23006f91cdcd792657aabf", "size": 1795, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "perf/linear_eq.jl", "max_stars_repo_name": "ericphanson/IntervalRootFinding.jl", "max_stars_repo_head_hexsha": "21be6924ec971ccc0c61a5f1e171f3b8f35c42c2", "max_stars_repo_licenses": ["MIT"], "max_s... |
import os
import cv2
import numpy as np
from utils import get_config, get_csv_folds
from dataset.h5like_interface import H5LikeFileInterface
from eval import Evaluator, flip
from dataset.carvana_dataset import CarvanaDataset
class FullImageEvaluator(Evaluator):
def __init__(self, *args, **kwargs):
super... | {"hexsha": "02d48bd6620c2ab879707912b66c4482222a3daa", "size": 2493, "ext": "py", "lang": "Python", "max_stars_repo_path": "albu/src/carvana_eval.py", "max_stars_repo_name": "chritter/kaggle_carvana_segmentation", "max_stars_repo_head_hexsha": "14165feadfb500c842616ecb93d9f350dd5bcf87", "max_stars_repo_licenses": ["MIT... |
# -*- coding: utf-8 -*-
import os
import h5py
import csv
import numpy as np
base = '/Users/yliu0/data/word'
# limit the total amount of words
LIMIT = 10000
# read in word2vec embeddings
def read_w2v_pretrained ():
from gensim.models import KeyedVectors
w2v = os.path.join(base, 'GoogleNews-vectors-negative30... | {"hexsha": "a18870d0ddb9e916dd3e63a6e9ef0b0db4f3e7fb", "size": 3503, "ext": "py", "lang": "Python", "max_stars_repo_path": "util/word_embedding/wrangle.py", "max_stars_repo_name": "yyyliu/latent-space-cartography", "max_stars_repo_head_hexsha": "c731029bfe540ac9ef703e832aac6774c01f075a", "max_stars_repo_licenses": ["BS... |
from __future__ import division
from pyomo.environ import *
from pyomo.common.tempfiles import TempfileManager
import csv
import sys
import cloudpickle
import time
import os
__author__ = "Stian Backe"
__license__ = "MIT"
__maintainer__ = "Stian Backe"
__email__ = "stian.backe@ntnu.no"
def run_empire(nam... | {"hexsha": "0797d99c5743810e0b747bc73ba51e038a2eb13e", "size": 76601, "ext": "py", "lang": "Python", "max_stars_repo_path": "Empire.py", "max_stars_repo_name": "njwong98/OpenEMPIRE", "max_stars_repo_head_hexsha": "e3762294369c5759c0444be65053e763d44c93f7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max_... |
[STATEMENT]
lemma dgrad_p_set_leI_insert_keys:
assumes "dgrad_p_set_le d F G" and "dgrad_set_le d (pp_of_term ` keys f) (pp_of_term ` Keys G)"
shows "dgrad_p_set_le d (insert f F) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. dgrad_p_set_le d (insert f F) G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove... | {"llama_tokens": 262, "file": "Polynomials_MPoly_Type_Class_Ordered", "length": 2} |
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import numpy as np
import jams
__all__ = ['get_manual_flags']
# --------------------------------------------------------------------
def get_manual_flags(flagfile, variable, dendro=None, julian=True):
"""
Get start and... | {"hexsha": "bcc9031ca272b156f9851e5306e74c3573687cca", "size": 8581, "ext": "py", "lang": "Python", "max_stars_repo_path": "jams/level1/manual_flags.py", "max_stars_repo_name": "MuellerSeb/jams_python", "max_stars_repo_head_hexsha": "1bca04557da79d8f8a4c447f5ccc517c40ab7dfc", "max_stars_repo_licenses": ["MIT"], "max_st... |
"""
This module is for computation of theoretical amplitude spectrum methods.
"""
import numpy as np
from obspy.geodetics.base import gps2dist_azimuth
OUTPUT_UNITS = ["ACC", "VEL", "DISP"]
M_TO_KM = 1.0 / 1000
# -----------------------------------------------------------------------------
# Some constantts; probabl... | {"hexsha": "fb20f1f0b4a070df2c8d177beb4a2009d370ba5f", "size": 13357, "ext": "py", "lang": "Python", "max_stars_repo_path": "gmprocess/spectrum.py", "max_stars_repo_name": "norfordb/groundmotion", "max_stars_repo_head_hexsha": "3f714894a34d9d37e1ac236f26b4366e25a05056", "max_stars_repo_licenses": ["CC0-1.0"], "max_star... |
import .induction
import principia.logic
namespace hidden
namespace oldint
open mynat
open oldint
variables {m n k : oldint}
variables {a b c : mynat}
def mul: oldint → oldint → oldint
| (of_nat m) (of_nat n) := of_nat (m * n)
| -[1+ m] (of_nat n) := neg_of_nat (succ m * n)
| (of_nat m) -[1+ n] := neg_of_nat ... | {"author": "Sterrs", "repo": "leaning", "sha": "3901cc953694b33adda86cb88ca30ba99594db31", "save_path": "github-repos/lean/Sterrs-leaning", "path": "github-repos/lean/Sterrs-leaning/leaning-3901cc953694b33adda86cb88ca30ba99594db31/src/principia/experimental/oldint/mul.lean"} |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% File: TrickHLAReqt.tex
%
% Purpose: TrickHLA Product Requirements
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\documentHistory{
{\bf Author} & {\bf Date} & {\bf Description} \\ \hline \hline
Edwin Z... | {"hexsha": "317798e1437d87b20dbc7b9f78edaead2a26298f", "size": 23917, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/TrickHLA/LaTeX/TrickHLAReqt.tex", "max_stars_repo_name": "jiajlin/TrickHLA", "max_stars_repo_head_hexsha": "ae704b97049579e997593ae6d8dd016010b8fa1e", "max_stars_repo_licenses": ["NASA-1.3"], ... |
import numpy as np
import configparser
from typing import Callable
from math import sqrt, pi, gamma
import os
import numbers
from scipy.spatial.transform.rotation import Rotation
import plotly.graph_objs as go
def create_dir(dirname: str):
"""Creates a dictionary if it does not already exist."""
if not os.pat... | {"hexsha": "26b91de481d1dc03c670094cfdb053961299b375", "size": 5668, "ext": "py", "lang": "Python", "max_stars_repo_path": "psm/util.py", "max_stars_repo_name": "etpr/sequential-manifold-planning", "max_stars_repo_head_hexsha": "a5f05d04c9ab954f39f0e8eecb3e90781564ffaa", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#include "transponders.h"
#include "transponder_dvbt.h"
#include "transponder_dvbs.h"
#include "transponder_dvbs2.h"
#include "transponder_configuration_exception.h"
#include <logger.h>
#include <boost/algorithm/string.hpp>
#include <fstream>
#include <iostream>
#include <stdexcept>
using namespace std;
namespace hom... | {"hexsha": "0aa3644d61fb2fb968d9dd93c3f0c96b18941cc7", "size": 3384, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "dvb-source/src/transponders.cpp", "max_stars_repo_name": "wozio/home-system", "max_stars_repo_head_hexsha": "ac73bec6e5050246f0e3debfbdfa43d4762bb144", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import numpy as np
from common.iterator import data_iterator
from common.plot import plot
'''
以下为二分类问题的SVM, label = -1 || 1
'''
class LinearSVM:
def __init__(self, learning_rate = 0.01, w_reg = 0.1, max_epoch = 30, batch_size = 32):
self.learning_rate = learning_rate
self.w_reg = w_reg
... | {"hexsha": "dda9339acca4dd893031012182262e5b79597831", "size": 3091, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/linearSvm.py", "max_stars_repo_name": "heyl18/ML-lib", "max_stars_repo_head_hexsha": "f9ec29e5130d60290830943179dad05e1898e6a0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
#coding: utf-8
"""
Summary
-------
Example code for executing stratified shuffle-split cross-validation for selecting
spatial interpolation methods for calculating fire season duration.
"""
#import
import geopandas as gpd
import pandas as pd
import numpy as np
import pyproj
import matplotlib.pyplot as plt
import... | {"hexsha": "aa70fcdbcc6ff38d682ecaa22a2e93793e1c707a", "size": 16201, "ext": "py", "lang": "Python", "max_stars_repo_path": "fire_weather_interpolate/example_code/stratified_shuffle_split_CV_fire_season_example.py", "max_stars_repo_name": "clara-risk/fire_weather_interpolate", "max_stars_repo_head_hexsha": "49acb1499b1... |
import torch.optim as optim
import torch.nn as nn
import torch
import time
import torchvision
from utils import imgs_display, psnr, imgs_save, prd
import scipy.io as sio
import main
def train_model(net, train_load, test_load, options):
'''
if torch.cuda.device_count() > 1:
print("Let's ... | {"hexsha": "7325c13237888181e7046de69251513d3be375da", "size": 3814, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "cyskyvein/Deep-Unfolding-weighted-L1-minimization", "max_stars_repo_head_hexsha": "9bd07d440e90c66d7b397206ef62a358695c9dd9", "max_stars_repo_licenses": ["MIT"],... |
abstract type AbstractGPModel{T<:Real,L<:AbstractLikelihood,I<:AbstractInference,N} end
@traitdef IsFull{X}
@traitdef IsMultiOutput{X}
@traitdef IsSparse{X}
Base.eltype(::AbstractGPModel{T}) where {T} = T
data(m::AbstractGPModel) = m.data
likelihood(m::AbstractGPModel) = m.likelihood
inference(m::AbstractGPModel) = m... | {"hexsha": "887b1316c40861edd7baf1bf20ebbbdcfea75481", "size": 2279, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/models/AbstractGP.jl", "max_stars_repo_name": "theogf/DataAugmentedModels.jl", "max_stars_repo_head_hexsha": "74169ce2fa55edb65cc2b11a89cbe11c0c99e2f5", "max_stars_repo_licenses": ["MIT"], "max... |
from styx_msgs.msg import TrafficLight
import cv2
import numpy as np
class TLClassifier(object):
def __init__(self):
#TODO load classifier
pass
def get_classification(self, image):
"""Determines the color of the traffic light in the image
Args:
image (cv::Mat): ima... | {"hexsha": "a5b55a90c0626a664866b5b19ee8972e53c68ac6", "size": 841, "ext": "py", "lang": "Python", "max_stars_repo_path": "ros/src/tl_detector/light_classification/tl_classifier.py", "max_stars_repo_name": "MarcosSobrinho/CarND-Capstone", "max_stars_repo_head_hexsha": "98a3a09e6e43b527238a7f5dac1c7355076e3681", "max_st... |
module persistent_object_m
use attribute_value_pair_m
use sqlite
implicit none
private
type, public :: persistent_object_t
private
type(SQLITE_DATABASE), public :: db_m
character(len=80) :: db_name_m
integer, public :: id_m
contains
... | {"hexsha": "57b247f458b8271a79905a86a1c42edc592570d5", "size": 2483, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "persistent_object_m.f90", "max_stars_repo_name": "bceverly/FABS", "max_stars_repo_head_hexsha": "97d2db030eb4cdcc14da6e50f22fbef140c10091", "max_stars_repo_licenses": ["BSD-3-Clause-No-Nuclear-L... |
#Plots a lot of the various quantities that cna be extracted from emission lines
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii
import sys, os, string
import pandas as pd
from astropy.io import fits
import collections
#Folder to save the figures
figout = '/Users/blorenz/COSMOS/Reports/... | {"hexsha": "8a9a36b58a6b0fa41e89a6f93c06aeb12667f035", "size": 5064, "ext": "py", "lang": "Python", "max_stars_repo_path": "PlotCodes/Plot_HaHbHg_Case2.py", "max_stars_repo_name": "brianlorenz/COSMOS_IMACS_Redshifts", "max_stars_repo_head_hexsha": "d8cb4fcd9c9b920f0b837806bed415053db4817d", "max_stars_repo_licenses": [... |
import numpy as np
import pandas as pd
from pandas import DataFrame
import matplotlib.pyplot as plt
import seaborn as sns
def show_values_on_bars(axs, h_v="v", space=1):
def _show_on_single_plot(ax):
if h_v == "v":
for p in ax.patches:
_x = p.get_x() + p.get_width() / 2
... | {"hexsha": "da4fdbb343881a3c03974314fe3d8327dfed1aa3", "size": 7166, "ext": "py", "lang": "Python", "max_stars_repo_path": "Visualization/OntologyStatistics.py", "max_stars_repo_name": "SINTEF-9012/SkyTrack", "max_stars_repo_head_hexsha": "569e23a3b0b02b6892d5aa5fa3b027d731eea230", "max_stars_repo_licenses": ["Apache-2... |
function a = log10(a)
%LOG10 Gradient logarithm log10(a)
%
% written 12/06/98 S.M. Rump
% modified 10/14/00 S.M. Rump use Tony's trick
% modified 04/04/04 S.M. Rump set round to nearest for safety
% accelaration for sparse input
% modified 04/06/05 S.M. Rum... | {"author": "douthwja01", "repo": "OpenMAS", "sha": "962f321f82167db78066b2c88c783423ecc3b73a", "save_path": "github-repos/MATLAB/douthwja01-OpenMAS", "path": "github-repos/MATLAB/douthwja01-OpenMAS/OpenMAS-962f321f82167db78066b2c88c783423ecc3b73a/toolboxes/Intlab_V7.1/gradient/@gradient/log10.m"} |
import numpy as np
import cv2
import panoramasdk
model_input_resolution = (600,480)
box_color = (0,0,255)
box_thickness = 1
# application class
class Application(panoramasdk.node):
# initialize application
def __init__(self):
super().__init__()
self.frame_count ... | {"hexsha": "7c17a6e07beedfe4d2ceca41bc9baf8c5a6bdb00", "size": 4305, "ext": "py", "lang": "Python", "max_stars_repo_path": "labs/2. Object tracking/lab2/packages/123456789012-lab2_code-1.0/src/app.py", "max_stars_repo_name": "aws-samples/aws-panorama-immersion-day", "max_stars_repo_head_hexsha": "be8e53402024e884454ae0... |
import torch
import numpy as np
import math
# To make plots about constellations
from sklearn.manifold import TSNE
import matplotlib.cm as cm
from models import Transmitter, Receiver, Encoder, Decoder
from comms_utils import channel
MODELS_FOLDER = 'trained_models'
def plot_constellation(m, n, ax, device, model="su... | {"hexsha": "81ced816a95e85057d1d0feb6d41cbf27c3b109c", "size": 7588, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "aponcedeleonch/Aalto-DL-for-Physical-Layer", "max_stars_repo_head_hexsha": "cbcf922360078ff8624b7fd2ea5385f28643c2db", "max_stars_repo_licenses": ["MIT"], "max_s... |
"""
This is an example about how to use binary vectors in pymilvus.
Different from normal vectors, each bit of each binary vector represents one dimension.
In python sdk, we use `bytes` object as the structure of binary vectors, which length *
8 could be equal to the dimension value of a binary vector.
You can fina m... | {"hexsha": "d64e1e0b52b55f8c4d464b2a31e3f23c4c7fd203", "size": 7361, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/example_binary.py", "max_stars_repo_name": "ireneontheway5/pymilvus", "max_stars_repo_head_hexsha": "b812449a98602b4370b3b3430bdeb18b24035e53", "max_stars_repo_licenses": ["Apache-2.0"], ... |
#include <boost/regex/v4/regex_format.hpp>
| {"hexsha": "02068a5d4208ae7abbe796fd80be976785f6543a", "size": 43, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_regex_v4_regex_format.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0... |
'''
Copyright 2021 OpenDILab. All Rights Reserved:
Description:carla utils for DI-drive
'''
import numpy as np
import math
import carla
BACKGROUND = [0, 0, 0]
def control_to_signal(control):
for k, v in control.items():
if isinstance(v, np.ndarray):
control[k] = float(v)
control_signal ... | {"hexsha": "f6f49d247a71d63e1f685b489182c00f95d68388", "size": 3670, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/utils/simulator_utils/carla_utils.py", "max_stars_repo_name": "timothijoe/DI-drive", "max_stars_repo_head_hexsha": "3cddefc85bbbca6bcdd8a4d796decacaf8d81778", "max_stars_repo_licenses": ["Apa... |
#!/usr/bin/env python
import unittest
from numpy import pi,arccos,arange
from scipy.integrate import quad
from icecube import phys_services
from icecube.dataclasses import I3Direction as i3d
class TestCylinder(unittest.TestCase):
def setUp(self):
self.length=100
self.radius=200
self.surfac... | {"hexsha": "f51a5b828ab08ac82ef88088cebd1f94ef7ae0ff", "size": 1138, "ext": "py", "lang": "Python", "max_stars_repo_path": "phys-services/resources/test/test_cylinder.py", "max_stars_repo_name": "hschwane/offline_production", "max_stars_repo_head_hexsha": "e14a6493782f613b8bbe64217559765d5213dc1e", "max_stars_repo_lice... |
# -*- coding: utf-8 -*-
# This file is part of RRMPG.
#
# RRMPG is free software with the aim to provide a playground for experiments
# with hydrological rainfall-runoff-models while achieving competitive
# performance results.
#
# You should have received a copy of the MIT License along with RRMPG. If not,
# see <http... | {"hexsha": "f7651c691ffb57d0658ef3710a6ba86af98dcb6c", "size": 6474, "ext": "py", "lang": "Python", "max_stars_repo_path": "rrmpg/models/gr4j_model.py", "max_stars_repo_name": "visr/RRMPG", "max_stars_repo_head_hexsha": "255224f00d2bdde53666f6bf3f3bf8566de15bb5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5... |
from io import StringIO
import numpy as np
import pytest
from pandas import DataFrame, concat, read_csv
import pandas._testing as tm
class TestInvalidConcat:
def test_concat_invalid(self):
# trying to concat a ndframe with a non-ndframe
df1 = tm.makeCustomDataframe(10, 2)
... | {"hexsha": "671d30716b9109c67ab58f9cb92d3a9d2ee5c473", "size": 1613, "ext": "py", "lang": "Python", "max_stars_repo_path": "mypython/Lib/site-packages/pandas/tests/reshape/concat/test_invalid.py", "max_stars_repo_name": "lilianatang/data-modelling-with-postgresql", "max_stars_repo_head_hexsha": "4b5d057d23c346cc36695dc... |
import pygame
import pymunk.pygame_util
import numpy as np
import os
from pygame.color import THECOLORS as color
import consts
# Note: This code is taken from
# https://github.com/simonkamronn/kvae/blob/master/kvae/datasets/box.py
# Made only minor adjustments, e.g. the saving paths,
# number of time-steps for test d... | {"hexsha": "d6d8e811c435a1472aec3c4340843a326814d2a6", "size": 7767, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/gluonts/nursery/torch_arsgls_rbpf/data/pymunk_kvae/pong.py", "max_stars_repo_name": "richardk53/gluon-ts", "max_stars_repo_head_hexsha": "5bde492198c0348b550ac6f7269f1740a699ec30", "max_stars_... |
[STATEMENT]
lemma dr_Skip:
fixes \<phi>::"'c \<Rightarrow> 'b"
shows "drefines \<phi> G Skip Skip"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. drefines \<phi> G Skip Skip
[PROOF STEP]
proof(intro drefinesI2 wd_intros)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>P Q s. \<lbrakk>unitary P; unitary Q... | {"llama_tokens": 852, "file": "pGCL_Algebra", "length": 8} |
import numpy
import pylab
from finmag.util.helpers import norm, angle, components, \
vectors, rows_to_columns
# Load the data which dolfin has created and odeint has integrated.
Ms = numpy.genfromtxt("1d_M.txt")
# Each entry in ys is M for a particular moment in time.
# Each M is all the x-values of M on the... | {"hexsha": "8f52d4e33479d26806d271b07ec28da48da1d33a", "size": 838, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/exchange_1D/1d_dynamics.py", "max_stars_repo_name": "davidcortesortuno/finmag", "max_stars_repo_head_hexsha": "9ac0268d2c0e45faf1284cee52a73525aa589e2b", "max_stars_repo_licenses": ["BSL-1... |
import numpy as np
import random
from collections import namedtuple, deque
import torch
import torch.nn.functional as F
import torch.optim as optim
from experience_replay import ReplayBuffer
from qnet import QNetwork
# hyperparameters
LR = 5e-4 # learning rate
BUFFER_SIZE = int(1e5) # replay buffer ... | {"hexsha": "5df46da82b86ccc5623cdde6591091f7a6cb3d25", "size": 6279, "ext": "py", "lang": "Python", "max_stars_repo_path": "dqn_agent.py", "max_stars_repo_name": "bmaxdk/OpenAI-Gym-LunarLander", "max_stars_repo_head_hexsha": "5c6a1fb77e63288c486ff7f480782a6a86370555", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import time
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sp
class MeshFPFH(object):
def __init__(self, mesh, nrings, div=11):
'''
:param mesh: open3d object? or .npz with pre-calculated VERTICES normals
:param nrings:
'''
self.mesh = mesh
self.n_rings = nrings
self._div =... | {"hexsha": "8d2e6f546f397135ec6a9c1a668138d1a0d918b8", "size": 4489, "ext": "py", "lang": "Python", "max_stars_repo_path": "features.py", "max_stars_repo_name": "amirbelder/adverserial-mesh", "max_stars_repo_head_hexsha": "7ca3673eb2af97a9498dff42a0528ab8b584258d", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
/*
* This file is part of hipSYCL, a SYCL implementation based on CUDA/HIP
*
* Copyright (c) 2018-2020 Aksel Alpay and contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. ... | {"hexsha": "61c937b4e6727ac4d61f1f017d876e4e5b1e949b", "size": 7218, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/sycl/buffer.cpp", "max_stars_repo_name": "al42and/hipSYCL", "max_stars_repo_head_hexsha": "d044da1f80c20a1525a375eabdb8be48ac622328", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_co... |
import numpy as np
import cv2
drawing = False # true if mouse is pressed
mode = True # if True, draw rectangle. Press 'm' to toggle to curve
ix,iy = -1,-1
# mouse callback function
def draw_rect(event,x,y,flags,param):
global ix,iy,drawing,mode
if event == cv2.EVENT_LBUTTONDOWN:
drawing = True
... | {"hexsha": "ff53d06d01d2f40423457dbe7c4ff35bf0f35a2b", "size": 1793, "ext": "py", "lang": "Python", "max_stars_repo_path": "2019/Lecture10/02Example/video_write_example.py", "max_stars_repo_name": "cbchoi/SIT32004", "max_stars_repo_head_hexsha": "699598fc321845e46e5cce81c6c2a60999698e6e", "max_stars_repo_licenses": ["M... |
\subsubsection{Premiums}
\label{ss:premiums}
The \lstinline!Premiums! node holds data of one or more premiums to be paid. It is used in different trade types,
notably in caps / floors (see section \ref{ss:capfloor}) and more generally in the option data component (see section
\ref{ss:option_data}). Listing \ref{lst:pr... | {"hexsha": "136ea326c64e847b0fc9da5808897aa0f3c97204", "size": 1924, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Docs/UserGuide/tradecomponents/premiums.tex", "max_stars_repo_name": "mrslezak/Engine", "max_stars_repo_head_hexsha": "c46ff278a2c5f4162db91a7ab500a0bb8cef7657", "max_stars_repo_licenses": ["BSD-3-C... |
import numpy as np
eager_i = 6
eager = 4*2**eager_i
rend_i = 12
rend = 4* 2 ** rend_i
class Model():
alpha = 0
beta = 0
sizes = ""
def __init__(self, times, start = 0):
self.sizes = [4*2**(i+start) for i in range(len(times))]
mat = list()
t = list()
for i in range(... | {"hexsha": "e255355b6693bacdd180a9e74c35e2b082e7a494", "size": 5803, "ext": "py", "lang": "Python", "max_stars_repo_path": "improve_maxrate/plotting_scripts/mvapich_postal_model.py", "max_stars_repo_name": "bienz2/BenchPress", "max_stars_repo_head_hexsha": "bb2b2360a66faeb2640bc14701a649d2fe7df712", "max_stars_repo_lic... |
using DiffEqSensitivity,OrdinaryDiffEq, ParameterizedFunctions,
RecursiveArrayTools, DiffEqBase, ForwardDiff, Calculus, QuadGK,
LinearAlgebra
using Test
fb = @ode_def_bare begin
dx = a*x - b*x*y
dy = -c*y + x*y
end a b c
f = @ode_def begin
dx = a*x - b*x*y
dy = -c*y + x*y
end a b c
p = [1.5,1.0,3.... | {"hexsha": "0b6b07cd363974a8dc104ca941e68c4966a49742", "size": 8148, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/adjoint.jl", "max_stars_repo_name": "siddharthlal25/DiffEqSensitivity.jl", "max_stars_repo_head_hexsha": "a97f7e37196ffe2d3504f46ca89dd30127b37364", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error,mean_absolute_error
from keras.models import Sequential
from keras.layers.recurrent import LSTM
from keras.layers.core import Dense
import math
import helpers as h
def moving_test_windo... | {"hexsha": "272a7986567d4b5c45892f9f46f79ca1bcaa71b1", "size": 13587, "ext": "py", "lang": "Python", "max_stars_repo_path": "engines/lstm.py", "max_stars_repo_name": "MikelEulate/timecop", "max_stars_repo_head_hexsha": "033306f20f9748065e396a9aace0591e632cf9e0", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
# Count the OpenMP changes to the BATS-R-US source code.
#
# Hongyang Zhou, hyzhou@umich.edu 05/09/2019
using DataFrames, Printf, Query
function extractOpenmpInfo(File::AbstractString; Dir::AbstractString=".",
Debug::Bool=false)
nLine,nOpenmpLine = 0,0 # Initialize counters
for line in eachline(joinpath(Dir,File)... | {"hexsha": "5fff37d3004543a6276ffe9faf5cdf4b940f55ac", "size": 1467, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "timing/CountOpenmpLines.jl", "max_stars_repo_name": "henry2004y/VisAnaJulia", "max_stars_repo_head_hexsha": "cbf608847f66321f3fa8665f12a8850f7bd01408", "max_stars_repo_licenses": ["MIT"], "max_star... |
!COMPILER-GENERATED INTERFACE MODULE: Tue Oct 10 17:23:06 2017
MODULE MATMULS__genmod
INTERFACE
SUBROUTINE MATMULS(X,V,P)
USE BIO_MOD, ONLY : &
& NPAR
REAL(KIND=8), INTENT(IN) :: X(NPAR,NPAR)
... | {"hexsha": "544e776f8bb8348cf9cf0d48ac0fd8e533dce72d", "size": 507, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "DRAM/EFTsimple/HOTS1/Compile/matmuls__genmod.f90", "max_stars_repo_name": "BingzhangChen/NPZDFeCONT", "max_stars_repo_head_hexsha": "0083d46dadc4fb8fed8728816755678da8294e16", "max_stars_repo_lic... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import argparse
import os
import numpy as np
cmd_opt = argparse.ArgumentParser(description='Argparser for GAN user model for RL based recommendation')
cmd_opt.add_argument('-data_folder', type=str, default='.... | {"hexsha": "87712f83fb01d007c86c07d867fc0f3283565641", "size": 1559, "ext": "py", "lang": "Python", "max_stars_repo_path": "ganrl/common/cmd_args.py", "max_stars_repo_name": "q710245300/GenerativeAdversarialUserModel", "max_stars_repo_head_hexsha": "4ee4f72f507631c84daa3b1b9b16998c8008b5ef", "max_stars_repo_licenses": ... |
from efficient_det.utils.overlap import compute_intersection_over_union
import numpy as np
def compute_box_targets(anchors, annotations_batch, num_classes, image_shape):
""" Compute annotations outputs for the network using annotations.
Args:
anchors: Default boxes.
annotations_batch: List of... | {"hexsha": "179f14eb6598358c6a238c645f70bbad45052ffb", "size": 5079, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/efficient_det/utils/targets.py", "max_stars_repo_name": "zeynep68/object-detection-efficientdet", "max_stars_repo_head_hexsha": "4d4b194bf1641cbb705e7659b66539752986c218", "max_stars_repo_lice... |
from prev_projects.DATAFIT.VIEW import GraphView
from prev_projects.DATAFIT.MODEL import FitModel
from prev_projects.DATAFIT.CONTROLLER import FitController
from prev_projects.DATAFIT.HELPFUL import ndarray_tostring
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import (QListWidgetItem,
... | {"hexsha": "a936cce9512c908d60e449f3b927ccdfded45cc4", "size": 15383, "ext": "py", "lang": "Python", "max_stars_repo_path": "utilities/prev_projects/DATAFIT/CONTROLLER/GraphController.py", "max_stars_repo_name": "Saldenisov/pyconlyse", "max_stars_repo_head_hexsha": "1de301b4a4c15ee0bd19034aa8d5da1beacfd124", "max_stars... |
import os,shutil,sys
import numpy as np
from mpi4py import MPI
from pypospack.pyposmat.data import PyposmatConfigurationFile
from pypospack.pyposmat.engines import PyposmatIterativeSampler
if __name__ == "__main__":
pyposmat_data_directory = 'data'
pyposmat_filename_in = os.path.join(
pyposmat_data... | {"hexsha": "87cab8fd1dde738c53bafcaf760b284310e42b11", "size": 2119, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/Ni__eam__born_exp_fs__cluster/run__iterative_cluster_sampling.py", "max_stars_repo_name": "eragasa/pypospack", "max_stars_repo_head_hexsha": "21cdecaf3b05c87acc532d992be2c04d85bfbc22", "m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.