text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import numpy as np
def minibatch(data, labels, size = 100):
'''Return a tuple of of size=size from a predictor data
and labels data '''
indexes = np.arange(0, len(labels))
np.random.shuffle(indexes)
batch_indexes = indexes[:size]
X = [data[i] for i in batch_indexes]
Y = [labels[i] for i in batch_inde... | {"hexsha": "be8f6b316d953703b528d72a31c193efa8e96314", "size": 369, "ext": "py", "lang": "Python", "max_stars_repo_path": "mymnist/get_minibatch.py", "max_stars_repo_name": "RajanSingh-Projects/Tensorflow_CNN", "max_stars_repo_head_hexsha": "7e1fd3b517970a86085c46384c93b2d8ab4f3f94", "max_stars_repo_licenses": ["Apache... |
import numpy as np
from numpy import sin, cos, einsum
from scipy.special import j0, j1, jn_zeros
from rssympim.constants import constants as consts
# Commented out until MPI implementation is ready
from mpi4py import MPI as mpi
# # #
#
# A Note On Indexing Conventions
#
# # #
#
# This class relies heavily on the einsu... | {"hexsha": "97613bdf076a11c14ddd57ec8caac4c21c312d6b", "size": 13860, "ext": "py", "lang": "Python", "max_stars_repo_path": "rssympim/sympim_rz/data/field_data.py", "max_stars_repo_name": "radiasoft/rssympic", "max_stars_repo_head_hexsha": "14b119267686c64e2d0fcd3be19c365b8d486e22", "max_stars_repo_licenses": ["Apache-... |
[STATEMENT]
lemma repr_bossX :
assumes A: "\<tau> \<Turnstile> \<delta>(x .boss)"
shows "\<tau> \<Turnstile> ((Person .allInstances()) ->includes\<^sub>S\<^sub>e\<^sub>t(x .boss))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<tau> \<Turnstile> Person .allInstances()->includes\<^sub>S\<^sub>e\<^sub>t(x.boss)
[PR... | {"llama_tokens": 141, "file": "Featherweight_OCL_examples_Employee_Model_Analysis_Analysis_UML", "length": 1} |
""" Utility code for drawing arms and arm configuration spaces.
Author: Nathan Sprague
"""
import shapely
import shapely.geometry
from shapely.geometry import Point, MultiPoint, MultiPolygon
import shapely.affinity
import shapely.ops
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplo... | {"hexsha": "880ceeb6c4b9e2ffff8c83d0185421ad8908c876", "size": 10028, "ext": "py", "lang": "Python", "max_stars_repo_path": "py_arm/arm_plotting.py", "max_stars_repo_name": "JMU-ROBOTICS-VIVA/py_arm", "max_stars_repo_head_hexsha": "21f641a7e37fce7299685f57879fe7f402e3a9c6", "max_stars_repo_licenses": ["MIT"], "max_star... |
### FieldTuple types
# FieldTuple is a thin wrapper around a Tuple or NamedTuple holding some Fields
# and behaving like a Field itself
struct FieldTuple{FS<:Union{Tuple,NamedTuple},B,T} <: Field{B,T}
fs :: FS
function FieldTuple(fs::FS) where {FS<:Union{Tuple,NamedTuple}}
B = BasisProd{Tuple{map(bas... | {"hexsha": "9b8406239a5408cf0310bed4eeb2e70198a2dcd6", "size": 5808, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/field_tuples.jl", "max_stars_repo_name": "EthanAnderes/CMBLensing.jl", "max_stars_repo_head_hexsha": "d99f8f13710f03da589bf273edda6d219f352765", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 3 18:18:36 2018
@author: malopez
"""
import numpy as np
class KickGenerator():
def __init__(self, n_particles, baseKickIntensity):
self.n_particles = n_particles
self.baseKickIntensity = baseKickIntensity
# Time of last kick
self.t_la... | {"hexsha": "5ee99b4b753c7aabe8f882aba021d5c20fedd33e", "size": 1050, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/randomForce.py", "max_stars_repo_name": "Thefalas/disksMD", "max_stars_repo_head_hexsha": "1f3a0a1814baf1fd8905da2e88d2244de90d14ec", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
# ------------------------------------------------------------------------------------------------------
# Copyright (c) Leo Hanisch. All rights reserved.
# Licensed under the BSD 3-Clause License. See LICENSE.txt in the project root for license information.
# ---------------------------------------------------------... | {"hexsha": "7dd20253d476d6e8b6633de12ce45703772c4de2", "size": 3138, "ext": "py", "lang": "Python", "max_stars_repo_path": "swarmlib/aco4tsp/visualizer.py", "max_stars_repo_name": "nkoutsov/swarmlib", "max_stars_repo_head_hexsha": "fa70a5d9de50de5dacd5d499eba3b6bb72c39c05", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | {"hexsha": "1632a608b67664c02082faffb6185b40ab067ad1", "size": 33467, "ext": "py", "lang": "Python", "max_stars_repo_path": "framework/SupervisedLearning/MSR.py", "max_stars_repo_name": "FlanFlanagan/raven", "max_stars_repo_head_hexsha": "bd7fca18af94376a28e2144ba1da72c01c8d343c", "max_stars_repo_licenses": ["Apache-2.... |
# Implements the Max-Product Algorithm for MAP Inference
"""
maxproduct!(evidence,spn,query)
Approximates the maximum value of a configuration of `query` variables for given some `evidence`.
Returns the value achieved by the algorithm at the root node (which is not the value of the configuration in `evidence`)
... | {"hexsha": "2b2990d6973a26bf431a471bda1bd3941a47aa96", "size": 3108, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Inference/MAP/MaxProduct.jl", "max_stars_repo_name": "denismaua/SumProductNetworks.jl", "max_stars_repo_head_hexsha": "9a1280d5e58dc2539c6d3f9366f64a8862c9aa37", "max_stars_repo_licenses": ["MI... |
from bgmol.util import parse_quantity, yaml_load, yaml_dump
import io
import numpy as np
from simtk.openmm import unit
from simtk.openmm.app import *
from openmmtools.utils import is_quantity_close
def test_parse_quantity():
for str, res in [
("1 * nanometer", 1 * unit.nanometer)
]:
asser... | {"hexsha": "5486b5826f0e8ccfb483cf09c956d725382386ca", "size": 1200, "ext": "py", "lang": "Python", "max_stars_repo_path": "bgmol/tests/util/test_yml.py", "max_stars_repo_name": "drorlab/bgmol", "max_stars_repo_head_hexsha": "502854536820584a475fe388e55c2255d65723eb", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# Copyright 2020 Juan Luis Gamella Martin
# 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 copyright
# notice, this list of conditions and the following disclai... | {"hexsha": "a411cd34677603e7bc71dc277899e4c75632e2f7", "size": 3242, "ext": "py", "lang": "Python", "max_stars_repo_path": "utlvce/test/test_main.py", "max_stars_repo_name": "juangamella/ut-lvce", "max_stars_repo_head_hexsha": "44a47d2f921477e66f54d7c0de8c4166e6980502", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
#Program using Agatz et al. method to make a TSP-D using a TSP solution
#See "Optimization Approaches for the Traveling SalesmanProblem with Drone" - Niels AgatzPaul BoumanMarie Schmidt
#######################
#Constantes
#######################
include("tsp.jl")
#=
structure of a TSP-D solution :
tsp : TSP solutio... | {"hexsha": "f22260cfe32006a97bbf2714d558b9ca6473040a", "size": 2401, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "agatz.jl", "max_stars_repo_name": "Emmanuel-kun/TSPD", "max_stars_repo_head_hexsha": "c014971519097f7bdde0428f744a8a1b80edc2d2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
##############################################################################################################
## This file contains functions to calculate derivative of the product spherical harmonics and derivative
## of the product Wigner D-functions.
##
#############################################################... | {"hexsha": "c234cfb76c4fa66cc6b4192184442ba992da1509", "size": 13206, "ext": "py", "lang": "Python", "max_stars_repo_path": "gradient.py", "max_stars_repo_name": "bangunarya/boundwigner", "max_stars_repo_head_hexsha": "91a48a6db12de4da60688b1421e7a2e95539df3f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
SUBROUTINE TRIX (IDEGBR,IDEGCR,M,A,B,C,Y,TCOS,D,W)
C
C SUBROUTINE TO SOLVE A SYSTEM OF LINEAR EQUATIONS WHERE THE
C COEFFICIENT MATRIX IS A RATIONAL FUNCTION IN THE MATRIX GIVEN BY
C TRIDIAGONAL ( . . . , A(I), B(I), C(I), . . . ).
C
DIMENSION A(1) ,B(1) ,C(1) ,Y(1) ... | {"hexsha": "8b5d8982e0ca851fdca1e95918fbaec9e9af936a", "size": 1372, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/f2cl/packages/fishpack/trix.f", "max_stars_repo_name": "sbwhitecap/clocc-hg", "max_stars_repo_head_hexsha": "f6cf2591ceef8a3a80e04da9b414cdf60a25a90f", "max_stars_repo_licenses": ["MIT"], "max... |
[STATEMENT]
lemma preservation:
assumes typed: "\<turnstile> \<Gamma> { c } \<Gamma>'"
assumes eval: "\<langle>c, mds, mem\<rangle> \<leadsto> \<langle>c', mds', mem'\<rangle>"
shows "\<exists> \<Gamma>''. (\<turnstile> \<Gamma>'' { c' } \<Gamma>') \<and> (mds_consistent mds \<Gamma> \<longrightarrow> mds_consist... | {"llama_tokens": 70359, "file": "SIFUM_Type_Systems_TypeSystem", "length": 101} |
"""
Perform various validation tasks, like making ROC,
precision-recall, thresholding etc.
If you plan on using this implementation, please cite our work:
@INPROCEEDINGS{Grabowski2021IGARSS,
author={Grabowski, Bartosz and Ziaja, Maciej and Kawulok, Michal
and Nalepa, Jakub},
booktitle={IGARSS 2021 - 2021 IEEE Internat... | {"hexsha": "6467d2f41e4127121d446b5af8666628f54769ca", "size": 7603, "ext": "py", "lang": "Python", "max_stars_repo_path": "beetles/cloud_detection/validate.py", "max_stars_repo_name": "ESA-PhiLab/hypernet", "max_stars_repo_head_hexsha": "b33f7893d3dfcbbc2c10076fb61b2b1f1316402a", "max_stars_repo_licenses": ["MIT"], "m... |
# Copyright 2019 Xilinx Inc.
#
# 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, ... | {"hexsha": "654dc13ed86c4424e4bd8a89818df0976c019ecd", "size": 2798, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/decent_q/python/graphsurgeon/collapse_namespaces_test.py", "max_stars_repo_name": "hito0512/Vitis-AI", "max_stars_repo_head_hexsha":... |
import pydot
import networkx as nx
import pandas as pd
#Transition probabilities
df_Q = pd.read_csv('data/Q_matrix.csv', index_col=0)
#Possible states
states = ['entrance','drinks','dairy','fruit','spices','checkout']
# create a function that maps transition probability dataframe
# to markov edges and weights
def _... | {"hexsha": "a9967d39fec2960c356ebcfe18f4eeb2c418e044", "size": 1288, "ext": "py", "lang": "Python", "max_stars_repo_path": "make_markov_diagram.py", "max_stars_repo_name": "dendisuhubdy/Markov-chain-simulation", "max_stars_repo_head_hexsha": "417fcb2b0ea3e66034dcf9d9d78d66fc9c554e8c", "max_stars_repo_licenses": ["MIT"]... |
import pandas as pd
import numpy as np
df1 = pd.read_csv("../data/raw/recognition_by_generation.csv")
def load_and_process(url_or_path_to_csv_file):
df8 = ( pd.read_csv("../data/raw/time_series_90s.csv")
.rename(columns={'years_old_13': 'years_old_13(2003)', 'years_old_12': 'years_old_12(2002)','years_old... | {"hexsha": "09d30951e43d9aa7e2be85c1ddc0b76bcb34ae70", "size": 1512, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/project_functions3.py", "max_stars_repo_name": "data301-2021-winter1/project-group41-project", "max_stars_repo_head_hexsha": "bb042f15ed9ab7cf14316c4c490416124df688d1", "max_stars_repo_l... |
module STLC.Kovacs.PresheafRefinement where
open import STLC.Kovacs.Substitution public
open import STLC.Kovacs.Normalisation public
open import Category
--------------------------------------------------------------------------------
-- (Tyᴺ-idₑ)
idacc : ∀ {A Γ} → (a : Γ ⊩ A)
→ acc idₑ a ≡ a
idacc... | {"hexsha": "1e2c532eae2879425f07a0e4b1703d6863d2ff87", "size": 9287, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "src/STLC/Kovacs/PresheafRefinement.agda", "max_stars_repo_name": "mietek/coquand-kovacs", "max_stars_repo_head_hexsha": "bd626509948fbf8503ec2e31c1852e1ac6edcc79", "max_stars_repo_licenses": ["X11... |
import numpy as np
import logging
import time
import multiprocessing as mp
import cv2
from parameters import *
# ===================================
#
# ===================================
class FrameServer(mp.Process):
# Barebones initialization, pass shared data structures into the process and start it
de... | {"hexsha": "7cdefc5bb5cd583c47ebbc736261267f0024add4", "size": 20445, "ext": "py", "lang": "Python", "max_stars_repo_path": "backend/sonicam/imaging.py", "max_stars_repo_name": "Meskupie/Sonicam", "max_stars_repo_head_hexsha": "c2f12bd8739146d9ebdd9f322c4f401e80c58cf2", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
%\newpage
In this chapter, we will mainly consider two statistic models, namely
logistic regression for linearly separable sets,
and support vector machine (SVM).
These two linear models form the foundation of deep learning, since
the final fully connected output layer of a deep neural network is
often given by one of ... | {"hexsha": "4264f2c96ded85717645f3ed9c30a11c859627dd", "size": 12972, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "6DL/LinearModels.tex", "max_stars_repo_name": "liuzhengqi1996/math452", "max_stars_repo_head_hexsha": "635b6ce53cb792e316abf4f47396f2e4f0686815", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
'''The following is an example of a fully connected neural network
that uses stochastic forward passes at inference time on the MNIST dataset'''
from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
fr... | {"hexsha": "71dc46a7bb63c37d697779aca11c9ef55f67bf6b", "size": 4562, "ext": "py", "lang": "Python", "max_stars_repo_path": "Class02/robotic_arm_incomplete/simple_fcn/sfp_fcn.py", "max_stars_repo_name": "pedroperrusi/deep-learning-for-robotics", "max_stars_repo_head_hexsha": "12c1f8c24c5e0f30891d5f5db61482d463528ee6", "... |
// wrong type of main
void main(int argc)
{
return;
}
| {"hexsha": "763d8b8813d777e5ca630351a1a057097c0abed1", "size": 58, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "tests/examples/bad/bad103.jl", "max_stars_repo_name": "lukaszcz/javalette", "max_stars_repo_head_hexsha": "3ba79ca57d6332261bdbb5bea1e106451504b506", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import itertools
import numpy as np
class BiLSTMEncoder(nn.Module):
def __init__(self, device, hidden_size, input_size, num_layers, dropout=0.5, bidirectional=True):
super(BiLSTMEncoder, self).__init__()... | {"hexsha": "98ccf5f10dc619d8f4e9dfd922c0b79484b89133", "size": 1854, "ext": "py", "lang": "Python", "max_stars_repo_path": "training_ptr_gen/BiLSTM.py", "max_stars_repo_name": "SDBlackwood/pointer_summarizer", "max_stars_repo_head_hexsha": "b6785942ce069b7415887df98e28412f65ec7dd0", "max_stars_repo_licenses": ["Apache-... |
import os
from collections import OrderedDict
import numpy as np
from ConfigSpace.hyperparameters import NumericalHyperparameter, CategoricalHyperparameter, OrdinalHyperparameter, \
Constant
from pandas import DataFrame
from cave.analyzer.base_analyzer import BaseAnalyzer
from cave.utils.helpers import get_config... | {"hexsha": "7eded74169c3766918ffc348574ee4bb343f56a3", "size": 9871, "ext": "py", "lang": "Python", "max_stars_repo_path": "cave/analyzer/performance/overview_table.py", "max_stars_repo_name": "deslay1/CAVE", "max_stars_repo_head_hexsha": "e4b9abc3812034f49dddd27ffc17dbab39782a1c", "max_stars_repo_licenses": ["BSD-3-Cl... |
"""Methods for working with data and numpy arrays"""
import warnings
import numpy as np
def arr_sample(arr, rate):
"""Return an array linearly sampled from the input array at the given rate.
Examples
--------
* [1, 2, 3, 4] and rate 2 -> [1, 3]
* [1, 2, 3, 4] and rate 0.5 -> [1, 1, 2, 2, 3, 3,... | {"hexsha": "6a33838582a70fd99f5616be4f94cbc26c355df5", "size": 14574, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/gouda/data_methods.py", "max_stars_repo_name": "Mullans/GOUDA", "max_stars_repo_head_hexsha": "a0ba9b6198813661a6460ed4d1c049290ebb8d28", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
using Graphene
using Test
using DataFrames
using Images: Gray
using FixedPointNumbers
using HDF5: h5read
test_csv_data = import_csv("test_files/test_data_flower.csv")
@test isa(test_csv_data, DataFrame)
@test ncol(test_csv_data) == 2
@test isa(read_nnimage("test_files/test_nnimage_flower.jpeg"), Array{Gray{FixedPoint... | {"hexsha": "2b48a2be5e8f73f50d251aa15e80f1b5d1933689", "size": 916, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_fileio.jl", "max_stars_repo_name": "chenspc/Graphene.jl", "max_stars_repo_head_hexsha": "ca7213b75561a48054c9f70ffc330448f09c2f54", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
/************************************************************************
Copyright 2018 andrewpqc@mails.ccnu.edu.cn
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/licens... | {"hexsha": "44ad8e9c3806987b0d482e35601c53f902368928", "size": 12541, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/vogro/server/base.hpp", "max_stars_repo_name": "vogro-x/vogro", "max_stars_repo_head_hexsha": "76f2c89cd85509e9b989bfab54a36b4a48acf70e", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
/// @file
/// @copyright The code is licensed under the BSD License
/// <http://opensource.org/licenses/BSD-2-Clause>,
/// Copyright (c) 2013-2015 Alexandre Hamez.
/// @author Alexandre Hamez
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include "s... | {"hexsha": "92e9eeeddf17ea73c66a988e81c3362acc599c76", "size": 1015, "ext": "cc", "lang": "C++", "max_stars_repo_path": "support/parsers/parse_properties.cc", "max_stars_repo_name": "ahamez/pnmc", "max_stars_repo_head_hexsha": "cee5f2e01edc2130278ebfc13f0f859230d65680", "max_stars_repo_licenses": ["BSD-2-Clause"], "max... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import math
import time
import os
import sys
sys.path.append( '../util/')
sys.path.append( '../util_trec/')
from generators import *
from loader import *
from similar_... | {"hexsha": "16abf13cd8ab748aef96b649320f45f67c751ad5", "size": 8297, "ext": "py", "lang": "Python", "max_stars_repo_path": "siamese/train.py", "max_stars_repo_name": "prannayk/MSRASI17", "max_stars_repo_head_hexsha": "f7277d90ffdd062c1ba94391b7f82c621e619743", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
# -*- coding: UTF-8 -*-
"""
Split a big file using sed.
Find more details at cnblog:
www.cnblogs.com/freemao/p/7076127.html
"""
from pathlib import Path
import os.path as op
import sys
import pandas as pd
import numpy as np
from schnablelab.apps.base import ActionDispatcher, OptionParser, glob, iglob
from schnablelab... | {"hexsha": "5360a253a845c89cfa3f5b9241862cd73710d476", "size": 20802, "ext": "py", "lang": "Python", "max_stars_repo_path": "SNPcalling/Postprocess.py", "max_stars_repo_name": "phillnguyen/schnablelab", "max_stars_repo_head_hexsha": "2e7803ed82489880d79ac0c7bce39857de5e4547", "max_stars_repo_licenses": ["BSD-2-Clause"]... |
from tcnlib import *
from torch.utils.data import TensorDataset, DataLoader
import torch
from scipy.fft import fft, fftfreq
import torch.nn as nn
from torch.distributions import normal
import copy
from torch.autograd import Variable
from torch.autograd import grad as torch_grad
import torch.optim as optim
import numpy... | {"hexsha": "2bd39004fd1f80a1d70df7411b35f3fd2a1aa317", "size": 28550, "ext": "py", "lang": "Python", "max_stars_repo_path": "anomalyGAN/code/anomalyGAN.py", "max_stars_repo_name": "omi-uulm/anomaly-gan", "max_stars_repo_head_hexsha": "86a50cc467289175e4871289d0aa58f983aad1bb", "max_stars_repo_licenses": ["MIT"], "max_s... |
"""
mosaic(f, regions...; missingval, atol)
mosaic(f, regions; missingval, atol)
Combine `regions`s into a single raster.
# Arguments
- `f`: A reducing function (e.g. `mean`, `sum`, `first` or `last`) for values where `regions` overlap.
- `regions`: Iterable or splatted `Raster` or `RasterStack`.
# Keywords... | {"hexsha": "53bc41279277afa72f19f4fcc55bfa778665aaeb", "size": 8103, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/methods/mosaic.jl", "max_stars_repo_name": "jl-spatial/Rasters.jl", "max_stars_repo_head_hexsha": "c1823befd45bc10ac0a12d1e62597e8abb2acf5a", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import numpy as np
import cv2
import copy
class Circle(object):
def __init__(self, centre, radius):
self.x = centre[0]
self.y = centre[1]
self.centre = (self.x, self.y)
self.radius = radius
def __eq__(self, other):
return self.x == other.x and self.y == other.y and self... | {"hexsha": "b2a4c7d15487c0f8c61f316027bf5afb90103dc7", "size": 2881, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/circledetect.py", "max_stars_repo_name": "rbrunt/dobble-bot", "max_stars_repo_head_hexsha": "4330e2ca2bcd5f54ef5dc9fff40767960b1cf7bb", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#------------------------------------------------
# Module Name: Newton's Method
# Author: m_tsutsui
#------------------------------------------------
#Library_Import_______________
from numpy import*
import math, numpy as np
import matplotlib.pyplot as plt
#_____________________________
def Newton_m(Ite_C... | {"hexsha": "4b3969e78858f377a54eb02b6861f83572ba9863", "size": 1838, "ext": "py", "lang": "Python", "max_stars_repo_path": "playground/fir_sofa_ipynb/filters/test/Newton_Algorithm/af_Newtons_Method.py", "max_stars_repo_name": "tetsuzawa/go-research", "max_stars_repo_head_hexsha": "e76f820b92b58b35825a8cbb28452b7d351c0a... |
[STATEMENT]
lemma cutoff_branch':
assumes "anybranch T (\<lambda>b. red(ds@b))"
shows "anybranch (cutoff red ds T) (\<lambda>b. red(ds@b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. anybranch (cutoff red ds T) (\<lambda>p. red (ds @ p))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
anybr... | {"llama_tokens": 12420, "file": "Resolution_FOL_Tree", "length": 89} |
# -*- coding: future_fstrings -*-
from __future__ import division
'''
Detect one image by YOLOv3.
'''
import os
import sys
import datetime
import argparse
import cv2
import numpy as np
import matplotlib.pyplot as plt
if 1: # Set path
import sys
import os
ROOT = os.path.dirname(os.path.abspath(__file__)... | {"hexsha": "eeb8b57efdfa448a0f2aaf7f30e0b9a215c02d07", "size": 2792, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/detect_one_image.py", "max_stars_repo_name": "felixchenfy/ros_yolo_as_template_matching", "max_stars_repo_head_hexsha": "0d5c0a52ba5540d2a644e0b426f9041a2a5e7858", "max_stars_repo_licenses": [... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 4 16:45:52 2020
@author: hamishgibbs
"""
import __main__ as main
import sys
from pyquadkey2 import quadkey as qk
import pandas as pd
import geopandas as gpd
import numpy as np
if not hasattr(main, '__file__'):
argv = ['code', '/Users/hamishgib... | {"hexsha": "6fd078e5dd0c444880d39abaddf86bb27a0d94d9", "size": 1109, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data/OA_Reference/LA_to_tiles.py", "max_stars_repo_name": "hamishgibbs/facebook_mobility_uk", "max_stars_repo_head_hexsha": "7639778878e72e9e8445a54ea55be67482636498", "max_stars_repo_licenses... |
from __future__ import print_function
import matplotlib.pyplot as plt
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import numpy as np
from models.resnet import ResNet
from models.unet import UNet
from models.skip import skip
from models import get_net
import torch
import torch.optim
from skimage.measure import ... | {"hexsha": "bfa72e37c459c57bc25ff8223201214f9b217dc1", "size": 3899, "ext": "py", "lang": "Python", "max_stars_repo_path": "restoration.py", "max_stars_repo_name": "kokeshpatel/ImageRestoration", "max_stars_repo_head_hexsha": "77b3ecf3b7f6ae3a86b19566846035c08507260b", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import os
import shutil
import argparse
import numpy as np
from models import *
from utils.utils import *
from utils.build import *
from pruning.utils import *
from pruning.techniques import *
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--cfg', type = str, default = 'yo... | {"hexsha": "58af7d896eb429bfa73c202aaadd2a07a847ecaa", "size": 5787, "ext": "py", "lang": "Python", "max_stars_repo_path": "prune.py", "max_stars_repo_name": "pedbrgs/Pruning-Darknet", "max_stars_repo_head_hexsha": "8a147871e02cedc010e04223128f79c0529acd7f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "ma... |
//==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// ... | {"hexsha": "1ed6750c12f5adb941a8a5b0845e24eaddb3dd54", "size": 1443, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "modules/boost/simd/base/unit/bitwise/simd/twopower.cpp", "max_stars_repo_name": "psiha/nt2", "max_stars_repo_head_hexsha": "5e829807f6b57b339ca1be918a6b60a2507c54d0", "max_stars_repo_licenses": ["BS... |
1 -2 -3
| {"hexsha": "702c4007e63a5339331aa9281cb9371455686378", "size": 9, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "tests/syntax/good/testfile-mult-5.jl", "max_stars_repo_name": "gabriel-doriath-dohler/pjulia", "max_stars_repo_head_hexsha": "14325f282b711c979091ec259aefb0f1e89ec1be", "max_stars_repo_licenses": ["MI... |
import matplotlib.pyplot as plt
import numpy as np
from photonpy.cpp.context import Context
import photonpy.cpp.gaussian as gaussian
from photonpy.smlm.util import imshow_hstack
from photonpy.cpp.estimator import Estimator
def CheckDeriv(psf:Estimator, theta):
nderiv,ev=psf.NumDeriv(theta,eps=1e-6)
deriv,ev=p... | {"hexsha": "91ee06a1881d10f22e7c8d7c219f9ef37412d52d", "size": 1365, "ext": "py", "lang": "Python", "max_stars_repo_path": "photonpy/tests/psf_g2d_sigma.py", "max_stars_repo_name": "qnano/photonpy", "max_stars_repo_head_hexsha": "9c03a1c9f4c2177c9c6fb3f2f16dfec2306006d4", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
using ChainedArrays
using Test
@testset "ChainedArrays.jl" begin
v = ChainedVector([1, 2, 3], [4], [5, 6, 7, 8, 9, 10])
@test all(v .== 1:10)
@test collect(x for x in v) == 1:10
@test v[7] == 7
@test v[1:5] == 1:5
@test (v[3] = 10; v[3] == 10)
@test (v[4:10] .= 1:7; v[4:10] == 1:7)
end... | {"hexsha": "c9a8471f2c187b30d5b022c547c0e1c28ebe352d", "size": 321, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "Luapulu/ChainedArrays.jl", "max_stars_repo_head_hexsha": "e15df3ae95f0d7092e36dc9b5150fe3258d8b6d2", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
/*
@copyright Louis Dionne 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_TEST_TEST_SEQ_HPP
#define BOOST_HANA_TEST_TEST_SEQ_HPP
#include <boost/hana/applicative.hpp>
#include <boost/hana/bool.hpp>
#... | {"hexsha": "265090f96d1153f80ab41b160f21ef26beb8b483", "size": 5394, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "test/include/test/seq.hpp", "max_stars_repo_name": "josephwinston/hana", "max_stars_repo_head_hexsha": "a8586ec1812e14e43dfd6867209412aa1d254e1a", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_... |
# NLP written by GAMS Convert at 04/21/18 13:54:10
#
# Equation counts
# Total E G L N X C B
# 11 11 0 0 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | {"hexsha": "85d340aaf1e2e300bc10301cdec17d0edf4dbe07", "size": 2898, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/examples/minlplib/sambal.py", "max_stars_repo_name": "ouyang-w-19/decogo", "max_stars_repo_head_hexsha": "52546480e49776251d4d27856e18a46f40c824a1", "max_stars_repo_licenses": ["MIT"], "max_... |
import sys
import os
import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
#from tensorflow.keras.utils import to_categorical
def load_data():
ir... | {"hexsha": "d00afc1b3363df0b3e2af17502c5a093bc76e6da", "size": 4850, "ext": "py", "lang": "Python", "max_stars_repo_path": "1.ModelngNN/train_nn_for_Iris.py", "max_stars_repo_name": "covit2019/analysis_codes", "max_stars_repo_head_hexsha": "0c580c51f790723390676eef85422055007e2354", "max_stars_repo_licenses": ["MIT"], ... |
import argparse
import sys
from os.path import isdir, isfile, join
from pathlib import Path
import numpy as np
sys.path.append("..")
from approx_nn import ApproxNN # noqa: E402
from word_embeddings.word2vec import load_model_training_output # noqa: E402
rng_seed = 399
np.random.seed(rng_seed)
def parse_args() -... | {"hexsha": "e46504b907e3dacc2c1017943fe9822b9b8ba91b", "size": 6934, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/word_embeddings/postprocess_word2vec_embeddings.py", "max_stars_repo_name": "JonasTriki/masters-thesis-ml", "max_stars_repo_head_hexsha": "78b3c971e4ffd51875d19bb2cb4b75e9d7be905c", "max_star... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Define utility functions for manipulating datasets
"""
import os
import numpy as np
import sys
from copy import deepcopy
... | {"hexsha": "478576a576009ea28ff5e3aa84cf05bca9a365b4", "size": 21460, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/data_utils.py", "max_stars_repo_name": "imirzadeh/agem", "max_stars_repo_head_hexsha": "985cb08ac9672390d8ea78584badd9e3eddb4bde", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 67,... |
# -*- coding: utf-8 -*-
""" Kudryavtsev Model code adapted for the BMI version developed for the Topoflow model
Author: Kang Wang, 03/29/2016
Modified: Elchin Jafarov, 03/29/2016
*The MIT License (MIT)*
Copyright (c) 2016 permamodel
Permission is hereby granted, free of charge, to any person obtaining a ... | {"hexsha": "867d97a3a904e77e3e5158d6012ed46c0fca28d7", "size": 53356, "ext": "py", "lang": "Python", "max_stars_repo_path": "permamodel/components/Ku_method.py", "max_stars_repo_name": "ethan-pierce/permamodel", "max_stars_repo_head_hexsha": "51fc868ec2420591055e4224dd294d5730edf0f3", "max_stars_repo_licenses": ["MIT"]... |
from __future__ import division, print_function
import random
import sys
import pytest
from pysmu import Session, Mode, WriteTimeout
@pytest.fixture(scope='function')
def session(request):
"""Default session adding all attached devices."""
s = Session()
yield s
# force session destruction
s._c... | {"hexsha": "e49f4ca81de1f3c72f0c22ea447d03b507380e3a", "size": 4585, "ext": "py", "lang": "Python", "max_stars_repo_path": "bindings/python/tests/test_channel.py", "max_stars_repo_name": "damercer/libsmu", "max_stars_repo_head_hexsha": "6f141ea37a0778299ad1771cc9385fef14010bc0", "max_stars_repo_licenses": ["BSD-3-Claus... |
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
C See packages/seacas/LICENSE for details
C==============================================================... | {"hexsha": "4f33ec3d9995eb3312f297b4bad6a65b49d8262f", "size": 3538, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/gen3d/g3_getint.f", "max_stars_repo_name": "jschueller/seacas", "max_stars_repo_head_hexsha": "14c34ae08b757cba43a3a03ec0f129c8a168a9d3", "max_stars_repo_licenses": ["... |
using Interpolations
using Plots
# Given CDF generate independent random numbers
function rCDF(x,y,n)
ru = rand(n)
a = LinearInterpolation(y, x, extrapolation_bc = Flat())
xout = a(ru)
return xout
end
# Aux function to be used for mountain plot
function breakCDF(x,y)
xp = x .>= 0
xn = x .< 0
... | {"hexsha": "ec2405c1372a6628e336ec3cc0bd16ad45a47a7a", "size": 787, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "CDFJulia.jl", "max_stars_repo_name": "silvaac/SMCarticle", "max_stars_repo_head_hexsha": "7f27fdb60c2a4f8b2a11ba5b734649d0742b08c7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
@pytest.mark.skipif(
ak._util.py27 and ak._util.win,
reason="Windows Python 2.7 inser... | {"hexsha": "5a488d7553cfb53dadb1cb65765d2f91a54aac8b", "size": 1079, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_0344-repr-quote-keys.py", "max_stars_repo_name": "SantamRC/awkward-1.0", "max_stars_repo_head_hexsha": "18ba84ec7101e89fbdadb63b4683ff0025e85d71", "max_stars_repo_licenses": ["BSD-3-Cla... |
from sklearn.datasets import make_blobs, make_moons
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split
from sklearn import datasets
import scipy as sp
import numpy as np
import matplotlib.pyplot as plt
import getpass
import sys
if sys.platform == 'darwin':
sys.p... | {"hexsha": "74a99c13f5555b7fbb55e24c2ad9eb8f4d9b7b2b", "size": 3359, "ext": "py", "lang": "Python", "max_stars_repo_path": "statinf/validation/models_test.py", "max_stars_repo_name": "florianfelice/pleas", "max_stars_repo_head_hexsha": "c25374f36b781ac726bbbc6da21a559499844594", "max_stars_repo_licenses": ["MIT"], "max... |
# Package for computing multiphase pressure profiles for gas lift optimization of oil & gas wells
module PressureDrop
using Requires
import Base.show #to export type printing methods
export Wellbore, GasliftValves, WellModel, read_survey, read_valves,
pressure_atmospheric,
traverse_topdow... | {"hexsha": "a0148b3816ff02ae0f6edb64965fe3e71ee2f531", "size": 21413, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/PressureDrop.jl", "max_stars_repo_name": "UnofficialJuliaMirror/PressureDrop.jl-b7afff70-4bfb-11e9-240b-a35f420ae9bd", "max_stars_repo_head_hexsha": "1286d339b17384c0010c182a51d473f8f9ac8f76",... |
(* Re-doing Examples/Specware-Overview/MergeSort.sw in SpecwareCoq *)
Load DivideAndConquer.
Require Import List.
Import ListNotations.
Require Import Coq.Arith.Arith_base.
Require Import Coq.Arith.Div2.
Require Import Coq.Wellfounded.Wellfounded.
Require Import Coq.Relations.Relation_Operators.
(***
*** Definitio... | {"author": "KestrelInstitute", "repo": "SpecwareC", "sha": "b1234db75aeaaa91e66b15dae79b3ec195e12e41", "save_path": "github-repos/coq/KestrelInstitute-SpecwareC", "path": "github-repos/coq/KestrelInstitute-SpecwareC/SpecwareC-b1234db75aeaaa91e66b15dae79b3ec195e12e41/examples/MergeSort.v"} |
#!/usr/bin/env python
"""
pyOpt_gradient - A class that produce gradients using finite
difference or complex step.
Copyright (c) 2013-2014 by Dr. Gaetan Kenway
All rights reserved.
Developers
----------
- Dr. Gaetan Kenway (GKK)
History
-------
v. 0.1 - Initial Class Creation (GKK)
"""
# =======================... | {"hexsha": "ac6476c5a1bb02754d99db991e06c4b0b9ab0956", "size": 7438, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyoptsparse/pyOpt_gradient.py", "max_stars_repo_name": "robfalck/pyoptsparse", "max_stars_repo_head_hexsha": "c99f4bfe8961492d0a1879f9ecff7a2fbb3c8c1d", "max_stars_repo_licenses": ["CNRI-Python"],... |
'''
# Author: Ashton Allen
-- Most of this work came from this tutorial: https://machinelearningmastery.com/tutorial-to-implement-k-nearest-neighbors-in-python-from-scratch/
# Class: CSI-480-01
# Certification of Authenticity:
# I certify that this is entirely my own work, except where I have given fully documented
# ... | {"hexsha": "48c4734791160fde9b00f6907d63611289d90564", "size": 3782, "ext": "py", "lang": "Python", "max_stars_repo_path": "KNNLabOriginal.py", "max_stars_repo_name": "tbrabant3/telco-KNN", "max_stars_repo_head_hexsha": "0997073e0980c728584492efb467b690e127e4be", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import pyglet
pyglet.options['audio'] = ('openal', 'silent')
from pyglet.media.procedural import ProceduralSource, AudioData
import numpy, sys
import ctypes, math
import buffers
class PygletSource(ProceduralSource):
def __init__(self, **kwargs):
super(PygletSource,self).__init__(duration=99999999999999, ... | {"hexsha": "c8e58ed00b47fbd648ec9d92fdc142f87449c1de", "size": 2760, "ext": "py", "lang": "Python", "max_stars_repo_path": "PygletSource.py", "max_stars_repo_name": "pombreda/poise-sfx", "max_stars_repo_head_hexsha": "605dee332b872b108c8af5ac217bd72edb192603", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "... |
import numpy as np
import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.spatial import ConvexHull
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
baselines = ["DP_Kmeans_b... | {"hexsha": "3aa7aaf61ef4f41ed8264e6c818753b0a6a14c3c", "size": 1083, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/K-means/plots.py", "max_stars_repo_name": "alexnowakvila/DCN", "max_stars_repo_head_hexsha": "d27f59a0500990fbf4e68086323011fef336eb51", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
# python setup.py build_ext --inplace
from distutils.core import setup
from Cython.Build import cythonize
from numpy import get_include
from Cython.Compiler import Options
import os
os.environ['CFLAGS'] = '-O3 -march=native'
os.environ['CXXFLAGS'] = '-O3 -march=native'
os.environ['CL'] = '/arch:AVX /arch:AVX2 /arch:SS... | {"hexsha": "48ae41b76f250aa9eccfe2de8b6572141136364f", "size": 800, "ext": "py", "lang": "Python", "max_stars_repo_path": "hyperlearn_new/setup.py", "max_stars_repo_name": "danielhanchen/hiperlearn", "max_stars_repo_head_hexsha": "7e2d7735bcb40854462decd5e5c8d70afd90aede", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats, special
import mendeleev
from darklim import constants
from darklim.limit._limit import drde, optimuminterval
from darklim.sensitivity._random_sampling import pdf_sampling
from darklim.sensitivity._plotting import RatePlot
__all__ = [
"c... | {"hexsha": "c30b92ffdd2ab863ff3367fc90bfc0ebb4b9c918", "size": 12795, "ext": "py", "lang": "Python", "max_stars_repo_path": "darklim/sensitivity/_sens_est.py", "max_stars_repo_name": "slwatkins/DarkLim", "max_stars_repo_head_hexsha": "22a0f8ea7dd609075d55c413b598e42da8ef348f", "max_stars_repo_licenses": ["MIT"], "max_s... |
! ERGO: Efficient Robust Global Optimization
! Copyright (C) 2007 Klaus Keller and Brian Tuttle
!
! This program 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 2 of the Licens... | {"hexsha": "6bba1c2ffd553199792c4f0631a15ca2a02dea97", "size": 16134, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "scripts/UQ/ERGO_src/ERGO.f90", "max_stars_repo_name": "fmyuan/clm-microbe", "max_stars_repo_head_hexsha": "9faee9ed7d6c092c4a9e4a207f32cbffab78b85c", "max_stars_repo_licenses": ["MIT"], "max_st... |
# -*- coding: utf-8 -*-
from copy import copy
NonNegative = "NonNegative"
from sage.matrix.constructor import block_matrix, matrix, vector
from sage.symbolic.ring import SR
from sage.rings.integer_ring import ZZ
def matrice_systeme(systeme, variables):
"""
Renvoie une matrice par block représentant un progra... | {"hexsha": "55acc9f001209a2fb7e21c97bf75d49519ef21de", "size": 9535, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/nicolas/media/programmation_lineaire.py", "max_stars_repo_name": "keyworks/rst-to-ipynb", "max_stars_repo_head_hexsha": "e09c21d54cced941fa52b394539cf519214d6ac3", "max_stars_repo_licenses":... |
from __future__ import division
import unittest
import numpy as np
from wyrm.types import Data
from wyrm.processing import calculate_signed_r_square
from wyrm.processing import swapaxes
class TestSelectClasses(unittest.TestCase):
def setUp(self):
# create noisy data [40 epochs, 100 samples, 64 channel... | {"hexsha": "f6389075cf22e4637c8857579ae9fb3941948165", "size": 2835, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_calculate_signed_r_square.py", "max_stars_repo_name": "jscastanoc/wyrm", "max_stars_repo_head_hexsha": "c3593efe3cb5507ac525be4d650df7ce504aab00", "max_stars_repo_licenses": ["MIT"], "ma... |
\chapter{ConFrm}
\label{chapter:ConFrm}
ConFrm is a framework for proving confidentiality of storage systems. It contains a new confidentiality definition as well as structures such as layer templates, execution semantics among other things to implement file systems with confidentiality proofs.
\section{Specificatio... | {"hexsha": "571ec0036e824d5562f209340b9d26bfe7b489d9", "size": 35054, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "ConFrm Thesis/templates/contents/confrm.tex", "max_stars_repo_name": "Atalay-Ileri/Disksec-Doc", "max_stars_repo_head_hexsha": "28befcf9571b0308bcabd229ab6dcba8acb6c503", "max_stars_repo_licenses":... |
import numpy as np
from tg_config import *
def random_mistake(origin_func):
def wrapper(self, *args):
prob = np.random.randint(100)
if( prob < game_configs['mistake_prob']):
origin_result = origin_func(self, *args)
return -1 * origin_result
else:
origin_r... | {"hexsha": "84d2f26a380169d48ded3ea7eaf61dbc0adff422", "size": 2744, "ext": "py", "lang": "Python", "max_stars_repo_path": "tg_player.py", "max_stars_repo_name": "UWC-Changshu-China/Trust_Game", "max_stars_repo_head_hexsha": "5056daa6e0456ccbb5aaf53c9c554c6ec04cdd79", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
```python
import numpy as np
import scipy.sparse
```
---
# Item XVIII
Let $A_n$:
$$
A_n =
\begin{bmatrix}
1 & -2 & 0 & \dots & 0 \\
0 & 1 & -2 & 0 & \dots \\
\vdots & \ddots & \ddots & \ddots & \vdots \\
\vdots & \ddots & 0 & 1 & -2 \\
0 & \dots & \dots & 0 & 1
\end{bmatrix} \in \mathbb{R}^{n \times n}
$$
* Deter... | {"hexsha": "91b65d94c1d31c8a15e1350b002a42b68ea6539d", "size": 14935, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "t1_questions/item_18.ipynb", "max_stars_repo_name": "autopawn/cc5-works", "max_stars_repo_head_hexsha": "63775574c82da85ed0e750a4d6978a071096f6e7", "max_stars_repo_licenses": ["MIT"]... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | {"hexsha": "5dc292613eb6b0cfce6fcd70fdcee2b8a3f63040", "size": 5296, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow_model_optimization/python/core/quantization/keras/quantize_emulate_integration_test.py", "max_stars_repo_name": "Mycaster/model-optimization", "max_stars_repo_head_hexsha": "badf3be157d... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | {"hexsha": "8ac8c0dc32ae87cd594be3e13e610ee279d51f26", "size": 10690, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow/python/keras/distribute/saved_model_test_base.py", "max_stars_repo_name": "so5462/tensorflow", "max_stars_repo_head_hexsha": "0f9acc15ba56ecf01a79889d29295310559c681a", "max_stars_repo... |
"""
PMMH(n_iters::Int, smc_alg:::SMC, parameters_algs::Tuple{MH})
Particle independant Metropolis–Hastings and
Particle marginal Metropolis–Hastings samplers.
Usage:
```julia
alg = PMMH(100, SMC(20, :v1), MH(1,:v2))
alg = PMMH(100, SMC(20, :v1), MH(1,(:v2, (x) -> Normal(x, 1))))
```
"""
mutable struct PMMH <: In... | {"hexsha": "e2aadfe21699125752cc171911260ad9bbb19150", "size": 5513, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/samplers/pmmh.jl", "max_stars_repo_name": "mohamed82008/Turing.jl", "max_stars_repo_head_hexsha": "70640d35805bb46a54c04d9ff25e5a90f22eee2b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
clear all;
warning('off','all');
% parameters & settings
k = 250; % spring stiffness
dt = 0.01; % time step
frame_num = 5000; % number of total frames to run
mass_num = 10; % number of masses in the mass-spring system
% construct a 2-dimensional mass-spring system
V = [linspace(1,1+mass_num,mass_num)',zeros(mass_num... | {"author": "odedstein", "repo": "sgi-introduction-course", "sha": "52278fc3b3dab52febb110a1a09d770f46b5e417", "save_path": "github-repos/MATLAB/odedstein-sgi-introduction-course", "path": "github-repos/MATLAB/odedstein-sgi-introduction-course/sgi-introduction-course-52278fc3b3dab52febb110a1a09d770f46b5e417/105_mass_spr... |
//======================================================================
/*! \file MsgBufferBase.cpp
*
* \copydoc Copyright
* \author Jan Christian Dittmer (jcd)
* \date Jul 13, 2016
*///-------------------------------------------------------------------
#include <ibeosdk/MsgBufferBase.hpp>
#include <ibeosdk/Log.... | {"hexsha": "3cfe894c4a7744a47dd6d22ad402a01177478adb", "size": 8340, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/ibeo_8l_sdk/src/ibeosdk/MsgBufferBase.cpp", "max_stars_repo_name": "tomcamp0228/ibeo_ros2", "max_stars_repo_head_hexsha": "ff56c88d6e82440ae3ce4de08f2745707c354604", "max_stars_repo_licenses": [... |
{-# LANGUAGE ScopedTypeVariables #-}
module Language.Haskell.Repl
( Repl
-- * Construction
, newRepl
, repl'
, defaultFlags
, defaultImports
, defaultLineLength
, defaultPatience
, defaultBuildExpr
, defaultProcessOutput
-- * Stopping
, stopRepl
-- * Interaction
... | {"hexsha": "68b422823440b33a86ecf9def14e75644eeb6d28", "size": 13810, "ext": "hs", "lang": "Haskell", "max_stars_repo_path": "src/Language/Haskell/Repl.hs", "max_stars_repo_name": "mikeplus64/repl", "max_stars_repo_head_hexsha": "70a89a489956444f38b4b1193514606ec9466bfe", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import numpy as np
import re
from unidecode import unidecode
import string
import language_check
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.corpus import wordnet, stopwords
def get_wordnet_pos(treebank_tag):
if treebank_tag.startswith('J'):
re... | {"hexsha": "57178ca83559097027a46a187e5752b2ff3ca82c", "size": 2634, "ext": "py", "lang": "Python", "max_stars_repo_path": "cleaning/cleaning_functions.py", "max_stars_repo_name": "CharlesFauman/NLP_meme_project", "max_stars_repo_head_hexsha": "71a971c3a3ba2b761d4fc57a0213a8dde852e6eb", "max_stars_repo_licenses": ["MIT... |
"""Tests for Estimator Classes"""
import unittest
import numpy as np
from pyesg import NelsonSiegelInterpolator, SvenssonInterpolator
class TestNelsonSiegelInterpolator(unittest.TestCase):
"""Test Nelson Siegel Interpolator"""
@classmethod
def setUpClass(cls):
cls.X = np.array([1, 2, 5, 10, 20, ... | {"hexsha": "0932a1f8a040c6363f4d7e3a2a30f5d8c1eb3a1e", "size": 3269, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_interpolators.py", "max_stars_repo_name": "jakemcaferty/pyesg", "max_stars_repo_head_hexsha": "6125a2b6b936f69c895dc0633fef323fa654fbc8", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 29 10:27:32 2016
@author: wang
"""
#import numpy
import numpy as np
#a=[1,2,3,4,45,9,8,5,2]
#b=[10,20,30]
##np.savetxt('new.csv', a,delimiter = ',')
#np.savez('c.npz',a,b)
r=np.load('je_compare.npz')
#print 'matrix_1=',r["arr_0"] # this is the first matrix
print 'matrix... | {"hexsha": "d055cfb77a5f8d5edf308212fc7a1bf464091a98", "size": 363, "ext": "py", "lang": "Python", "max_stars_repo_path": "read_xml_all/open_database_1.py", "max_stars_repo_name": "daniel20162016/my-first", "max_stars_repo_head_hexsha": "f9554dd476302b26e8a296393025f150922f349c", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
def recursive_load_decorator(default_list_to='list'):
"""
>>> from pb_chime5.io import load_audio
>>> np.set_string_function(lambda a: f'array(shape={a.shape}, dtype={a.dtype})')
>>> load_audio = recursive_load_decorator(default_list_to='array')(load_audio)
>>> prefix = '/net/fa... | {"hexsha": "f09b10b42c87078c4b88739c7e19208913026e27", "size": 1810, "ext": "py", "lang": "Python", "max_stars_repo_path": "pb_chime5/io/load_decorator.py", "max_stars_repo_name": "vimalmanohar/pb_chime5", "max_stars_repo_head_hexsha": "e5775565ee78e5a1fda0a8d7f696672243587a88", "max_stars_repo_licenses": ["MIT"], "max... |
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2017 Vic Chan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify... | {"hexsha": "208fb798d4678d2b762c69ef3729a814bed28c15", "size": 1813, "ext": "py", "lang": "Python", "max_stars_repo_path": "OCR-CTC/draw_curve.py", "max_stars_repo_name": "wondervictor/DeepLearningWithPaddle", "max_stars_repo_head_hexsha": "55fa817584fd207430e083c20cfadb18727209e1", "max_stars_repo_licenses": ["MIT"], ... |
import numpy as np
import math
from circuits.circuit_pack import *
def cal_EIS_sim_complex_list(fre_list, ECM_num, ECM_paras_list):
"""
:param
fre_list:
list(float, float,...)
[0.002, 0.05, 0.8, ..., 1000000]
These frequency are read from raw experiment data, like DT... | {"hexsha": "71fb63493f49fdafbd3a2be4375763f7e29cb3a5", "size": 19690, "ext": "py", "lang": "Python", "max_stars_repo_path": "v0/aia_eis_v0/GA_pack/fittness_functions/eis_fitness.py", "max_stars_repo_name": "DreamBoatOve/aia_eis", "max_stars_repo_head_hexsha": "458b4d29846669b10db4da1b3e86c0b394614ceb", "max_stars_repo_... |
// Copyright 2021 atframework
// Created by owent
#pragma once
#include <config/atframe_utils_build_feature.h>
#include <config/compiler_features.h>
#include <design_pattern/nomovable.h>
#include <design_pattern/noncopyable.h>
#include <time/time_utility.h>
#include <gsl/select-gsl.h>
#include <list>
#include <ve... | {"hexsha": "6147e48b35453820eb9f63b599c5c9065a5cd0ce", "size": 4312, "ext": "h", "lang": "C", "max_stars_repo_path": "include/atframe/connectors/atapp_endpoint.h", "max_stars_repo_name": "atframework/libatapp", "max_stars_repo_head_hexsha": "54aae9e0972eb94c33a7c109bdd099ff3a89ee80", "max_stars_repo_licenses": ["MIT"],... |
[STATEMENT]
lemma fold_unique_mor: "mor UNIV UNIV ctor1 ctor2 UNIV UNIV s1 s2 f g \<Longrightarrow>
f = fold1 s1 s2 \<and> g = fold2 s1 s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. mor UNIV UNIV ctor1 ctor2 UNIV UNIV s1 s2 f g \<Longrightarrow> f = fold1 s1 s2 \<and> g = fold2 s1 s2
[PROOF STEP]
apply (rule ... | {"llama_tokens": 6636, "file": "BNF_Operations_LFP", "length": 28} |
import itertools
import numpy as np
from copy import deepcopy
from collections import deque
class Cube:
def __init__(self, cube):
if isinstance(cube, Cube):
self.cube = deepcopy(cube.cube)
else:
self.cube = np.array(cube)
def __str__(self):
s = ""
faces = ['Up', 'Front', 'Down', 'Back', 'Left', 'Ri... | {"hexsha": "eb569777c2ef84fc0cf546c7ec314fd6a887122c", "size": 7735, "ext": "py", "lang": "Python", "max_stars_repo_path": "sessions/08-web-scraping/src/rubiks_cube.py", "max_stars_repo_name": "acmbpdc/coding-bootcamp", "max_stars_repo_head_hexsha": "27e286080630c2b8f4d2d8dcf89862bcfbcc1031", "max_stars_repo_licenses":... |
# this script calculates occurrence percentages across inputs and functions.
# occurrence percentage:
# number of occurrences of model component/sum of all occurrences of all model components
import pickle
import os
import operator
import pandas as pd
import numpy as np
from collections import Counter
dir_path = os... | {"hexsha": "1688c91b3a62583336853ff02231e5bf4d529209", "size": 2378, "ext": "py", "lang": "Python", "max_stars_repo_path": "sc_post/post_sc_occurrence.py", "max_stars_repo_name": "wdlynch/symbolic_experiments", "max_stars_repo_head_hexsha": "8c0c9bf93edc8f58ed1e027cf5704dadd57e853a", "max_stars_repo_licenses": ["MIT"],... |
[STATEMENT]
lemma is_UNIV_code [code]:
fixes rbt :: "'a :: {cproper_interval, finite_UNIV} set_rbt"
and A :: "'b :: card_UNIV set" shows
"is_UNIV A \<longleftrightarrow>
(let a = CARD('b);
b = card A
in if a > 0 then a = b
else if b > 0 then False
else Code.abort (STR ''is_UNIV calle... | {"llama_tokens": 4814, "file": "Containers_Set_Impl", "length": 30} |
# ------------------------------------------------------------------------------
#
# Gmsh Python tutorial 16
#
# Constructive Solid Geometry, OpenCASCADE geometry kernel
#
# ------------------------------------------------------------------------------
# Instead of constructing a model in a bottom-up fashion with Gms... | {"hexsha": "f4e7c444e3acf0f71e95016f67af3b3ef69b35e9", "size": 2602, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/t16.jl", "max_stars_repo_name": "koehlerson/Gmsh.jl", "max_stars_repo_head_hexsha": "feecb1432283b78d15189f87d8466e3a925884f5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "m... |
# bracketing intervals for RSSA-based aggregators
# see: "On the rejection-based algorithm for simulation and analysis of
# large-scale reaction networks", Thanh et al, J. Chem. Phys., 2015
# note, expects the type of the bracketing variables [ulow,uhigh] to be the
# same as the fluct_rate and ushift.
struct Brac... | {"hexsha": "10f78ec50538a723690304464722c5b4ec21c229", "size": 3332, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/aggregators/bracketing.jl", "max_stars_repo_name": "ChrisRackauckas/DiffEqJump.jl", "max_stars_repo_head_hexsha": "80fdaa6e6abffdfccb1a7624ddd69c83c4cb2b82", "max_stars_repo_licenses": ["MIT"],... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 27 09:00:59 2020
This script is thought to produce replicates of SNP datasets (here: vitis)
by using structure analysis probabilities as well as ibs clusters to avoid
a close realtionships
ATTENTION: there is a bug in the loop! although it works ve... | {"hexsha": "d27b5693ba02db0c7fc5c40ac6b1c41ca6d333cf", "size": 13074, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/data_conversion/vitis_replicato_new.py", "max_stars_repo_name": "biothomme/--valencene", "max_stars_repo_head_hexsha": "a1327c886d2c7e6f9709c0c502f3936abd01e452", "max_stars_repo_licenses... |
from helpers import d2df
import numpy as np
import pandas as pd
def systemFill(processed, dict_structure, CONSTANTS, system_type, call_ID):
print("Started filling the gaps in the dataframe...", end="", flush=True)
if system_type == "MainEngines":
system_set = {"ME1", "ME2", "ME3", "ME4"}
elif syst... | {"hexsha": "51bf50f3d69c2373dbd7cf40d764f878c3f24115", "size": 9177, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python files/fillerfunctions.py", "max_stars_repo_name": "francescobaldi86/Ecos2015PaperExtension", "max_stars_repo_head_hexsha": "486cbb770c5394938f08af3d880d1300d71dc753", "max_stars_repo_licens... |
''' Sun discipline for CADRE '''
import numpy as np
import scipy.sparse
from openmdao.main.api import Component
from openmdao.lib.datatypes.api import Float, Array
from kinematics import computepositionrotd, computepositionrotdjacobian
from kinematics import computepositionspherical, computepositionsphericaljacobian... | {"hexsha": "c771872455a705b9ebe4d6c4563cc86a488b51af", "size": 15409, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/CADRE/sun.py", "max_stars_repo_name": "JustinSGray/OpenMDAO-CADRE", "max_stars_repo_head_hexsha": "d8378a8a571179990531d8a409efe727cbdf2bb7", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
[STATEMENT]
lemma aprimedivisor_le_nat:
assumes "n > Suc 0"
shows "aprimedivisor n \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. aprimedivisor n \<le> n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. aprimedivisor n \<le> n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
p... | {"llama_tokens": 500, "file": null, "length": 8} |
#ifndef BOOST_PREPROCESSOR_ARITHMETIC_HPP
#define BOOST_PREPROCESSOR_ARITHMETIC_HPP
/* Copyright (C) 2001
* Housemarque Oy
* http://www.housemarque.com
*
* Permission to copy, use, modify, sell and distribute this software is
* granted provided this copyright notice appears in all copies. This
* software is prov... | {"hexsha": "89e4d76365e770291e52fc22b348ee7fa02690cc", "size": 693, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "vegastrike/boost/1_28/boost/preprocessor/arithmetic.hpp", "max_stars_repo_name": "Ezeer/VegaStrike_win32FR", "max_stars_repo_head_hexsha": "75891b9ccbdb95e48e15d3b4a9cd977955b97d1f", "max_stars_repo_... |
import cvxpy as cp
from cvxpy.settings import NONNEG
import numpy as np
import sys
sys.path.append('../')
from markov_decision_process.mdp import MDP
def build_joint_entropy_program(mdp: MDP,
exp_len_coef : float = 0.1,
entropy_coef : float = 0.1,
... | {"hexsha": "a8f2218da63b6046d10e495afa92d743b405c5c4", "size": 4005, "ext": "py", "lang": "Python", "max_stars_repo_path": "optimization_problems/joint_entropy.py", "max_stars_repo_name": "cyrusneary/multi-agent-comms", "max_stars_repo_head_hexsha": "d88ebfa3d1adb4da55283472c95d8a094f42df43", "max_stars_repo_licenses":... |
% !TeX root = ../solution.tex
\hypertarget{he22.37}{%
\chapter{[HE22.37] Egg-O}\label{he22.37}}
\begin{marginfigure}
\includegraphics[width=49mm]{level8/challenge37.jpg}
\end{marginfigure}
\section{Intro}
Egg or chicken, what was first?
\verb+nc 46.101.107.117 2208+
Note: The service is restarted every hour at x:0... | {"hexsha": "3884ee6b85bd06f22bdcfbd95287083a82258cb7", "size": 5844, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "HackyEaster/he2022/level8/ch37.tex", "max_stars_repo_name": "tbrup/ctf-writeups", "max_stars_repo_head_hexsha": "dfac11abb3051af657ed3384c3c389c14a40c10e", "max_stars_repo_licenses": ["MIT"], "max_s... |
/-
Copyright (c) 2020 Yury G. Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Yury G. Kudryashov
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.data.set.intervals.unordered_interval
import Mathlib.data.set.lattice
import Mathlib... | {"author": "AurelienSaue", "repo": "Mathlib4_auto", "sha": "590df64109b08190abe22358fabc3eae000943f2", "save_path": "github-repos/lean/AurelienSaue-Mathlib4_auto", "path": "github-repos/lean/AurelienSaue-Mathlib4_auto/Mathlib4_auto-590df64109b08190abe22358fabc3eae000943f2/Mathlib/data/set/intervals/ord_connected_auto.l... |
import tactic.basic
import data.set.basic
namespace set
variables {α : Type*} {β : Type*}
lemma union_of_sub (s: set α) (f : α → set α) (hf : ∀ x ∈ s, x ∈ f x ∧ f x ⊆ s) :
s = ⋃₀ (f '' s) :=
begin
ext,
split,
simp at *,
{
intros xs,
exact ⟨ x, xs, (hf x xs).1 ⟩
},
{
... | {"author": "paraseba", "repo": "topology-janich", "sha": "270f3d2de019c093c86ac967b4ec9a4a2f25a5d3", "save_path": "github-repos/lean/paraseba-topology-janich", "path": "github-repos/lean/paraseba-topology-janich/topology-janich-270f3d2de019c093c86ac967b4ec9a4a2f25a5d3/src/sets.lean"} |
\documentclass[11pt, oneside]{article} % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} %... | {"hexsha": "f4f59082e48aa62f1ad82cf90cfde060f79e30e5", "size": 2374, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "paper/csm_mass.tex", "max_stars_repo_name": "abostroem/asassn15oz", "max_stars_repo_head_hexsha": "ade090096b61b155c86108d1945bb7b4522365b8", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
import numba as nb
import numpy as np
from numba.core import types
from numba.typed import Dict
from cosmogrb.utils.interpolation import Interp1D
from cosmogrb.utils.response_file import RSP
@nb.njit(fastmath=True, cache=False)
def _digitize(photon_energies, energy_edges, cum_matrix):
pha_channels = np.zeros(le... | {"hexsha": "dc3af0d1b17322c64abda7ac411148025cf939f1", "size": 7389, "ext": "py", "lang": "Python", "max_stars_repo_path": "cosmogrb/response/response.py", "max_stars_repo_name": "wematthias/cosmogrb", "max_stars_repo_head_hexsha": "09852eb4e6e7315bbede507e19a2d57f1b927c3f", "max_stars_repo_licenses": ["BSD-2-Clause"],... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.