text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
[STATEMENT]
lemma hoare_weaken_left[trans]: \<open>A \<le> B \<Longrightarrow> hoare B p C \<Longrightarrow> hoare A p C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>A \<le> B; hoare B p C\<rbrakk> \<Longrightarrow> hoare A p C
[PROOF STEP]
unfolding hoare_def
[PROOF STATE]
proof (prove)
goal (1 s... | {"llama_tokens": 250, "file": "Registers_QHoare", "length": 2} |
#KRM
import numpy as np
from math import *
import scipy.io
import scipy as spy
from netCDF4 import Dataset
import pandas as pd
import pylab as pl
import os
import sys
lib_path = os.path.abspath('../../Building_canyon/BuildCanyon/PythonModulesMITgcm') # Add absolute path to my python scripts
sys.path.append(l... | {"hexsha": "518e268359686390f37dee7661238402371dcf65", "size": 7554, "ext": "py", "lang": "Python", "max_stars_repo_path": "PythonScripts/bottomConcentrationBARKLEY.py", "max_stars_repo_name": "UBC-MOAD/outputanalysisnotebooks", "max_stars_repo_head_hexsha": "50839cde3832d26bac6641427fed03c818fbe170", "max_stars_repo_l... |
from dash import dcc, html, Input, Output, callback, dash_table
import dash_bootstrap_components as dbc
import pandas as pd
import plotly.express as px
import numpy as np
import scipy.stats as stats
from pages.style import PADDING_STYLE
THRESHOLD = 0.5
TEXT_STYLE = {
'textAlign':'center',
'width': '70%',
'... | {"hexsha": "3a669387b01d64c166841624076936b6393035e9", "size": 10177, "ext": "py", "lang": "Python", "max_stars_repo_path": "pages/relevance_page.py", "max_stars_repo_name": "reddit-conflicting-viewpoints/Reddit", "max_stars_repo_head_hexsha": "7d531f8cb826cf2d8196cf126d1e11dacc144155", "max_stars_repo_licenses": ["MIT... |
import pickle
import numpy as np
# with open("./output/cifar_inception2.pkl", 'rb') as f:
# dat = pickle.load(f)
# is_dict = dict({})
# for item in dat:
# allis = dat[item]
# allis = [x[0] for x in allis]
# is_dict[item] = np.array(allis)
# print(item, np.max(is_dict[item]),... | {"hexsha": "f425a726fc8c81f77c12d517609868d22c60eb62", "size": 1794, "ext": "py", "lang": "Python", "max_stars_repo_path": "Summary/summary_results.py", "max_stars_repo_name": "taufikxu/GAN_PID", "max_stars_repo_head_hexsha": "96565d8181e9b42eb30b4b11a946fefc88bfb8f7", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
"""
Test that builds the 5 DOF model presented in the article:
[1]: Branlard, Flexible multibody dynamics using joint coordinates and the Rayleigh-Ritz approximation: the general framework behind and beyond Flex, Wind Energy, 2019
"""
##
import numpy as np
import copy
import unittest
from welib.yams.bodies impo... | {"hexsha": "736bddd6ac3bc61aac284fc975158be58e1cf8db", "size": 7353, "ext": "py", "lang": "Python", "max_stars_repo_path": "welib/yams/tests/test_TNSB_article.py", "max_stars_repo_name": "moonieann/welib", "max_stars_repo_head_hexsha": "0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52", "max_stars_repo_licenses": ["MIT"], "max... |
# -*- coding: utf-8 -*-
"""
The script to demo the feature extraction procedure
Objective:
1. Read in the image from the resampled nii files (generated by the resize_volume.py)
the lung lobe segmentation files
the lesion segmentation files
2. Segment the lesion reg... | {"hexsha": "ab4d39a926433687b78204b7555bcb8668320db1", "size": 6096, "ext": "py", "lang": "Python", "max_stars_repo_path": "feature_generator/WLR_generator.py", "max_stars_repo_name": "DIAL-RPI/COVID19-ICUPrediction", "max_stars_repo_head_hexsha": "b79a9c53987bd71d8df7dae554eafaafa592ca9a", "max_stars_repo_licenses": [... |
[STATEMENT]
lemma (in group) exp_of_derived_is_subgroup':
assumes "H \<subseteq> carrier G" shows "subgroup ((derived G ^^ (Suc n)) H) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. subgroup ((derived G ^^ Suc n) H) G
[PROOF STEP]
using assms derived_is_subgroup[OF subgroup.subset] derived_is_subgroup
[PROOF ST... | {"llama_tokens": 229, "file": null, "length": 2} |
import numpy as np
from sklearn.cluster import KMeans
raw_data = []
fitness = [0,0,0,0,0,0]
Population = [[1, 2], [1, 4], [1, 0], [4, 2], [4, 4], [4, 0]]
for i in range(len(Population)):
raw_data.append(Population[i])
raw_data = np.array(raw_data)
num_cluster = int(2)
kmeans = KMeans(n_clusters=num_cluster, random... | {"hexsha": "64aadc1da97ca244e36ab5d7b11dfc54182677b4", "size": 1209, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/test.py", "max_stars_repo_name": "xijunlee/SPC-POSM", "max_stars_repo_head_hexsha": "d5b831445437f93d00cb5fe7eb7ac462512feb13", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
# -*- coding: UTF8 -*-
"""
translate between evo and Pandas types
author: Michael Grupp
This file is part of evo (github.com/MichaelGrupp/evo).
evo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version ... | {"hexsha": "930be587463e4dfe5d3238e84bad4012ee176926", "size": 2150, "ext": "py", "lang": "Python", "max_stars_repo_path": "ros/src/simu_tools/scripts/evo/tools/pandas_bridge.py", "max_stars_repo_name": "yx0123/AirSim", "max_stars_repo_head_hexsha": "49e332b27f50c031bc2085726dd10c65bc8be7fd", "max_stars_repo_licenses":... |
import Mathbin
import ZkSNARK.GeneralLemmas.MvDivisibility
import ZkSNARK.GeneralLemmas.PolynomialMvSvCast
noncomputable section
namespace KnowledgeSoundness
open Finset Polynomial
/- The finite field parameter of our SNARK -/
variable {F : Type u} [Field F]
/- The naturals representing:
m - the number of gates in... | {"author": "lurk-lab", "repo": "ZKSnark.lean", "sha": "a92ff01fac8e59ffb0de13a41eac6461af6d7cf0", "save_path": "github-repos/lean/lurk-lab-ZKSnark.lean", "path": "github-repos/lean/lurk-lab-ZKSnark.lean/ZKSnark.lean-a92ff01fac8e59ffb0de13a41eac6461af6d7cf0/ZkSNARK/BabyZkSNARK/KnowledgeSoundness.lean"} |
"""
This is is a part of the DeepLearning.AI TensorFlow Developer Professional Certificate offered on Coursera.
All copyrights belong to them. I am sharing this work here to showcase the projects I have worked on
Course: Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning
... | {"hexsha": "72ff21c194557ab30ff249201a36fe127d3eb9ad", "size": 2167, "ext": "py", "lang": "Python", "max_stars_repo_path": "Course_4_Week_2_Project_1.py", "max_stars_repo_name": "Vivek9Chavan/DeepLearning.AI-TensorFlow-Developer-Professional-Certificate", "max_stars_repo_head_hexsha": "c48f2040631a87d973ea8cbe534af9cd8... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 27 14:52:57 2018
@author: amaity
Generate a synthetic
PDF distribution that
is dependent upon the number
of core allocations,
you might ignore the workload
for now
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
fro... | {"hexsha": "558fefc1491501361b4f070434deace9dc0141f2", "size": 1676, "ext": "py", "lang": "Python", "max_stars_repo_path": "ptss_synthpdf.py", "max_stars_repo_name": "Arka2009/ecopmcpoc", "max_stars_repo_head_hexsha": "4325026d11b6b72716d96072dde9665983be4dbb", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_co... |
syntax "foo" : tactic
macro_rules | `(tactic| foo) => `(tactic| assumption)
macro_rules | `(tactic| foo) => `(tactic| apply Nat.pred_lt; assumption)
macro_rules | `(tactic| foo) => `(tactic| contradiction)
example (i : Nat) (h : i - 1 < i) : i - 1 < i := by
foo
example (i : Nat) (h : i ≠ 0) : i - 1 < i := by
foo... | {"author": "leanprover", "repo": "lean4", "sha": "742d053a97bdd109a41a921facd1cd6a55e89bc7", "save_path": "github-repos/lean/leanprover-lean4", "path": "github-repos/lean/leanprover-lean4/lean4-742d053a97bdd109a41a921facd1cd6a55e89bc7/tests/lean/run/evalTacticBug.lean"} |
# multivariate multi-step encoder-decoder lstm example
from numpy import array
from numpy import hstack
from keras.models import load_model
import tensorflow_hub as hub
import numpy as np
import tensorflow_text
from sklearn.neighbors import NearestCentroid
import os
import tensorflow as tf
os.environ['TF_CPP_MIN_LOG_LE... | {"hexsha": "07b01f36b9d9e6781b9b82b7871407bcd22fd407", "size": 1451, "ext": "py", "lang": "Python", "max_stars_repo_path": "testmodel.py", "max_stars_repo_name": "bgokden/lstm-recommender-example", "max_stars_repo_head_hexsha": "77c82fc57e6cf27816d0417dd38327e16fd0541a", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import matplotlib.pyplot as plt
import os
import numpy as np
# mnist = input_data.read_data_sets("MNIST_data", one_hot=True)
# print "basic information of mnist dataset"
# print "mnist training data size: ", mnist.train.num_examples
# ... | {"hexsha": "55cbbdb12daa23d9f27d1c8ca4966b6c07fed124", "size": 7311, "ext": "py", "lang": "Python", "max_stars_repo_path": "mnist_number_recognition/mnist_dataset.py", "max_stars_repo_name": "carbo-T/TF", "max_stars_repo_head_hexsha": "56ebfc253615b22fc3a55ba5e952837c47bf85cf", "max_stars_repo_licenses": ["MIT"], "max_... |
#include "Visualizer.h"
#include <boost/format.hpp>
#include "affdex_small_logo.h"
#include <algorithm>
Visualizer::Visualizer():
GREEN_COLOR_CLASSIFIERS({
"joy"
}),
RED_COLOR_CLASSIFIERS({
"anger", "disgust", "sadness", "fear", "contempt"
})
{
logo_resized = false;
logo = cv::imdecode(cv::Inpu... | {"hexsha": "ca4be41266c8678fd1b340344392047bd18181aa", "size": 12815, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "common/Visualizer.cpp", "max_stars_repo_name": "nbonfire/cpp-sdk-samples", "max_stars_repo_head_hexsha": "e85b169301bf4737a4e720646774140087701a07", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
-- Andreas, 2012-02-14. No short-circuit conversion test for sizes!
{-# OPTIONS --sized-types --show-implicit #-}
-- {-# OPTIONS -v tc.size.solve:20 -v tc.conv.size:20 -v tc.term.con:50 -v tc.term.args:50 #-}
module Issue298b where
open import Common.Size
data BTree : {size : Size} → Set where
leaf : {i : Size} →... | {"hexsha": "8f38873acc1755f8f315a10b0ebe455cb62b97fc", "size": 498, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "test/succeed/Issue298b.agda", "max_stars_repo_name": "asr/agda-kanso", "max_stars_repo_head_hexsha": "aa10ae6a29dc79964fe9dec2de07b9df28b61ed5", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
The http://www.hr.ucdavis.edu/Administration/UCD_Community_Interest_Groups/AAFSA African American Faculty and Staff Association meets on the third Wednesday of the month in 3201 Hart Hall.
| {"hexsha": "532823b778ed40effae041fe79f70e23644956a3", "size": 190, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/African_American_Faculty_and_Staff_Association.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_lic... |
library(derivr)
library(dplyr)
library(plotly)
# Plot PnL for three options:
spot_price <- seq(100, 200)
call1 <- 10 * bs_call(180, spot_price, 7, 0.25, 0.001)
call2 <- -10 * bs_call(170, spot_price, 7, 0.30, 0.001)
put1 <- 10 * bs_put(140, spot_price, 7, 0.40, 0.001)
sum <- call1 + call2 + put1
data <- data.fram... | {"hexsha": "334acfb9e025bc1b97a86382ff83140daa1f2fdb", "size": 864, "ext": "r", "lang": "R", "max_stars_repo_path": "examples/example_plot.r", "max_stars_repo_name": "beccau/derivr", "max_stars_repo_head_hexsha": "529bd42926b2f582f23880473ba32960762c7788", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
import pprint
import numpy as np
from core.net_errors import NetIsNotInitialized
def calculate_average_neighboring(net_object):
if net_object.net is None:
raise NetIsNotInitialized()
net = net_object.net
zero_weights = np.zeros((net_object.config[0]))
weights = np.ma.array(np.reshape(net[... | {"hexsha": "03066320eb5b39ad4014dd573d7e932e301d5fb3", "size": 1075, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/net_neighboring_calculator.py", "max_stars_repo_name": "nikon-petr/kohonen", "max_stars_repo_head_hexsha": "c23ae3032c58681040fe023bfa395d1ff9989876", "max_stars_repo_licenses": ["MIT"], "max... |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by... | {"hexsha": "dc5bb26c10b405a96248df62a2737d6af784ad47", "size": 2746, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "boost/geometry/algorithms/detail/counting.hpp", "max_stars_repo_name": "cpp-pm/boost", "max_stars_repo_head_hexsha": "38c6c8c07f2fcc42d573b10807fef27ec14930f8", "max_stars_repo_licenses": ["BSL-1.0"... |
! ******************************************************************************************************************************** !
! atchem_data_netCDF.f90
! ATCHEM netCDF ROUTINES
! ******************************************************************************************************************************** !
MO... | {"hexsha": "bd70842860be537c34706374591b06b38ad97dd0", "size": 5743, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/atchem/atchem_data_netCDF.f90", "max_stars_repo_name": "derpycode/cgenie", "max_stars_repo_head_hexsha": "ca5f66a857e3ba7ed60785052d19f92abb7ffc00", "max_stars_repo_licenses": ["MIT"], "max_... |
from mod_create import *
import yaml
import sys
import numpy as np
from math import *
import transformations as tr
from PyQt5 import QtCore, QtGui
def SaveParameter(interfaceobj):
filer = '/home/themarkofaspur/catkin_ws/src/cdpr3/sdf/cube.yaml'
yamlObject = DictToObj(filer)
#interfaceobj = interfaceob... | {"hexsha": "3d7e533a8b96a4b9cf4cf7f54940ec62efce3bca", "size": 7795, "ext": "py", "lang": "Python", "max_stars_repo_path": "rqt_cdpr/src/rqt_cdpr/saveparam.py", "max_stars_repo_name": "siddharthumakarthikeyan/Cable-Driven-Parallel-Robots-CDPR-Modelling", "max_stars_repo_head_hexsha": "4e8d991d55ae7da91b3c90773c679f3369... |
[STATEMENT]
lemma pow_mono_exp: assumes a: "a \<ge> (1 :: 'a :: ordered_semiring_1)"
shows "n \<ge> m \<Longrightarrow> a ^ n \<ge> a ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n
[PROOF STEP]
proof (induct m arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subg... | {"llama_tokens": 1601, "file": "Abstract-Rewriting_SN_Orders", "length": 17} |
module Tests
using SparseRegressionAlgorithms
S = SparseRegressionAlgorithms
using Base.Test
macro display(ex)
:(display($ex))
end
@testset "sweep" begin
n, p = 1000, 5
x = randn(n, p)
y = x * collect(1:p) + randn(n)
w = rand(n)
@display S.sweepreg(x, y)
end
end
| {"hexsha": "87ff215854cd8b63f76fd5e330c004efb8de1203", "size": 289, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "joshday/SparseRegressionAlgorithms", "max_stars_repo_head_hexsha": "86eda4625ac0273cc4dfa6283357ccf68ea99f27", "max_stars_repo_licenses": ["MIT"], "max_sta... |
from typing import Union
import numpy as np
import tensorflow.keras as keras
from numpy import ndarray
from pandas import DataFrame
from .model_helpers import make_tensorboard_callback, make_save_path
from ..utils import naming
class SimpleModel:
def __init__(self, directory_name: str, n_input: int, n_output: i... | {"hexsha": "462aecb8a5ed8a09ae34a53857540485a0ce9cc8", "size": 2900, "ext": "py", "lang": "Python", "max_stars_repo_path": "mlreflect/models/simple_model.py", "max_stars_repo_name": "schreiber-lab/mlreflect", "max_stars_repo_head_hexsha": "88a80ccac48461cc8934a46041726b70e469c6b8", "max_stars_repo_licenses": ["MIT"], "... |
using Juxta
using Test
ja = JuxtArray(randn(5,10), ["x","y"],
Dict("x"=>collect(1:5),"y"=>collect(1:10)))
ja1 = JuxtArray(randn(5,10), ["x","y"],
Dict("x"=>collect(1:5),"y"=>collect(1:10) .* 2))
ja2 = JuxtArray(randn(5,10), ["x","y"],
Dict("x"=>collect(1:5... | {"hexsha": "f41fbb092ef0e0208583e8485f4379cc84462a16", "size": 2035, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "suyashbire1/Juxta.jl", "max_stars_repo_head_hexsha": "be8ce1f5024afc10535ac0ca95a1faaff0d309a0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
#!/usr/bin/python2
"""Downloads forecasted streamflow for rivers of interest.
This script downloads forecasted streamflow for rivers of interest. Run
as a scheduled task or cron job to keep your database current.
"""
import gzip
import json
import os
import tempfile
from urllib import urlretrieve
from netCDF4 import... | {"hexsha": "e7aba33e46468ee9798f2f1b8d5ea9981dff0b09", "size": 3500, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/get_latest_forecast/get_latest_forecast.py", "max_stars_repo_name": "tyjmadsen/pynwm_v1", "max_stars_repo_head_hexsha": "3e2e3b8f65ca3c0a21dbe57e3cd00e054957b794", "max_stars_repo_license... |
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | {"hexsha": "866586365dfc27be9563799388e577ccf2078bcb", "size": 10330, "ext": "py", "lang": "Python", "max_stars_repo_path": "dm_pix/_src/augment_test.py", "max_stars_repo_name": "SupreethRao99/dm_pix", "max_stars_repo_head_hexsha": "6accc9643b1ebfc2e6a036629cec042bc6f5325d", "max_stars_repo_licenses": ["Apache-2.0"], "... |
theory Dioid
imports Lattice
begin
(* +------------------------------------------------------------------------+ *)
section {* Dioids *}
(* +------------------------------------------------------------------------+ *)
record 'a dioid = "'a partial_object" +
plus :: "'a \<Rightarrow> 'a \<Rightarrow> 'a" (infixl "... | {"author": "Alasdair", "repo": "Thesis", "sha": "8face4b62adfd73803b387e95c24f06e09736e30", "save_path": "github-repos/isabelle/Alasdair-Thesis", "path": "github-repos/isabelle/Alasdair-Thesis/Thesis-8face4b62adfd73803b387e95c24f06e09736e30/WorkingSKAT/Dioid.thy"} |
//==================================================================================================
/*!
@file
@copyright 2016 NumScale SAS
@copyright 2016 J.T. Lapreste
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
... | {"hexsha": "ba161fa28baa2e6da4af514f1d027d34491e2ff4", "size": 690, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/simd/function/scalar/is_lessgreater.hpp", "max_stars_repo_name": "yaeldarmon/boost.simd", "max_stars_repo_head_hexsha": "561316cc54bdc6353ca78f3b6d7e9120acd11144", "max_stars_repo_licen... |
[STATEMENT]
lemma hd_if: "hd (if p then xs else ys) = (if p then hd xs else hd ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. hd (if p then xs else ys) = (if p then hd xs else hd ys)
[PROOF STEP]
by auto | {"llama_tokens": 96, "file": "Word_Lib_Many_More", "length": 1} |
import os
import math
from collections import OrderedDict
import numpy as np
import torch
import tensorflow as tf
from utils import fill_layer, _gather_token_embedding, _get_encode_output_mapping_dict
from transformer_pb2 import Transformer
from transformers import BartForConditionalGeneration
os.environ["CUDA_VISIBL... | {"hexsha": "82162c5aa78752800e9b312a01cc80911c1c0076", "size": 13992, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/inference/python/hf_bart_export.py", "max_stars_repo_name": "godweiyang/lightseq", "max_stars_repo_head_hexsha": "a23f6807c354410fbd3bb11a17918e99c7af6272", "max_stars_repo_licenses": ["... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | {"hexsha": "fc204cef5f7cd0821f20b9d4023b5bf55cc47f9b", "size": 2618, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow_probability/python/internal/auto_batching/lowering_test.py", "max_stars_repo_name": "nxdao2000/probability", "max_stars_repo_head_hexsha": "33d2bc1cb0e7b6284579ea7f3692b9d056e0d700", "m... |
[STATEMENT]
lemma [bm_simps]: " bin_mismatch_pref x y (y \<cdot> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. bin_mismatch_pref x y (y \<cdot> v)
[PROOF STEP]
unfolding bin_mismatch_pref_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>k. x \<^sup>@ k \<cdot> y \<le>p y \<cdot> v
[PROOF STEP]
usi... | {"llama_tokens": 253, "file": "Combinatorics_Words_Submonoids", "length": 3} |
import numpy as np
import os
import sys
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
#sys.path.append(os.path.join(os.path.dirname(__file__),"../"))
from crowdsourcing.interfaces.mechanical_turk import *
from crowdsourcing.interfaces.local_webserver import *
from crowdsourcing.util.image_sea... | {"hexsha": "08cb8a6c9dbadf044fb7fdbdc7cf6d84929802a3", "size": 1753, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/collect_annotations_bbox.py", "max_stars_repo_name": "sbranson/online_crowdsourcing", "max_stars_repo_head_hexsha": "d1f7c814bb60aae9cf5e76e0b299713246f98ce3", "max_stars_repo_licenses... |
import numpy as np
import pandas as pd
import argparse
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
import mlflow
from models import Model_RFR
from utils import Trainer
def main():
mlflow.start_run()
df = pd.read_csv(args.input)
#print(df.head())
... | {"hexsha": "756f8f214c2872d821f1a2c7ea8d9fec140c69b5", "size": 1342, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/train.py", "max_stars_repo_name": "yktsnd/titanic", "max_stars_repo_head_hexsha": "60805236d6260170894b0a6501eba6f464ff60ea", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
import numpy as np
import cv2
import torch
from torch.multiprocessing import Pool, Process, set_start_method
import itertools
import matplotlib.pyplot as plt
import torch.multiprocessing as mp
def cut_empty(img, padding=30):
rows, cols = img.shape
e_r = img.max(1).nonzero()[0]
min_non_e_r = e_r[0]
max... | {"hexsha": "ae60b78b5ae76b419983c715cb1aecf224b1addf", "size": 12236, "ext": "py", "lang": "Python", "max_stars_repo_path": "localization.py", "max_stars_repo_name": "nemodrive/ImprovedLocalization", "max_stars_repo_head_hexsha": "613298f01d152f12aa0c7c3b5f33612a1175b5d3", "max_stars_repo_licenses": ["MIT"], "max_stars... |
using SailRoute, Test
@testset "Distances" begin
dist, bearing = SailRoute.haversine(-99.436554, 41.507483, -98.315949, 38.504048)
@test dist ≈ 187.595 atol=0.01
dist, bearing = SailRoute.euclidean(0.0, 0.0, 10.0, 10.0)
@test dist ≈ 14.142 atol=0.01
@test bearing ≈ 45.0
end
| {"hexsha": "6d6973337aa6202fc2bbcf27e430fade64aed232", "size": 297, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_domain.jl", "max_stars_repo_name": "TAJD/sail_route.jl", "max_stars_repo_head_hexsha": "8f8548188719564f6634868cbe2687a88df1d4a7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3,... |
"""Tests for epi_forecast_stat_mech.mechanistic_models.observables."""
from absl.testing import absltest
from absl.testing import parameterized
from epi_forecast_stat_mech.mechanistic_models import mechanistic_models
from epi_forecast_stat_mech.mechanistic_models import observables
import numpy as np
from jax import n... | {"hexsha": "95cf75d952d450d82d17f1cc8bb8564c44bf2d38", "size": 1874, "ext": "py", "lang": "Python", "max_stars_repo_path": "epi_forecast_stat_mech/mechanistic_models/observables_test.py", "max_stars_repo_name": "HopkinsIDD/EpiForecastStatMech", "max_stars_repo_head_hexsha": "4ba57edff1ece0c56ec6dfa41eac4cfe4a1c66cb", "... |
[STATEMENT]
lemma set_to_map_simp :
assumes inj_on_fst: "inj_on fst S"
shows "(set_to_map S k = Some v) \<longleftrightarrow> (k, v) \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (set_to_map S k = Some v) = ((k, v) \<in> S)
[PROOF STEP]
proof (cases "\<exists>v. (k, v) \<in> S")
[PROOF STATE]
proof (state)... | {"llama_tokens": 2006, "file": "Automatic_Refinement_Lib_Misc", "length": 20} |
"""
test_util_misc.py
Author: Jordan Mirocha
Affiliation: McGill
Created on: Tue 24 Mar 2020 21:31:12 EDT
Description:
"""
import ares
import numpy as np
def test():
"""
Run through miscellaneous functions and make sure they run to completion
for a variety of cases.
"""
fake_sys_argv = ['scr... | {"hexsha": "8ee874e6b56e73195e7142069a534c4e3dd38bc7", "size": 1144, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_util_misc.py", "max_stars_repo_name": "eklem1/ares", "max_stars_repo_head_hexsha": "df39056065f0493e3c922fb50ced2dc6d1bc79a2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# Project: http://cloudedbats.org, https://github.com/cloudedbats
# Copyright (c) 2021-present Arnold Andreasson
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import asyncio
import logging
import numpy
import alsaaudio
class SoundCapture:
... | {"hexsha": "c1c083c20bd00c96c703883607922564ceb5492f", "size": 5469, "ext": "py", "lang": "Python", "max_stars_repo_path": "pathfinder/sound_capture.py", "max_stars_repo_name": "cloudedbats/cloudedbats_pathfinder", "max_stars_repo_head_hexsha": "c28ec8df0674e4e9bdf6d60a2ee658ae6615d398", "max_stars_repo_licenses": ["MI... |
#ifndef pcw_HocrPageParser_hpp__
#define pcw_HocrPageParser_hpp__
#include <boost/filesystem/path.hpp>
#include <memory>
#include "pugixml.hpp"
#include "PageParser.hpp"
#include "Xml.hpp"
namespace pcw {
class Box;
class ParserPage;
class XmlParserPage;
using ParserPagePtr = std::shared_ptr<ParserPage>;
using X... | {"hexsha": "a5a0eced45260eb004f42d7561495c81477bc0fa", "size": 951, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "rest/src/parser/HocrPageParser.hpp", "max_stars_repo_name": "cisocrgroup/pocoweb", "max_stars_repo_head_hexsha": "93546d026321744602f6ee90fd82503da56da3b7", "max_stars_repo_licenses": ["Apache-2.0"],... |
************************************
* Friction and mobility *
* for a hard-sphere configuration *
* Module RIGID *
* *
* K. Hinsen *
* Last revision: June 16, 1994 *
************************************
* Calculate connection... | {"hexsha": "1f50121f9ecd2af6731c1d90bbcfeb4860d85502", "size": 5057, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "hydrolib/rigid_dp.f", "max_stars_repo_name": "khinsen/HYDROLIB", "max_stars_repo_head_hexsha": "c0e7834a17c7046a6e4c0a27b980aaf5919aecd5", "max_stars_repo_licenses": ["BSD-3-Clause-Clear"], "max_s... |
import ggg
t : Int
t = yyy
| {"hexsha": "486aa1e35123da7398df5c0ee5fabb173e96d694", "size": 28, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "tests/idris2/perror008/Issue1224b.idr", "max_stars_repo_name": "ska80/idris-jvm", "max_stars_repo_head_hexsha": "66223d026d034578876b325e9fcd95874faa6052", "max_stars_repo_licenses": ["BSD-3-Clause"... |
#---------------------------------------------------------------------------
#
# BinaryStrings.py: a module to manipulate binary strings as integers
#
# by Lidia Yamamoto, Belgium, July 2013
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Copyright (C) 2015 Lidia A. R. Yamamoto
# ... | {"hexsha": "ab0e47f81102dae07e272d2c9923898775c42ffa", "size": 4897, "ext": "py", "lang": "Python", "max_stars_repo_path": "frameworks/pycellchem-2.0/src/artchem/BinaryStrings.py", "max_stars_repo_name": "danielrcardenas/ac-course-2017", "max_stars_repo_head_hexsha": "515512f27b5fd2ff8693eba1b3d8050b1580ec93", "max_sta... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | {"hexsha": "e0c075f9e56cf677f3976990385c5a60bea5f609", "size": 3547, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow/python/kernel_tests/cholesky_op_test.py", "max_stars_repo_name": "jylinman/tensorflow", "max_stars_repo_head_hexsha": "5248d111c3aeaf9f560cd77bff0f183f38e31e0b", "max_stars_repo_license... |
import pytest
import numpy as np
from keras.utils.test_utils import layer_test
from keras import layers
def test_flatten():
def test_4d():
np_inp_channels_last = np.arange(24, dtype='float32').reshape((1, 4, 3, 2))
np_output_cl = layer_test(layers.Flatten,
kwar... | {"hexsha": "51ba0f7ac9df9e3b01107547afeb1950308cdb54", "size": 2555, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/587/test_flattening.py", "max_stars_repo_name": "CSUN-COMP587-F18/keras", "max_stars_repo_head_hexsha": "5beed1cae876f570f92ee49b532aef2f97176bb2", "max_stars_repo_licenses": ["MIT"], "max_s... |
#!pip install grpcio==1.24.3
#!pip install tensorflow==2.2.0
import tensorflow as tf
if not tf.__version__ == '2.2.0':
print(tf.__version__)
raise ValueError('please upgrade to TensorFlow 2.2.0, or restart your Kernel (Kernel->Restart & Clear Output)')
tf.executing_eagerly()
from tensorflow.python.framework.... | {"hexsha": "7847a78cfca08fa09519856970481771f5dceab4", "size": 1394, "ext": "py", "lang": "Python", "max_stars_repo_path": "tf_eager.py", "max_stars_repo_name": "indervirbanipal/building-deep-learning-models-with-tensorflow", "max_stars_repo_head_hexsha": "6317f5d96bfe4e88f3c357c43a20d86a87a4a35e", "max_stars_repo_lice... |
#' State-Dependent Memory-Less Adaptive Transition Kernel
#'
#' @param x Current state
#' @param f Objective function
#' @param gr (optional) Gradient of the objective function.
#' @param rz Random number function.
#' @param dz Fensity function of `z`.
#' @param rz.args List of parameters passed to `rz`.
#' @param ..... | {"hexsha": "1510332a75d2d459a00d31a1c69c265fe4ceae2e", "size": 1585, "ext": "r", "lang": "R", "max_stars_repo_path": "R/kernel_sdml.r", "max_stars_repo_name": "arokem/fmcmc", "max_stars_repo_head_hexsha": "2b897e6978d1b23107d3e88d39abb68f4ad3ab97", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_re... |
from openchem.models.SiameseModel import SiameseModel
from openchem.modules.embeddings.basic_embedding import Embedding
from openchem.modules.encoders.rnn_encoder import RNNEncoder
from openchem.modules.encoders.gcn_encoder import GraphCNNEncoder
from openchem.modules.mlp.openchem_mlp import OpenChemMLP, OpenChemML... | {"hexsha": "4151452cb58e0c1ec78425027b7a820b3da9092d", "size": 4445, "ext": "py", "lang": "Python", "max_stars_repo_path": "example_configs/siamese_reactions.py", "max_stars_repo_name": "jmhayesesq/Open-Chem", "max_stars_repo_head_hexsha": "e612d5cd471079c64e61ceda946c3dc7cf095bd8", "max_stars_repo_licenses": ["MIT"], ... |
from malaya_speech.path import (
PATH_TTS_TACOTRON2,
S3_PATH_TTS_TACOTRON2,
PATH_TTS_FASTSPEECH2,
S3_PATH_TTS_FASTSPEECH2,
PATH_TTS_FASTPITCH,
S3_PATH_TTS_FASTPITCH,
PATH_TTS_GLOWTTS,
S3_PATH_TTS_GLOWTTS,
)
from malaya_speech.utils.text import (
convert_to_ascii,
collapse_whitesp... | {"hexsha": "a844f88e2b6b7da10f8540ea2dc6ebe1a95db030", "size": 12958, "ext": "py", "lang": "Python", "max_stars_repo_path": "malaya_speech/tts.py", "max_stars_repo_name": "ishine/malaya-speech", "max_stars_repo_head_hexsha": "fd34afc7107af1656dff4b3201fa51dda54fde18", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# -*- coding: utf-8 -*-
from abc import ABC, abstractmethod
import numpy as np
class Border(ABC):
def __init__(self, length, origin=np.zeros((2, 1))):
"""Build a new border.
Args:
length (numpy.ndarray): The vector of length.
origin (numpy.ndarray): The center position of... | {"hexsha": "607c7b68979c44d109cd200a4ab6e9f4dda5ccbf", "size": 1056, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sim/borders/border.py", "max_stars_repo_name": "Bacmel/Boids-Boids-Boids", "max_stars_repo_head_hexsha": "f66954359373b34c2a493ed025773306a280c701", "max_stars_repo_licenses": ["MIT"], "max_st... |
'''
code_snippet_poisson_busiest30min.py
This snippet is the code we used to compute the arrival rate of potentially-race-relevant
messages for each 30-minute sessions of the trading day. It produces the statistics for the
busiest 30 minutes Poisson exercise (Table 4.5). The code is specific to the LSE settings
and... | {"hexsha": "6ac70ec774bb88d24fc98024db980dcb8e0697f3", "size": 6986, "ext": "py", "lang": "Python", "max_stars_repo_path": "PythonCode/MiscABOCodeSnippets/code_snippet_poisson_busiest30min.py", "max_stars_repo_name": "ericbudish/HFT-Races", "max_stars_repo_head_hexsha": "fe9ffc2da98b529e43e25800695aad698b46b10a", "max_... |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* OpenAPI spec version: 1.1.1
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include ... | {"hexsha": "2c22c032d1156233a9660329339d8de520be668a", "size": 1753, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "clients/cpp-restbed-server/generated/model/StringParameterValue.cpp", "max_stars_repo_name": "PankTrue/swaggy-jenkins", "max_stars_repo_head_hexsha": "aca35a7cca6e1fcc08bd399e05148942ac2f514b", "max... |
# 3. Import libraries and modules
import numpy as np
np.random.seed(123) # for reproducibility
import tensorflow as tf
tf.set_random_seed(123)
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.utils import n... | {"hexsha": "182395286aeab2fb00504e615658941852b583c0", "size": 1704, "ext": "py", "lang": "Python", "max_stars_repo_path": "tf-learn/example-4-Kera/example4-cnn.py", "max_stars_repo_name": "liufuyang/kaggle-youtube-8m", "max_stars_repo_head_hexsha": "1cfbbf92ec9b5ead791f98f7a09463ee165a8120", "max_stars_repo_licenses":... |
import numpy as np
import itertools
import os
from utils import close_pair_utils, parallel_utils, BSMC_utils
import config
def compute_pileup_for_clusters(cluster_dict, get_run_start_end, genome_len, thresholds):
"""
General function for computing pileup curves; close genomes will be clustered according to cl... | {"hexsha": "a4311582f33c1f994b0437f8726f3e2d84558405", "size": 5843, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/pileup_utils.py", "max_stars_repo_name": "zhiru-liu/microbiome_evolution", "max_stars_repo_head_hexsha": "5a08fbf41357d845236e3ff46c31315929d2b649", "max_stars_repo_licenses": ["BSD-2-Clause... |
[STATEMENT]
lemma equivI[intro?]: "\<lbrakk>
\<And>s t \<pi>. \<pi>:(c,s) \<Rightarrow> t \<Longrightarrow> \<pi>:(c',s) \<Rightarrow> t;
\<And>s t \<pi>. \<pi>:(c',s) \<Rightarrow> t \<Longrightarrow> \<pi>:(c,s) \<Rightarrow> t\<rbrakk>
\<Longrightarrow> c \<sim> c'"
[PROOF STATE]
proof (prove)
goal (1 subgoa... | {"llama_tokens": 245, "file": "IMP2_basic_Semantics", "length": 1} |
import numpy as np
import SimpleITK as sitk
import six
from radiomics import featureextractor
def read_dcm_series(dcm_dir):
"""
Args:
dcm_dir: Str. Path to dicom series directory
Returns:
sitk_image: SimpleITK object of 3D CT volume.
"""
reader = sitk.ImageSeriesReader()
series_... | {"hexsha": "61d18475df1280776827a98c6e9223cc26565dd5", "size": 2258, "ext": "py", "lang": "Python", "max_stars_repo_path": "ITHscore/utils.py", "max_stars_repo_name": "LiJiaqi96/ITHscore", "max_stars_repo_head_hexsha": "d7281a427305c2839f089b1ea9935fd1b2aeb641", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
'''
computing the combinations value
'''
from scipy.special import comb
def helper():
'''
helping in calculating the probability
'''
res = 0
for i in range(26, 41):
res += comb(50, i) * (0.4 ** i) * (0.6 ** (50 - i))
return res
print(helper())
| {"hexsha": "01875b1c010114fc4579c58fa23b5244b226e1b7", "size": 280, "ext": "py", "lang": "Python", "max_stars_repo_path": "Machine Learning Basic Principles/quiz1/1.py", "max_stars_repo_name": "JayWu7/Machine-Learning-Courses-Study-Record", "max_stars_repo_head_hexsha": "7586c3429514bc21c7cfe42f85ca8c0fcf8f072b", "max_... |
"""Collect information from the NY State Board of Elections website (http://www.elections.ny.gov/2016ElectionResults.html) and publish in a way more sensible format.
Code is given for 2016 and 2014 below, but could easily be extended. Note the NY State Board of Elections uses inconsistent names on their website, and ... | {"hexsha": "79f52d778f4e57f218fd05fe195e6b1074423615", "size": 10988, "ext": "py", "lang": "Python", "max_stars_repo_path": "Tools/ElectionData.py", "max_stars_repo_name": "UnitedThruAction/Data", "max_stars_repo_head_hexsha": "c589df73eb1c5f3a466357f863d63f0f8e209105", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
using BinDeps
@BinDeps.setup
libbnet = library_dependency("libbnet")
libdir = BinDeps.libdir(libbnet)
srcdir = joinpath(BinDeps.srcdir(libbnet), "binary_networks")
provides(Sources, URI("https://raw.githubusercontent.com/afternone/CommunityDetection.jl/master/deps/binary_networks.tar.gz"), libbnet)
provides(B... | {"hexsha": "2c94f8082a73d3f495992466ca8d799700496db0", "size": 722, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "deps/build.jl", "max_stars_repo_name": "afternone/LFR.jl", "max_stars_repo_head_hexsha": "74fa3d8de8fb9da4c3be884789522aedbacd319b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_st... |
import cv2
import numpy as np
from easygraphics import *
import qimage2ndarray
def main():
init_graph(800,600)
set_render_mode(RenderMode.RENDER_MANUAL)
set_background_color("white")
print("init_camera")
success, frame = cameraCapture.read()
print("init_camera_ok")
while is_run() and succes... | {"hexsha": "471ee2f00d2193c21489c81e97fd3baf4de0f397", "size": 848, "ext": "py", "lang": "Python", "max_stars_repo_path": "References/opencv/chap_02/camera_easygraphics.py", "max_stars_repo_name": "royqh1979/python_libs_usage", "max_stars_repo_head_hexsha": "57546d5648d8a6b7aca7d7ff9481aa7cd4d8f511", "max_stars_repo_li... |
# r^2 based on the latest measured y-values
import numpy as np
# Calculate r^2 based on the latest measured y-values
# measured_y and estimated_y must be vectors.
def r2lm(measured_y, estimated_y):
measured_y = np.array(measured_y).flatten()
estimated_y = np.array(estimated_y).flatten()
return fl... | {"hexsha": "26d451467747756127fb560030ec5fc36fac74e6", "size": 414, "ext": "py", "lang": "Python", "max_stars_repo_path": "r2lm.py", "max_stars_repo_name": "hkaneko1985/r2lm", "max_stars_repo_head_hexsha": "a04458c27a662ea11ba04433bbf9e675bbea330b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_r... |
import tensorflow as tf
import numpy as np
from tqdm import tqdm
from data import ablate_interactions
def compile_model(model, learning_rate=0.005):
optimizer = tf.keras.optimizers.Adam(learning_rate=learning_rate)
loss = tf.keras.losses.MeanSquaredError()
metrics = [tf.keras.metrics.MeanSquaredError()]
... | {"hexsha": "29b5703dd3d6934569b4e1de68fcd1bff3680423", "size": 3074, "ext": "py", "lang": "Python", "max_stars_repo_path": "benchmarking/remove_and_retrain/utils.py", "max_stars_repo_name": "Locust2520/path_explain", "max_stars_repo_head_hexsha": "45d1cd6690060c8c9a7b57f72bff3b7c66dbd815", "max_stars_repo_licenses": ["... |
"""
Adapted from: https://github.com/ChihebTrabelsi/deep_complex_networks/blob/master/musicnet/scripts/resample.py
Instructions:
wget https://homes.cs.washington.edu/~thickstn/media/musicnet.npz
python3 -u resample.py musicnet.npz musicnet_11khz.npz 44100 11000
"""
from __future__ import print_function
imp... | {"hexsha": "5a09e2bd8fcee5688b323cf964d71b4254125180", "size": 2172, "ext": "py", "lang": "Python", "max_stars_repo_path": "resample.py", "max_stars_repo_name": "chiuhans111/RSE", "max_stars_repo_head_hexsha": "152639e51b76120f1006bb64eb3689a054e01b92", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 40, "max_st... |
"""Test module for loss functions."""
from typing import Tuple
import numpy as np
import pytest
import pandas as pd
import tensorflow as tf
from .. import datasets
from ..keras import losses, models
from ..keras import layers as pypsps_layers
from .. import utils, inference
from ..keras import metrics
from pypress... | {"hexsha": "a4654647cd22678a663c53bbf9b5e1243814f1de", "size": 3066, "ext": "py", "lang": "Python", "max_stars_repo_path": "pypsps/tests/test_losses.py", "max_stars_repo_name": "gmgeorg/pypsps", "max_stars_repo_head_hexsha": "39fe4299772c569bd33b94d10ebc7f3883815756", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
def configuration(parent_package="", top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration("em", parent_package, top_path)
config.add_subpackage("fdem")
config.add_subpackage("tdem")
return config
| {"hexsha": "1e328e4c7c65a2ee23365091ae39e8425fb43deb", "size": 257, "ext": "py", "lang": "Python", "max_stars_repo_path": "geoana/em/setup.py", "max_stars_repo_name": "simpeg/geoana", "max_stars_repo_head_hexsha": "417e23a0a689da19112e5fd361f823a2abd8785a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 11, "ma... |
\section{Options, Part 2}
\subsection*{Binomial model: risk-neutral pricing}
Solve by replication $\delta$ shares of the stock, $b$ dollars of riskless bond
$\delta u S_0 + b (1+r) = C_u$ \\
$\delta d S_0 + b (1+r) = C_d$
Solution: $\delta = \frac{C_u-C_d}{(u-d)S_0}$ ,
$b=\frac{1}{1+r}\frac{uC_d-dC_u}{u-d}$ \\
Th... | {"hexsha": "20458728cbe20c398c63c87f5fa4a5970f2400c8", "size": 2712, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "15.415.2x/assets/week_13.tex", "max_stars_repo_name": "j053g/cheatsheets", "max_stars_repo_head_hexsha": "22f7a84879c04d44de40467ddcc0f6e551b812c7", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma finite_set_sum:
assumes "finite A" and "\<forall>i\<in>A. finite (B i)" shows "finite (\<Sum>i\<in>A. B i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. finite (sum B A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<forall>i\<in>A. finite (B i)
goal (1 subgoal):
... | {"llama_tokens": 172, "file": null, "length": 2} |
import datetime
import pandas as pd
import numpy as np
import os
from tqdm import tqdm
def interact_feature_engineer(samples, data, uid, iid, time_col):
date_ths = str(data[time_col].max())
last_3months = 90
last_3months_date = datetime.datetime.strptime(date_ths, '%Y-%m-%d %H:%M:%S') - datetime.timedelt... | {"hexsha": "c78482e197260f2ca36266aeb8fb5b77a461cc79", "size": 3765, "ext": "py", "lang": "Python", "max_stars_repo_path": "autox/autox_recommend/recall_and_rank/feature_engineer/interact_feature_engineer.py", "max_stars_repo_name": "OneToolsCollection/4paradigm-AutoX", "max_stars_repo_head_hexsha": "f8e838021354de17f5... |
#Import packages
import pandas as pd
import numpy as np
from SyntheticControlMethods import Synth, DiffSynth
#Import data
data = pd.read_csv("/Users/oscarengelbrektson/Documents/test_dataset.csv")
#Fit Synthetic Control
sc = Synth(data, "y", "ID", "Time", 10, "A", n_optim=30, pen=1)
sc.plot(["original", "pointwis... | {"hexsha": "7ab76e56914b160aac120f49d79521b79ee758bb", "size": 632, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/test_dataset.py", "max_stars_repo_name": "OscarEngelbrektson/SyntheticControl", "max_stars_repo_head_hexsha": "3f496b36ed46c4e5c1e08ce6e903013e6eeb29df", "max_stars_repo_licenses": ["Apach... |
/*!
* @author Shin'ichiro Nakaoka
* @author Hisashi Ikari
*/
#include <boost/python.hpp>
#include <boost/filesystem.hpp>
#include <cnoid/ExecutablePath>
#include <cnoid/FloatingNumberString>
#include <cnoid/FileUtil>
#include <cnoid/AbstractSeq>
#include <cnoid/MultiSeq>
#include <cnoid/MultiValueSeq>
#include <cnoi... | {"hexsha": "7878f66d602f7b1498a62d448d3acc923d6dcfd2", "size": 15249, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/Util/python/PyUtil.cpp", "max_stars_repo_name": "snozawa/choreonoid", "max_stars_repo_head_hexsha": "12ab42ccbf287d68216637e55ddae8412771c752", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
"""
TODO: npy_void
"""
from __future__ import absolute_import
import numpy
from .capi import sctypebits
scalar = dict(
c_char = dict(\
ctype = 'signed char',
init = ' = 0',
argument_format = 'b',
return_format = 'b',
argument_title = 'a python integer (converting to C signed char)',
return_tit... | {"hexsha": "150da86ef034e4faed2c5db74d15ca68d0973d29", "size": 17058, "ext": "py", "lang": "Python", "max_stars_repo_path": "extgen/type_rules.py", "max_stars_repo_name": "maedoc/inducer-f2py", "max_stars_repo_head_hexsha": "fce51e6603f7474632d452437dbb8b194d6c879d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
'''
Pedagogical example realization of seq2seq recurrent neural networks, using TensorFlow and TFLearn.
'''
from __future__ import division, print_function
import os
import sys
import tflearn
import argparse
import json
import numpy as np
import tensorflow as tf
from pattern import SequencePattern
#from tensorflow... | {"hexsha": "8aa11720bd00e1c37be4b550199ced1940f06552", "size": 30016, "ext": "py", "lang": "Python", "max_stars_repo_path": "tflearn_seq2seq.py", "max_stars_repo_name": "behnam-samadi/tflearn_seq2seq", "max_stars_repo_head_hexsha": "88517d2a9d27b9cf053b0e91346a2e27344e1ba9", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# The following import configures Matplotlib for 3D plotting.
from mpl_toolkits.mplot3d import Axes3D
from scipy.special import sph_harm, genlaguerre, factorial, lpmv
plt.rc('text', usetex=True)
a0 = 0.5292
points = 4... | {"hexsha": "18994a126cf727df65a14b7bc9737034fe5bacb0", "size": 4027, "ext": "py", "lang": "Python", "max_stars_repo_path": "mode2.py", "max_stars_repo_name": "ViniciusGiroto/hydrogen_orbitals", "max_stars_repo_head_hexsha": "354ce1cd04e4b981224b95eb3e1f57d8ddf02cc6", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
program test_blas
! use magma
use omp_lib
implicit none
INTEGER,PARAMETER::Ns(3)=(/5000,10000,15000/)
INTEGER,PARAMETER::M=1000
COMPLEX,ALLOCATABLE :: A(:,:),B(:,:),z(:,:)
REAL,ALLOCATABLE :: R(:,:,:),eig(:)
COMPLEX,ALLOCATABLE :: WORK(:)
REAL,ALLOCATABLE ::rwork(:)
INTEGER,ALLOCATABLE ::iwork(... | {"hexsha": "bc36e6649a001e01c122b0d0fcd8cecbbd69cb03", "size": 1351, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/small-testcodes/mkl_performance.f90", "max_stars_repo_name": "MRedies/FLEUR", "max_stars_repo_head_hexsha": "84234831c55459a7539e78600e764ff4ca2ec4b6", "max_stars_repo_licenses": ["MIT"], ... |
from keras import Sequential
from keras.layers import Dense
import numpy as np
from ABC.Agents import Agent, AgentFactory
class NeuralAgent(Agent):
"""
Simple dense neural agent.
"""
def __init__(self, size_list, activation="tanh"):
""""The shape of the layers are one dimensional and taken as ... | {"hexsha": "e5b2a19a9e87146293dca42fe1df0fbeb182b172", "size": 2415, "ext": "py", "lang": "Python", "max_stars_repo_path": "Objects/Agents/KerasAgent.py", "max_stars_repo_name": "MessireToaster/CoEvolution", "max_stars_repo_head_hexsha": "965050f0374bbe6f6d33b371c582a5485bd22410", "max_stars_repo_licenses": ["Apache-2.... |
import numpy as np
from tqdm import tqdm
from keras_cv_attention_models.imagenet import data
def eval(model, data_name="imagenet2012", input_shape=None, batch_size=64, central_fraction=1.0, mode='tf'):
input_shape = model.input_shape[1:-1] if input_shape is None else input_shape
_, test_dataset, _, _, _ = data... | {"hexsha": "f397dbd468fe37c2265b771e458ae50e51374877", "size": 1197, "ext": "py", "lang": "Python", "max_stars_repo_path": "keras_cv_attention_models/imagenet/eval.py", "max_stars_repo_name": "awsaf49/keras_cv_attention_models", "max_stars_repo_head_hexsha": "242aaf02fd46f68d57f710b9e805afe96e3067e5", "max_stars_repo_l... |
import argparse
import numpy as np
import open3d as o3d
parser = argparse.ArgumentParser()
parser.add_argument('--file', type=str, default='../carla_results/auto_pilot_v3_42/eval_routes_06_12_23_30_25/lidar_360/0000.npy', help='npy point cloud')
def main():
pcd_npy = np.load(args.file)
pcd = o3d.geom... | {"hexsha": "7c7d992e1e74f12b9e45686331dc8daf91c0d637", "size": 570, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/point_cloud_vis.py", "max_stars_repo_name": "sisl/neat", "max_stars_repo_head_hexsha": "42758d910f453686366eddfd1aed440e34c94828", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 183, ... |
using IterativeSolvers, KrylovKit, Arpack
# In this file, we regroud a way to provide eigen solvers
abstract type AbstractEigenSolver end
abstract type AbstractMFEigenSolver <: AbstractEigenSolver end
abstract type AbstractFloquetSolver <: AbstractEigenSolver end
# the following function returns the n-th eigenvectors... | {"hexsha": "e382bb8239c0de97304e34ea911f2fc78eb7d52a", "size": 3805, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/EigSolver.jl", "max_stars_repo_name": "oxinabox/PseudoArcLengthContinuation.jl", "max_stars_repo_head_hexsha": "98bae695df0e7c0521680dae7d786843078e730b", "max_stars_repo_licenses": ["MIT"], "m... |
#include <StdInc.h>
#include "ConvertServiceImpl.h"
#include "SparrowFrontend/Helpers/SprTypeTraits.h"
#include "SparrowFrontend/Helpers/DeclsHelpers.h"
#include "SparrowFrontend/Helpers/StdDef.h"
#include "SparrowFrontend/NodeCommonsCpp.h"
#include "SparrowFrontend/SparrowFrontendTypes.hpp"
#include "SparrowFrontend/N... | {"hexsha": "2b2041f748aba367ef4a82349b737e2ffbac7899", "size": 24704, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/SparrowFrontend/Services/Convert/ConvertServiceImpl.cpp", "max_stars_repo_name": "Sparrow-lang/sparrow", "max_stars_repo_head_hexsha": "b1cf41f79b52665d8208f8fb5a7539d764286daa", "max_stars_rep... |
# Copyright 2022 Reuben Owen-Williams
# 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 o... | {"hexsha": "30feb68a9932f2cecc93dc474ca651626461fede", "size": 6298, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data/dataPreprocess.py", "max_stars_repo_name": "ReubenGitHub/MachineLearning-Vehicle-Emissions", "max_stars_repo_head_hexsha": "5a6d5366d15cb918de5464c48e0067efceda4149", "max_stars_repo_lice... |
from __future__ import print_function, division
from .vector import Vector, _check_vector
from .frame import _check_frame
__all__ = ['Point']
class Point(object):
"""This object represents a point in a dynamic system.
It stores the: position, velocity, and acceleration of a point.
The position is a vect... | {"hexsha": "d4e3cfcc90cc359a8288befb2bc96162f9bdb0ef", "size": 17502, "ext": "py", "lang": "Python", "max_stars_repo_path": "sympy/physics/vector/point.py", "max_stars_repo_name": "alexmalins/sympy", "max_stars_repo_head_hexsha": "6acf7eadb39677fa728ac6437339f4d90c33d961", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
!
! Note: This isn't intended to be a comprehensive PRNG test suite, but is
! merely intended to highlight any serious flaws in the coding rather than
! numerical design.
!
program random
use spral_random
implicit none
integer, parameter :: long = selected_int_kind(18)
integer, parameter :: wp = kind(0d0)
... | {"hexsha": "eb6d0617b147b16d1cae7813ace01b924c1a388a", "size": 5986, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/random.f90", "max_stars_repo_name": "mjacobse/spral", "max_stars_repo_head_hexsha": "9bf003b2cc199928ec18c967ce0e009d98790898", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun... |
# Python code adapted from authors: https://arxiv.org/abs/1611.05666
from __future__ import print_function, division
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.autograd import Variable
import numpy as np
import torchvision
from torchv... | {"hexsha": "4e220d452d14eceb2947f56bdfaf8bbd5bd26307", "size": 12569, "ext": "py", "lang": "Python", "max_stars_repo_path": "reid_verif/train.py", "max_stars_repo_name": "hthieu166/cs547-final-proj-image-ranking", "max_stars_repo_head_hexsha": "81c6d3ebccae77df1d2e8421927a1a2684f80c98", "max_stars_repo_licenses": ["MIT... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
import scipy.signal
from keras.models import Sequential
from keras.layers.convolutional import Convolution1D
from keras.layers import Input, Lambda, merge, Permute, Reshape
from keras.models import Model
from keras import backend as K
d... | {"hexsha": "66a3b27e36f12e2b67fab1d998ba3b2428945e56", "size": 8274, "ext": "py", "lang": "Python", "max_stars_repo_path": "stft.py", "max_stars_repo_name": "keunwoochoi/keras_STFT_layer", "max_stars_repo_head_hexsha": "7d99459651d78c182578b8aec679061f6ce3780d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 65... |
import logging
import numpy as np
from causalml.propensity import compute_propensity_score
from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier
from sklearn.model_selection import cross_val_predict, KFold
from sklearn.tree import DecisionTreeClassifier
logger = logging.getLogger("causal... | {"hexsha": "004b5eaaa5a00a12c35f82a44290ac1782ef2418", "size": 6002, "ext": "py", "lang": "Python", "max_stars_repo_path": "causalml/optimize/policylearner.py", "max_stars_repo_name": "rainfireliang/causalml", "max_stars_repo_head_hexsha": "d58024d8de4ab6136c5519949b58a22dd885df29", "max_stars_repo_licenses": ["Apache-... |
"""Helper methods for model interpretation."""
import numpy
from gewittergefahr.gg_utils import radar_utils
from gewittergefahr.gg_utils import error_checking
from gewittergefahr.deep_learning import cnn
from gewittergefahr.deep_learning import input_examples
from gewittergefahr.deep_learning import deep_learning_util... | {"hexsha": "4612ce90e544412e13ada97192f31e8cfbdcf4fb", "size": 11293, "ext": "py", "lang": "Python", "max_stars_repo_path": "gewittergefahr/deep_learning/model_interpretation.py", "max_stars_repo_name": "dopplerchase/GewitterGefahr", "max_stars_repo_head_hexsha": "4415b08dd64f37eba5b1b9e8cc5aa9af24f96593", "max_stars_r... |
/*
Copyright 2014 Rogier van Dalen.
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 writing, softwar... | {"hexsha": "18284a9207dfe10e1accfa50017fda776d555aba", "size": 11968, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/utility/test-storage-example.cpp", "max_stars_repo_name": "rogiervd/utility", "max_stars_repo_head_hexsha": "10a3f45ee5bdedd4bbe6fca973b5bb44e142c80f", "max_stars_repo_licenses": ["Apache-2.0"... |
!< Jiang-Shu and Gerolymos-Senechal-Vallet weights.
module wenoof_weights_int_js
!< Jiang-Shu and Gerolymos-Senechal-Vallet weights.
!<
!< @note The provided WENO weights implements the weights defined in *Efficient Implementation of Weighted ENO
!< Schemes*, Guang-Shan Jiang, Chi-Wang Shu, JCP, 1996, vol. 126, pp. 202... | {"hexsha": "e1e5aac0a24cea2136505dc08f1deeba89ed2554", "size": 9957, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/lib/concrete_objects/wenoof_weights_int_js.f90", "max_stars_repo_name": "Fortran-FOSS-Programmers/WenOOF", "max_stars_repo_head_hexsha": "7f53d1b7e6e026407c8e48ef2f8a3755d90f3ae2", "max_star... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
try:
from numpy import arccos
from numpy import array
from numpy import cross
from numpy import int64
from numpy import isnan
from numpy import mean
from num... | {"hexsha": "b1449a5a0653785e35579000955d6c7fb47f858b", "size": 16579, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/compas/numerical/algorithms/drx_numpy.py", "max_stars_repo_name": "gonzalocasas/compas", "max_stars_repo_head_hexsha": "2fabc7e5c966a02d823fa453564151e1a1e7e3c6", "max_stars_repo_licenses": [... |
[STATEMENT]
lemma has_white_path_to_induct[consumes 1, case_names refl step, induct set: has_white_path_to]:
assumes "(x has_white_path_to y) s"
assumes "\<And>x. P x x"
assumes "\<And>x y z. \<lbrakk>(x has_white_path_to y) s; P x y; (y points_to z) s; white z s\<rbrakk> \<Longrightarrow> P x z"
shows "P x y"
... | {"llama_tokens": 466, "file": "ConcurrentGC_Global_Invariants_Lemmas", "length": 3} |
# The following commented code was an attempt (along with setting the
# PYTHONHASHSEED environment variable to 0 in the PyDev run configuration
# for this script) to make classifier training reproducible, but it didn't
# work.
#
# import random
# random.seed(1)
#
# import numpy as np
# np.random.seed(1)
#
# import... | {"hexsha": "1ad98dd91e2715b5f16dedec9925950c6a184419", "size": 21652, "ext": "py", "lang": "Python", "max_stars_repo_path": "vesper/mpg_ranch/nfc_coarse_classifier_2_1/train_classifier.py", "max_stars_repo_name": "HaroldMills/NFC", "max_stars_repo_head_hexsha": "356b2234dc3c7d180282a597fa1e039ae79e03c6", "max_stars_rep... |
import torch
from torch.utils.data import Dataset
import pandas as pd
import os
import numpy as np
from torch.utils.data.dataloader import default_collate
from util import tokenize
class HowToVQA_Dataset(Dataset):
def __init__(
self,
csv_path,
caption,
features_path,
... | {"hexsha": "ecbd42fb6da25b37db0799ed6aa145b8d9f61e23", "size": 6224, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/howtovqa_loader.py", "max_stars_repo_name": "Tiamat-Tech/just-ask", "max_stars_repo_head_hexsha": "80725161e12ad0682b4c2091f61a5889a335ba21", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
#!/usr/bin/env python3
import argparse
import hashlib
import numpy as np
import os
import pandas as pd
import pkg_resources
import pyarrow as pa
import re
import sys
import traceback
from datetime import datetime, timedelta, timezone
from pyarrow import csv, feather
from eccodes import *
def getHash(out_file):
md5... | {"hexsha": "dc23c67861dedd785f83f8d624383f7c80641956", "size": 25822, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/meteorological_preprocessor/met_pre_batch_to_cache.py", "max_stars_repo_name": "public-tatsuya-noyori/meteorological_preprocessor", "max_stars_repo_head_hexsha": "fc90bbb5c63b917b6d3ec6fb69a3... |
#!/usr/bin/env python
'''
Data structure utils module for generic use. Has functions
that would be really nice to add to string, dictionary or
DataFrame types. Could extend some of these to add capability.
Some of the functions need some heavy testing and debug.
'''
import re
import pandas as pd
import numpy as np
im... | {"hexsha": "b78df6f2c1e1f0f1911d7913e006c13f23092ac0", "size": 15006, "ext": "py", "lang": "Python", "max_stars_repo_path": "mhut/datautils.py", "max_stars_repo_name": "mhassan1900/MHut", "max_stars_repo_head_hexsha": "bec1cb0573fdd4f0404aec9ecd116026d748d977", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
"""
Creating a simulation: Simulation class
=======================================
Both initialization and running the simulation is done by interacting with an instance
of :py:class:`polychrom.simulation.Simulation` class.
Overall parameters
------------------
Overall technical parameters of a simulation are ge... | {"hexsha": "71868f06ea91650bad687801146c985aba6925a3", "size": 34524, "ext": "py", "lang": "Python", "max_stars_repo_path": "polychrom/simulation.py", "max_stars_repo_name": "nchowder/polychrom", "max_stars_repo_head_hexsha": "cfd1344d9d59f84cc237b24a3b2ab2241e219214", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import numpy as np
import matplotlib.pyplot as plt
def tmp_calc_ld(speciome, plot = False):
#TODO: 02-01-20:
# - debug what I wrote below to keep only seg sites
# - aggain change scape size in the sweep params file to 20,20
# - try this out and see if it fixes my issues
# - if so,... | {"hexsha": "8976315fc4497e8828e2e83113e6f0a6a445fec3", "size": 3632, "ext": "py", "lang": "Python", "max_stars_repo_path": "scratch/tmp_calc_ld_2.py", "max_stars_repo_name": "AnushaPB/geonomics-1", "max_stars_repo_head_hexsha": "deee0c377e81f509463eaf6f9d0b2f0809f2ddc3", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.