text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
Set Implicit Arguments.
Require Import Shared.
Require Import LibFix.
Require Import JsSemanticsAux JsWf JsWfAux JsSafety JsScopes JsInterpreter.
(**************************************************************)
(** ** Correctness of proto_comp. *)
Section Proto.
(** Termination of [proto_comp] *)
Inductive proto_c... | {"author": "jeremyjohnston", "repo": "javascript-vm", "sha": "eb4b20f46d36c8342f0f012cd38500ca6dab3e1a", "save_path": "github-repos/coq/jeremyjohnston-javascript-vm", "path": "github-repos/coq/jeremyjohnston-javascript-vm/javascript-vm-eb4b20f46d36c8342f0f012cd38500ca6dab3e1a/jscert/core_js_src/JsInterpreterProofs.v"} |
import numpy as np
import matplotlib.pyplot as plt
import scipy.io as sio
from Hodge import *
if __name__ == "__main__":
foldername = "VideoMix/NumberedVideos"
X = sio.loadmat("TurkResults/Class.mat")
R = X['R']
Y = R[:, 2]
R = R[:, 0:2]
W = np.ones(Y.shape)
(s, I, H) = doHodge(R, W, Y, ver... | {"hexsha": "7a6c7a74aafd6c98ad8a8e2396c0ecba4a627297", "size": 1089, "ext": "py", "lang": "Python", "max_stars_repo_path": "rankVideosHumanAggregate.py", "max_stars_repo_name": "ctralie/SlidingWindowVideoTDA", "max_stars_repo_head_hexsha": "d707a0c4727e068778d5c805f938556c91d6f1ce", "max_stars_repo_licenses": ["Apache-... |
# #
# Reproduce the figures in
# [V. Duchêne and C. Klein](http://dx.doi.org/10.3934/dcdsb.2021300)
# on the Serre-Green-Naghdi and its fully dispersive counterpart.
# #
export PlotSolitaryWaveWGN1,PlotSolitaryWaveWGN2,PlotSolitaryWaveWGN3,PlotJacobianWGN,IntegrateSolitaryWaveWGN,StabilitySolitaryWaveWGN,IntegrateWGN
u... | {"hexsha": "e0a4d79f636de3afbd3b97a67af76b68f41a527b", "size": 16340, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/StudyWhithamGreenNaghdi.jl", "max_stars_repo_name": "WaterWavesModels/ShallowWaterModels.jl", "max_stars_repo_head_hexsha": "ab745353a2472a76646d976c6fe536f0be664488", "max_stars_repo_lic... |
"""
Summary: A collections of functions for visualization.
Description: contains a function that reads data and data types, and many
other functions for visualization
Author: Kunyu He, CAPP'20
Link: https://github.com/KunyuHe/ML-Pipeline-for-Crowdfunding-Project-Outcome-Prediction/blob/master/cod... | {"hexsha": "fb4c31f4b053b31d20e928290b258eb6442a0f93", "size": 5993, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/minml/components/visualization/metrics.py", "max_stars_repo_name": "timhannifan/minml", "max_stars_repo_head_hexsha": "21ab6a93e30fc4ef2e67e054cce036cb64b3b684", "max_stars_repo_licenses": ["M... |
/**
* \file dcs/testbed/registry.hpp
*
* \brief Global registry class.
*
* \author Marco Guazzone (marco.guazzone@gmail.com)
*
* <hr/>
*
* Copyright 2012 Marco Guazzone (marco.guazzone@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compli... | {"hexsha": "42d04f40b40e4e70a7205b08601e2f576269b6c6", "size": 5015, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "inc/dcs/testbed/registry.hpp", "max_stars_repo_name": "sguazt/dcsxx-testbed", "max_stars_repo_head_hexsha": "e7210f0c7f54256d5bf0c90297e0c4f9eaf82da0", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
# Copyright 2019 AUI, Inc. Washington DC, USA
#
# 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 applicabl... | {"hexsha": "c90a70605c67e2a636062c5aebd88d6171ba5849", "size": 21995, "ext": "py", "lang": "Python", "max_stars_repo_path": "ngcasa/imaging/_imaging_utils/_aperture_grid.py", "max_stars_repo_name": "FedeMPouzols/cngi_prototype", "max_stars_repo_head_hexsha": "421a99c460f4092b79120f5bec122de7ce9b8b96", "max_stars_repo_l... |
import torch
import math
import numpy as np
from scipy.spatial import Delaunay
from shapely import geometry
from matplotlib import pyplot as plt
def get_circle(batch_size, masks_size, num_points, device):
half_dim = masks_size / 2
half_width = half_dim
half_height = half_dim
# r = torch.randint(low=5... | {"hexsha": "c80b1738980303ce0df0aa84bff6f962a89ad17c", "size": 13335, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/topology.py", "max_stars_repo_name": "lisurui6/acdrnet", "max_stars_repo_head_hexsha": "0f6fcdf1b441801b073c93aa07a2f537ce1cc565", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
"""
Utility functions
"""
import logging
import configparser
import numpy as np
from itertools import chain
def load_glove(file, dim):
"""Loads GloVe vectors in numpy array.
Args:
file (str): a path to a glove file.
Return:
dict: a dict of numpy arrays.
"""
model = ... | {"hexsha": "d67df80be4e3143e1ed8ed440709edea3bceebc3", "size": 2854, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepsequence/utils.py", "max_stars_repo_name": "yangdc1992/deepsequence", "max_stars_repo_head_hexsha": "577c2140271d2d725806c3e1a14fbd5324d20bca", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
r"""
Computation of Frobenius matrix on Monsky-Washnitzer cohomology
The most interesting functions to be exported here are
:func:`matrix_of_frobenius` and :func:`adjusted_prec`.
Currently this code is limited to the case `p \geq 5` (no
`GF(p^n)` for `n > 1`), and only handles the
elliptic curve case (not more genera... | {"hexsha": "13363c1170ad9334f17283350f78d2ead7b07831", "size": 124605, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py", "max_stars_repo_name": "Blues1998/sage", "max_stars_repo_head_hexsha": "b5c9cf037cbce672101725f269470135b9b2c5c4", "max_stars_repo_li... |
import unittest
import hierarch.stats
from hierarch.power import DataSimulator
import scipy.stats as stats
import numpy as np
import pandas as pd
class TestPreprocessData(unittest.TestCase):
def test_label_encoding(self):
# check that strings get encoded
data = np.array(["a", "b", "c"]).reshape((3,... | {"hexsha": "7a46a848cc229a5718c8002f307b3c0676b9beff", "size": 6746, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_stats.py", "max_stars_repo_name": "rishi-kulkarni/Hierarch", "max_stars_repo_head_hexsha": "d159a9605b48041cf87287dd44c0aa0ce434d12c", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
"""This where implementations of individual operations live"""
from ..coreOperation import *
from ..coreNode import broadcast_shape, reduce_shape
from .twoInputOperations import DivideOperation
import numpy as np
class SumAllOperation(SingleInputOperation):
"""Sum all elements together
Attributes
------... | {"hexsha": "ff32c39890017422a7d4686fe4d29739ffa321c3", "size": 9847, "ext": "py", "lang": "Python", "max_stars_repo_path": "graphAttack/operations/singleInputOperations.py", "max_stars_repo_name": "jgolebiowski/graphAttack", "max_stars_repo_head_hexsha": "ec8488444b44d0bd54498bf917ee42d821643ee8", "max_stars_repo_licen... |
[STATEMENT]
lemma import_test:
"-y * x \<le> x * -y \<Longrightarrow> -y * x\<^sup>\<circ> = -y * (-y * x)\<^sup>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. - y * x \<le> x * - y \<Longrightarrow> - y * x\<^sup>\<circ> = - y * (- y * x)\<^sup>\<circ>
[PROOF STEP]
by (simp add: circ_import tests_dual.su... | {"llama_tokens": 141, "file": "Correctness_Algebras_Test_Iterings", "length": 1} |
#!/usr/bin.env/python
# -*- coding: utf-8 -*-
"""
The read_write module contains tools for accessing *.fcs files and
relies on the Python library FlowIO by Scott White. This is used by
Experiment to population FileGroups.
Projects also house the subjects (represented by the Subject class;
see cytopy.data.subject) of a... | {"hexsha": "f92211c502c0626398340f11d07aa25743417d16", "size": 12059, "ext": "py", "lang": "Python", "max_stars_repo_path": "cytopy/data/read_write.py", "max_stars_repo_name": "JANHMS/CytoPy", "max_stars_repo_head_hexsha": "8537d707fa25645b55b4ec1e25fff9f19847fb1b", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
# -*- coding: utf-8 -*-
"""
NEURAL NETWORKS AND DEEP LEARNING
ICT FOR LIFE AND HEALTH - Department of Information Engineering
A.A. 2019/20
Giulia Bressan
Homework 4
"""
import torch
import matplotlib.pyplot as plt
import random
from torch import nn
from torch.utils.data import DataLoader, Subset
from torchvi... | {"hexsha": "5e70ff5404a5c20dadecdf43cff02b25d9313dd3", "size": 8256, "ext": "py", "lang": "Python", "max_stars_repo_path": "autoencoders for digit reconstruction/code/hw4_crossval.py", "max_stars_repo_name": "gitBress/NNDL", "max_stars_repo_head_hexsha": "b73b42f9c421922626c6e74afdb71ff0c7cadc46", "max_stars_repo_licen... |
import sncosmo
from astropy.tests.helper import remote_data
@remote_data
def test_hst_bands():
""" check that the HST and JWST bands are accessible """
for bandname in ['f606w', 'uvf606w', 'f125w', 'f127m',
'f115w']: # jwst nircam
sncosmo.get_bandpass(bandname)
@remote_data
d... | {"hexsha": "89ebd824dcaea02146d22d6c15d129bbbd1c20fe", "size": 418, "ext": "py", "lang": "Python", "max_stars_repo_path": "sncosmo/tests/test_builtins.py", "max_stars_repo_name": "rbiswas4/sncosmo", "max_stars_repo_head_hexsha": "813b707044fd21e8e35e7a1cdc650b48417f0ebc", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
[STATEMENT]
lemma higher_plus: "higher (p + q) v = higher p v + higher q v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. higher (p + q) v = higher p v + higher q v
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_add lookup_higher) | {"llama_tokens": 97, "file": "Polynomials_MPoly_Type_Class_Ordered", "length": 1} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Includes the EPrime data source class."""
# TODO(janmtl): Provide an interface that deuglifies the _0 and channels in this
# interface
import pandas as pd
import io
import numpy as np
from data_source import DataSource
from schema import Schema, Or
from utils import me... | {"hexsha": "70d8b83a49c788693208e0072e637bbb67226a3b", "size": 3785, "ext": "py", "lang": "Python", "max_stars_repo_path": "pypsych/data_sources/eprime.py", "max_stars_repo_name": "janmtl/pypsych", "max_stars_repo_head_hexsha": "1c606342dbdb984bc06aa9fd26963f3ce0a378b1", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
#include "readline_buffer.h"
#include <readline/readline.h>
#include <readline/history.h>
#include <iostream>
#include <boost/thread/mutex.hpp>
#include <boost/thread/lock_guard.hpp>
#include <boost/algorithm/string.hpp>
static bool same_as_last_line(const std::string&);
static void install_line_handler();
static void... | {"hexsha": "1047d16968feffd23a0f5481cc701827c32ba584", "size": 5419, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "contrib/epee/src/readline_buffer.cpp", "max_stars_repo_name": "glazedtorus/monero", "max_stars_repo_head_hexsha": "105e2304a2b6344cbfeb382d0e8950de7f7385e0", "max_stars_repo_licenses": ["MIT"], "max... |
[STATEMENT]
lemma rbt_sorted_param[param]:
"(ord.rbt_sorted,ord.rbt_sorted)\<in>(Rk\<rightarrow>Rk\<rightarrow>Id)\<rightarrow>\<langle>Rk,Rv\<rangle>rbt_rel\<rightarrow>Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (ord.rbt_sorted, ord.rbt_sorted) \<in> (Rk \<rightarrow> Rk \<rightarrow> bool_rel) \<rightarr... | {"llama_tokens": 361, "file": "Collections_GenCF_Impl_Impl_RBT_Map", "length": 2} |
"""v1 - Try just replicating some noiseless sweep data taking runs."""
from datetime import datetime
import time
import qsimcirq
import cirq
import numpy as np
from z2_sim.src.QuantumCircuits.Cirq_Code.Z2GaugeCirq import make_trotter_circuit
from z2_sim.src.QuantumCircuits.Cirq_Code import util
grid_sizes = [3, 4, ... | {"hexsha": "005e28967db80b866f0e2845c106d4833887d5f3", "size": 1584, "ext": "py", "lang": "Python", "max_stars_repo_path": "benchmarks/gpu_bench_v1.py", "max_stars_repo_name": "Fermilab-Quantum-Science/Z2Sim-public", "max_stars_repo_head_hexsha": "dfbefffd933aa2e39a0cb9f668b424596dfa7d35", "max_stars_repo_licenses": ["... |
from __future__ import print_function
import argparse
import os
import numpy as np
from datetime import datetime
#import matplotlib
#import matplotlib.pyplot as plt
from astrometry.util.fits import fits_table, merge_tables
def ccd_cuts_inplace(ccds, use_blacklist=True):
# coadd/ccd.fits file has extra white space
... | {"hexsha": "844eb9febf40e64f6b44df89d4648fa3ba1510cb", "size": 19494, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/dr4/job_accounting.py", "max_stars_repo_name": "manera/legacypipe", "max_stars_repo_head_hexsha": "64dfe164fe1def50f5ad53784edd9a63321b0d45", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
# This script process the simulation data using non-linear least squares fitting
# for both the original Reference Region Model (NRRM) and the Constrained approach (CNRRM)
# Run this script by launching julia then entering: include("path/to/e01_2a_simProcessNLSQ.jl")
# Estimated runtimes:
# ~2.6 hours for NRRM
# ~1.2... | {"hexsha": "0681020f638e4a85221b797b2fec1c10a1828727", "size": 4137, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "e01_2a_simProcessNLSQ.jl", "max_stars_repo_name": "MPUmri/CRRM", "max_stars_repo_head_hexsha": "75249121d7c98c57b8b0c01013e86963707113e9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
[STATEMENT]
lemma lset_llist_of_tllist [simp]:
"lset (llist_of_tllist xs) = tset xs" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lset (llist_of_tllist xs) = tset xs
[PROOF STEP]
proof(intro set_eqI iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. \<And>x. x \<in> lset (llist_of_tllist... | {"llama_tokens": 1996, "file": "Coinductive_TLList", "length": 19} |
program unum_type_conversion_test
use ISO_FORTRAN_ENV, only : REAL64
use unum_env_mod
use unum_to_float_mod
use real_to_unum_mod
use display_unum_as_real_mod
use display_masks_mod
use unum_t_mod
use display_env_mod, only : Display_unum => Display_env,&
Display_posinfu,&
... | {"hexsha": "aa8cab7fc4b1513e7fc1220d649ef07c909f6250", "size": 1616, "ext": "f08", "lang": "FORTRAN", "max_stars_repo_path": "unum_type_conversion_test.f08", "max_stars_repo_name": "CrashBurnRepeat/fUnums", "max_stars_repo_head_hexsha": "ef0b621bc0aab5d7915f6c1366d671f02293af30", "max_stars_repo_licenses": ["MIT"], "ma... |
import math
import numpy as np
import os
import pandas as pd
import torch
from tqdm import tqdm as tqdm
from spacy import displacy
from spacy.util import is_in_jupyter
from transformers import AutoTokenizer
from typing import Dict
from thermostat.data import get_local_explanations
from thermostat.utils import delistif... | {"hexsha": "9180d100f8adc745f022633acc03c3ffaaada855", "size": 9563, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/thermostat/visualize.py", "max_stars_repo_name": "MNasert/thermostat", "max_stars_repo_head_hexsha": "ad9dbd8942eef63c2df8c0adc2a79568acf31049", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
[STATEMENT]
lemma TopoS_modelLibrary_yields_new_configured_SecurityInvariant:
assumes NetModelLib: "TopoS_modelLibrary m sinvar_spec"
and nPdef: "nP = nm_node_props m C"
and formalSpec: "Spec = \<lparr>
c_sinvar = (\<lambda>G. sinvar_spec G nP),
... | {"llama_tokens": 1300, "file": "Network_Security_Policy_Verification_TopoS_Composition_Theory_impl", "length": 10} |
# -*- coding: utf-8 -*-
"""
Plot the interpolation functions for a 4-node isoparametric
element.
@author: Nicolas Guarin-Zapata
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import rcParams
#import seaborn
rcParams['font.f... | {"hexsha": "81abed26b6e93a64c5da30d7e9d09538a0df7262", "size": 1461, "ext": "py", "lang": "Python", "max_stars_repo_path": "img_src/TheFEM/Four_nodes_shape_func.py", "max_stars_repo_name": "jomorlier/FEM-Notes", "max_stars_repo_head_hexsha": "3b81053aee79dc59965c3622bc0d0eb6cfc7e8ae", "max_stars_repo_licenses": ["MIT"]... |
import numpy
import torch
from .isnumpy import *
from .istorch import *
def squeeze(tensor):
"""
Removes all the dimensions with value 1 of the input tensor
Parameters
----------
tensor : Tensor
the input tensor
Returns
-------
Tensor
the squeezed input
Raises
... | {"hexsha": "b1d24d84b0327dd122bd57b4db2616e045c40926", "size": 564, "ext": "py", "lang": "Python", "max_stars_repo_path": "ACME/utility/squeeze.py", "max_stars_repo_name": "mauriziokovacic/ACME", "max_stars_repo_head_hexsha": "2615b66dd4addfd5c03d9d91a24c7da414294308", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import json
import logging
import os
import random
import time
import warnings
import numpy as np
import pandas as pd
from autogluon.core import Space
from autogluon.core.constants import QUANTILE
from autogluon.core.utils import try_import_torch
from autogluon.core.utils.exceptions import TimeLimitExceeded
from auto... | {"hexsha": "37ddf165edff4be1e6cd59ed8310b55ed557d6c5", "size": 25106, "ext": "py", "lang": "Python", "max_stars_repo_path": "tabular/src/autogluon/tabular/models/tabular_nn/tabular_nn_quantile.py", "max_stars_repo_name": "songqiang/autogluon", "max_stars_repo_head_hexsha": "529d7cc65fad411622072aa0349215a15e1e901c", "m... |
import numpy as np
import random
from ..utils.operations import create_3D_rotations
class SemsegAugmentation():
"""Class consisting different augmentation methods for Semantic Segmentation.
Args:
cfg: Config for augmentation.
"""
def __init__(self, cfg):
self.cfg = cfg
@staticme... | {"hexsha": "bce1b48ceb0e3c92efdfd058040ae21b931cfe64", "size": 8611, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml3d/datasets/augment/augmentation.py", "max_stars_repo_name": "thomasbrockmeier-ams/Open3D-ML", "max_stars_repo_head_hexsha": "1e362bbf133537668923905a12a15c540d9b689d", "max_stars_repo_licenses"... |
from numpy import allclose
def very_close(a, b):
""" close to machine precision """
return allclose(a, b, rtol=1e-14, atol=1e-14)
| {"hexsha": "6e91be2ba15e443ef310b9ba2b96c4159bdc8f71", "size": 140, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/__init__.py", "max_stars_repo_name": "computationalmodelling/fidimag", "max_stars_repo_head_hexsha": "07a275c897a44ad1e0d7e8ef563f10345fdc2a6e", "max_stars_repo_licenses": ["BSD-2-Clause"], "... |
#include "<test_name>.h"
// Generated from the AFU JSON file by afu_json_mgr
#include "afu_json_info.h"
#include <unistd.h>
#include <time.h>
#include <boost/format.hpp>
#include <boost/algorithm/string.hpp>
#include <stdlib.h>
#include <sys/mman.h>
#include <chrono>
#include <thread>
#include "common.h"
#define ELE... | {"hexsha": "b7da8252d8eddef229feca502ed8a751920609b4", "size": 9808, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "backend/template/sw/template.cpp", "max_stars_repo_name": "diorga/harpy", "max_stars_repo_head_hexsha": "28daf9a223527588b9e1fdc3ff9c3e92f91a03a4", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Adapted from https://github.com/priba/nmp_qc
"""
utils.py: Functions to process dataset graphs.
Usage:
"""
from __future__ import print_function
import rdkit
import torch
from joblib import Parallel, delayed
import multiprocessing
import networkx as nx
import nu... | {"hexsha": "49d827b18611982ce6bdabdd882d794ee52b953a", "size": 12001, "ext": "py", "lang": "Python", "max_stars_repo_path": "QC/datasets/utils.py", "max_stars_repo_name": "phcavelar/graph-odenet", "max_stars_repo_head_hexsha": "cba1224c041e53ea221e31bf9103ef950b8bd460", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
#
# @file filter_items.py
# @brief filter_items for parser directory
# @author Hovakim Grabski
#
# <!--------------------------------------------------------------------------
# Copyright (c) 2016-2019,Hovakim Grabski.
# All rights reserved.
# Redistribution and us... | {"hexsha": "d5e982a0c431d03dbcc687eb00e0387c3a0cf8d8", "size": 7280, "ext": "py", "lang": "Python", "max_stars_repo_path": "molmolpy/utils/filter_items.py", "max_stars_repo_name": "hovo1990/molmolpy", "max_stars_repo_head_hexsha": "30a825f0142ca0bd549896fb88fe908af47ad4de", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
# -*- coding: utf-8 -*-
from keras import initializations
from keras.engine import Layer
from keras import backend as K
import librosa
import numpy as np
from . import backend
# Todo: Filterbank(); init with mel, log, linear, etc.
# not parameterised, just a matrix.
class Filterbank(Layer):
'''Filterbank assume... | {"hexsha": "17b42c2fad38d4494d1a1034a2d2da7f4ce1ac71", "size": 3881, "ext": "py", "lang": "Python", "max_stars_repo_path": "extractor/lib/kapre/kapre/filterbank.py", "max_stars_repo_name": "rtjfarrimond/spotify-recommender", "max_stars_repo_head_hexsha": "798a0b2bb500fcc1a7165071b8d9583b69a57ae0", "max_stars_repo_licen... |
import odradio.viewfactors.viewfactors as vf
from odradio.viewfactors.viewfactors import Point,Segment
import numpy as np
from numpy import linalg as LA
from collections import namedtuple
eps = np.finfo(float).eps
Regiondata = namedtuple('Regiondata', ['name', 'start', 'end','area', 'source', 'issource'], verbose=Fal... | {"hexsha": "54d4ac2670e3e3c4d0081a84db4435b9b8dbcddc", "size": 4727, "ext": "py", "lang": "Python", "max_stars_repo_path": "radiosity/odradio/simulation/simulation.py", "max_stars_repo_name": "hptcad/radiosity", "max_stars_repo_head_hexsha": "c4a7dba3acd42c4954880d5c7314c2cda14fdd1b", "max_stars_repo_licenses": ["MIT"]... |
import unittest
import numpy as np
from model_training.regression.multi_output.multi_output_regression import MultiOutputRegression
class TestMultiOutputRegression(unittest.TestCase):
mock_classifier_index = {
0: ('additional_indemnity_money', 'int'),
1: ('declares_housing_inhabitable', 'bool'),... | {"hexsha": "9f33d24e3b55b47b160b7276980abbd73c8bd9f1", "size": 1319, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/ml_service/model_training/regression/multi_output/multi_output_regression_test.py", "max_stars_repo_name": "arekmano/JusticeAI", "max_stars_repo_head_hexsha": "a996a8903f7d05d5b5c275a1a394d0f5... |
SUBROUTINE DDR2
C
C DYNAMIC DATA RECOVERY--PART 2 --MODE ACCELERATION
C
C DMAP SEQUENCE
C
C INPUTS = 9
C
C USETD,VUD,PD,K2DD,B2DD,MDD,FRL,LLL,DM
C
C OUTPUTS = 3
C
C UAV,UEV,PAF
C
C SCRATCHES = 6
C
C PARAMETERS 1 BCD, 3INTEGERS
C
INTEGER USETD,PD,B2DD... | {"hexsha": "2bd97beaeb42aaea793fbbe1885aa5df5f5acf90", "size": 2726, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "mis/ddr2.f", "max_stars_repo_name": "ldallolio/NASTRAN-95", "max_stars_repo_head_hexsha": "6d2c175f5b53ebaec4ba2b5186f7926ef9d0ed47", "max_stars_repo_licenses": ["NASA-1.3"], "max_stars_count": 14... |
# -*- coding: utf8 -*-
# # #
# Downscale PCMDI AR5 data to a pre-processed climatology
# extent, resolution, reference system
#
# ::NOTE:: this version of DeltaDownscale is built for tmin/tmax
# data where our old method causes for the mins and max and means to
# cross each other in non-normal ways.
#
# Author: Mic... | {"hexsha": "a4b9e3e0c026fa1ff488f49a7ef39648d4e3db7e", "size": 15730, "ext": "py", "lang": "Python", "max_stars_repo_path": "downscale/ds_minmax.py", "max_stars_repo_name": "ua-snap/downscale", "max_stars_repo_head_hexsha": "3fe8ea1774cf82149d19561ce5f19b25e6cba6fb", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# pylint: disable=invalid-name
"""
Basic routines for ray tracing
To do:
* Add lenses and mirrors
* Properly document
Scott Prahl
May 2018
"""
import numpy as np
import matplotlib.pyplot as plt
__all__ = ['Plane',
'Ray',
'Sphere',
'Prism',
'Lens',
'Thin... | {"hexsha": "7ade8c22514507587ab396e81bfb7c58816b2d94", "size": 12626, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyraytrace/pyraytrace.py", "max_stars_repo_name": "scottprahl/pyraytrace", "max_stars_repo_head_hexsha": "d43d999e301dece3ffce5ce23a183ac03dadef55", "max_stars_repo_licenses": ["MIT"], "max_stars... |
module Runtests
# Run all tests with SilentNoPlot (so not plots)
using TinyModia
using Test
@time @testset verbose=true "TinyModia (with SilentNoPlot)" begin
usePlotPackage("SilentNoPlot")
include("include_all.jl")
usePreviousPlotPackage()
end
end | {"hexsha": "89cc69bd1f240ea584b373d3648cac8f75f1fc14", "size": 266, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "ModiaSim/TinyModia.jl", "max_stars_repo_head_hexsha": "ad7e71ecace8d3f7ceb0d715893bfe4e3c6500bc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 21... |
require(caret)
a <- read.csv("/Users/tom/projects-workspace/set-game/data/train-out-shape.csv", header = FALSE, col.names = c("label", "v1", "v2"))
a$label <- as.factor(a$label)
set.seed(1)
aFit <- train(label ~ ., data = a, method = "svmRadial", preProc = c("center", "scale"),
tuneLength = 10,
... | {"hexsha": "42015c3bcb168ba4bd113ad6ba2541cc5ffb3977", "size": 946, "ext": "r", "lang": "R", "max_stars_repo_path": "R/predict-shape.r", "max_stars_repo_name": "tomwhite/set-game", "max_stars_repo_head_hexsha": "535174546788d004bdfd1c17509ccc6f5736a79a", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 23,... |
import os
from sqlalchemy import create_engine
from dotenv import load_dotenv
import pandas as pd
import psycopg2
from psycopg2.extras import execute_values
import numpy as np
psycopg2.extensions.register_adapter(np.int64, psycopg2._psycopg.AsIs)
# CONNEC TO DATABASE
load_dotenv() # looks inside the .env file for so... | {"hexsha": "ea88b0fa9458bc20fd7fcab7d3340479ec909c6d", "size": 1737, "ext": "py", "lang": "Python", "max_stars_repo_path": "module2-sql-for-analysis/insert_titanic.py", "max_stars_repo_name": "masonnystrom/DS-Unit-3-Sprint-2-SQL-and-Databases", "max_stars_repo_head_hexsha": "24c7b3b3c4c78112d63817ca77d054b7c8ca4e06", "... |
PROGRAM GDRADR
C************************************************************************
C* GDRADR *
C* *
C* This program creates a RADAR mosaic grid from NEXRAD products. *
C** *
C* Log: *
C* Chiz/Unidata 3/01 Initial coding *
C* James/Unidata 2/09 Added bin mins & mstrct to CTB... | {"hexsha": "91ca644dc77a08eba392a11a5d6ef32d8d0d4f48", "size": 12996, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "gempak/source/programs/gd/gdradr/gdradr.f", "max_stars_repo_name": "oxelson/gempak", "max_stars_repo_head_hexsha": "e7c477814d7084c87d3313c94e192d13d8341fa1", "max_stars_repo_licenses": ["BSD-3-C... |
# Copyright (C) 2019 Project AGI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | {"hexsha": "af2e6ce2e68a04092de46535ef3fda02dd6f8ac3", "size": 6709, "ext": "py", "lang": "Python", "max_stars_repo_path": "rsm/datasets/mnist_sequence_dataset.py", "max_stars_repo_name": "Cerenaut/rsm", "max_stars_repo_head_hexsha": "33bf8a3a620b46b5180280f2ca5f0b28c168b806", "max_stars_repo_licenses": ["Apache-2.0"],... |
[STATEMENT]
lemma run_catch_option [simp]:
"run_option (catch_option m1 m2) = bind (run_option m1) (\<lambda>x. if x = None then run_option m2 else return x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. run_option (local.catch_option m1 m2) = bind (run_option m1) (\<lambda>x. if x = None then run_option m2 els... | {"llama_tokens": 144, "file": "Monomorphic_Monad_Monomorphic_Monad", "length": 1} |
from tensorflow.python.layers.normalization import batch_normalization
from tensorflow.python.ops.gen_nn_ops import softplus
from model.consts import Const
from model.enc import ENCRNN
import tensorflow as tf
import numpy as np
from util.helper import tf_cov
from util.losses import mmd_loss, maximum_mean_discrepancy
... | {"hexsha": "69a7de85da9c845fa546f16f916e34e136901a9b", "size": 3022, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/model/mmdae_enc.py", "max_stars_repo_name": "adezfouli/rnn_hypercoder", "max_stars_repo_head_hexsha": "a5dcbe7618400cabb08ff50ad69ff8f6241dff8d", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
export MaestroDataset, reader, @dataset_str
using Pkg.TOML
using DataDeps
using Random
using Transformers.Datasets
import Transformers.Datasets: trainfile, testfile, devfile, Mode
const dataset_configs = open(TOML.parse, joinpath(@__DIR__, "datasets.toml"))
# For clarity
macro dataset_str(name::String)
:(@datad... | {"hexsha": "33192e57d6dbfd4676a5741f931c19f14c0dd299", "size": 1883, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/datasets.jl", "max_stars_repo_name": "VasanthManiVasi/MusicModels.jl", "max_stars_repo_head_hexsha": "4724241286ea9047866c9216ac9d88fe15021446", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
C$Procedure ZZEKRD03 ( EK, read class 3 column entry elements )
SUBROUTINE ZZEKRD03 ( HANDLE, SEGDSC, COLDSC,
. RECPTR, CVLEN, CVAL, ISNULL )
IMPLICIT NONE
C$ Abstract
C
C Read a column entry from a specified record in a class 3 column.
C Class 3 col... | {"hexsha": "f83882f1d30d3f5a5ff907ec99eb28d2fb7c0ce6", "size": 12892, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "source/nasa_f/zzekrd03.f", "max_stars_repo_name": "agforero/FTFramework", "max_stars_repo_head_hexsha": "6caf0bc7bae8dc54a62da62df37e852625f0427d", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
(* Title: HOL/Algebra/Embedded_Algebras.thy
Author: Paulo Emílio de Vilhena
*)
theory Embedded_Algebras
imports Subrings Generated_Groups
begin
section \<open>Definitions\<close>
locale embedded_algebra =
K?: subfield K R + R?: ring R for K :: "'a set" and R :: "('a, 'b) ring_scheme" (structure)
d... | {"author": "seL4", "repo": "isabelle", "sha": "e1ab32a3bb41728cd19541063283e37919978a4c", "save_path": "github-repos/isabelle/seL4-isabelle", "path": "github-repos/isabelle/seL4-isabelle/isabelle-e1ab32a3bb41728cd19541063283e37919978a4c/src/HOL/Algebra/Embedded_Algebras.thy"} |
# Unit test for EOP C04 file reading
@testset "EOP C04 file reading" begin
data = loadeop(joinpath(dirname(@__DIR__),"test","input","eop_data.c04"));
@test size(data) == (11,14)
@test data[:datetime][1] == DateTime(1962,1,1)
@test data[:datetime][end] == DateTime(1962,1,11)
@test sum(data[:x]) ≈ -0.297387
@test d... | {"hexsha": "5f3faaddcb52c4954df0ef44fb7e2e046c90b121", "size": 352, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/eopfile.jl", "max_stars_repo_name": "emenems/FileTools.jl", "max_stars_repo_head_hexsha": "c1431aa2a861480e665d937bec644e07d665b9f8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
import jsonlines
import argparse
import collections
import json
import numpy as np
import os
import re
import string
import sys
OPTS = None
def normalize_answer(s):
"""Lower text and remove punctuation, articles and extra whitespace."""
def remove_articles(text):
regex = re.compile(r'\b(a|an|the)\b', ... | {"hexsha": "8f07896f517546cc2ba1a3323223f5d95725cda1", "size": 2566, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/answer_em_score.py", "max_stars_repo_name": "awslabs/durepa-hybrid-qa", "max_stars_repo_head_hexsha": "3706c983b6b23e7dbc0fab33b01ecee1a25f91f6", "max_stars_repo_licenses": ["Apache-2.0"],... |
function value = box_01_contains_point_nd ( dim_num, p )
%*****************************************************************************80
%
%% BOX_01_CONTAINS_POINT_ND determines if a point is inside a unit box in ND.
%
% Discussion:
%
% A unit box is assumed to be a rectangle with sides aligned on coordinate
% ... | {"author": "johannesgerer", "repo": "jburkardt-m", "sha": "1726deb4a34dd08a49c26359d44ef47253f006c1", "save_path": "github-repos/MATLAB/johannesgerer-jburkardt-m", "path": "github-repos/MATLAB/johannesgerer-jburkardt-m/jburkardt-m-1726deb4a34dd08a49c26359d44ef47253f006c1/geometry/box_01_contains_point_nd.m"} |
from flask import Flask, Response, render_template, request, jsonify
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from simulation import Simulation
import numpy as np
import io
import webbrowser
import json
app = Flask(__name__)
current_simulation = None
@app.route("/", methods=["GET"... | {"hexsha": "f35dac43c1a5c0473626b35f1fc6b7e22c71e782", "size": 2809, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/server.py", "max_stars_repo_name": "mbucchi/water-rocket", "max_stars_repo_head_hexsha": "4d46449fb724b52fc4f51670f4a733b56bf68024", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
# -*- coding: utf-8 -*-
import os
import numpy as np
import astropy.table
from scipy.interpolate import interp1d
from scipy.ndimage import convolve
from scipy.optimize import differential_evolution
from astropy.io import fits
from astropy.table import Table
from astropy import units as u
import matplotlib.pyplot as p... | {"hexsha": "d12166bc46b76e27593011c00488b0947ae75c06", "size": 13208, "ext": "py", "lang": "Python", "max_stars_repo_path": "ISPy/spec/calib.py", "max_stars_repo_name": "cdiazbas/ISPy", "max_stars_repo_head_hexsha": "de3f5deb2a1aa8a022f5a13d749fb6c21d08235f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "m... |
import torch
import torch.nn as nn
import numpy as np
import random
import time
from dataset import ConcatDataset, ImglistToTensor, VideoFrameDataset, HeatmapDataset
from torchvision import transforms
from torch.utils.data import DataLoader
from FER.utils import ROOT_PATH, save_to_json
import torch.nn.functional as F
... | {"hexsha": "f4e7796f80400d56dbe7187706e4d28f8241123f", "size": 9358, "ext": "py", "lang": "Python", "max_stars_repo_path": "FER/em_network/train_supervision.py", "max_stars_repo_name": "Zber5/OpenRadar", "max_stars_repo_head_hexsha": "701cf166203c3f3e1ba4873cd132a7ccba4f0863", "max_stars_repo_licenses": ["Apache-2.0"],... |
import argparse
import datetime
import gym
import numpy as np
import itertools
import torch
import json
import matplotlib.pyplot as plt
import pandas as pd
from BAC import BAC
from tensorboardX import SummaryWriter
from replay_memory import ReplayMemory
import pybullet as p2
p2.connect(p2.UDP)
import pybullet_envs
impo... | {"hexsha": "c0faa7bbcee9d8c13113f21586e77ab7faab8550", "size": 6706, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "AmmarFayad/Behavioral-Actor-Critic", "max_stars_repo_head_hexsha": "30ee138e5f10d03956aa8ac2f13fb01ab53d412b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# Ignoring some linting rules in tests
# pylint: disable=redefined-outer-name
# pylint: disable=missing-docstring
import numpy as np
import pytest
from bingo.symbolic_regression.agraph.operator_definitions import *
from bingo.symbolic_regression.agraph.evaluation_backend \
import evaluation_backend as py_eval_back... | {"hexsha": "c0f1b36e4107985e0253c6091144f0c62d3aff59", "size": 5780, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unit/symbolic_regression/agraph/evaluation_backend/test_evaluation_backend.py", "max_stars_repo_name": "nolanstr/bingo_multi_stage", "max_stars_repo_head_hexsha": "7a88c4f5c59268d0612664be58... |
#include <iostream>
#include <ostream>
#include <limits>
#include <boost/test/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/range/adaptor/indexed.hpp>
#include <SFML/Graphics.hpp>
#include "../src/Vehicle.h"
#include "../src/VehicleFactory.h"
#include "../src/TTUtils.h"
#include "../src/Int... | {"hexsha": "1756630ec365d44d2137fa6e9bdb0edb9a901a3a", "size": 11989, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/test_misc.cpp", "max_stars_repo_name": "zethon/ttvg", "max_stars_repo_head_hexsha": "51d79ee3154669447dd522731aa0f7057e723abd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2.0, "ma... |
module TestVar
using Base.Test
using Bio.Seq
using Bio.Var
@testset "Counting mutations" begin
# Create a 20bp test DNA sequence pair containing every possible transition (4),
# every possible transversion (8), and 2 gapped sites and 2 ambiguous sites.
# This leaves 4 sites non-mutated/conserved.
dn... | {"hexsha": "e2e8cdaf1fd3760dde768ce2921e33d5b53131ed", "size": 6524, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/var/runtests.jl", "max_stars_repo_name": "JuliaPackageMirrors/Bio.jl", "max_stars_repo_head_hexsha": "ad78989811179dc1fd314479f45311b90954d986", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# -*- coding:utf8 -*-
r'''
TODO: remove all tensorflow graph construction in `build_op_info`
'''
import os
import numpy as np
import idx2numpy as idx2np
import tensorflow as tf
from utensor_cgen.ir import OperationInfo, TensorInfo
from utensor_cgen.ir.converter import (AttrValueConverter, DataTypeConverter,
... | {"hexsha": "4f7f939a65964f9c1af988a3620892d451aa3135", "size": 46951, "ext": "py", "lang": "Python", "max_stars_repo_path": "utensor_cgen/backend/operators.py", "max_stars_repo_name": "dboyliao/utensor_cgen", "max_stars_repo_head_hexsha": "aacd3adf4ee2a521a8eb2e75807fe3c1c0d1e1e5", "max_stars_repo_licenses": ["Apache-2... |
# Tetracene exemaple
from kimonet.system.generators import regular_system, crystal_system
from kimonet.analysis import Trajectory, visualize_system, TrajectoryAnalysis, plot_polar_plot
from kimonet import system_test_info
from kimonet.system.molecule import Molecule
from kimonet.system.state import State
from kimonet.c... | {"hexsha": "3761df82bb82ef6760397869453f57fd0da89c9e", "size": 8456, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/singlet_fission.py", "max_stars_repo_name": "abelcarreras/kimonet", "max_stars_repo_head_hexsha": "1b3b3af8f6a67ed5d99990e54d295f395ad4b994", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import numpy as np
from xray import Dataset, Variable, Coordinate
from xray.core import indexing, variable
from . import TestCase, ReturnItem
class TestIndexers(TestCase):
def set_to_zero(self, x, i):
x = x.copy()
x[i] = 0
return x
def test_expanded_indexer(self):
x = np.rand... | {"hexsha": "22809669a3e045bab7f0d7101cb0f0ff5e4a44c8", "size": 5589, "ext": "py", "lang": "Python", "max_stars_repo_path": "xray/test/test_indexing.py", "max_stars_repo_name": "eriknw/xray", "max_stars_repo_head_hexsha": "19df8d202b1d8054019e7e42365c67cdde6ff448", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
[STATEMENT]
lemma differing_vars_subst [rule_format]:
assumes dom\<sigma>: "dom \<sigma> \<supseteq> differing_vars mem\<^sub>1 mem\<^sub>2"
shows "mem\<^sub>1 [\<mapsto> \<sigma>] = mem\<^sub>2 [\<mapsto> \<sigma>]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. subst \<sigma> mem\<^sub>1 = subst \<sigma> mem\<... | {"llama_tokens": 621, "file": "SIFUM_Type_Systems_Compositionality", "length": 7} |
import pandas as pd
import numpy as np
import math
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils.validation import check_array, check_is_fitted
def fourier_sin_encoding(series, max_val, n=1):
return np.sin((series / max_val) * (2 * math.pi * n))
def fourier_cos_encoding(series, max... | {"hexsha": "e1a3d65209832299054ad0d18a4ae59e0c7f15ba", "size": 5028, "ext": "py", "lang": "Python", "max_stars_repo_path": "skautobots/date_processing/_date_fourier.py", "max_stars_repo_name": "ccastleberry/sk-autobots", "max_stars_repo_head_hexsha": "7aaee0faa6383fbefaef1509cfc87010d2c58b84", "max_stars_repo_licenses"... |
A little email etiquette goes a long way. See also UCD Classroom Etiquette.
From (undergraduate) student to instructor:
Start the email with Dear Prof. Smith or wiki:wikipedia Indiana Jones Dear Dr. Jones, as appropriate unless they have told you otherwise. Some faculty, particularly in the sciences, dont mind b... | {"hexsha": "47a039fe75200b07f1a7240e7fa81040fba2bfb8", "size": 6701, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/UCD_Email_Etiquette.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_star... |
"""Disagg benchmark tests"""
import os
import pathlib
import yaml
import pytest
import numpy as np
import pandas as pd
from gmhazard_calc import disagg
from gmhazard_calc import site
from gmhazard_calc import gm_data
from gmhazard_calc import constants
from gmhazard_calc.im import IM, IM_COMPONENT_MAPPING
@pytest.f... | {"hexsha": "7daa87afc29b12d1a904ae6d20aad89bc037edd1", "size": 4779, "ext": "py", "lang": "Python", "max_stars_repo_path": "calculation/gmhazard_calc/gmhazard_calc/test/test_disagg_bench.py", "max_stars_repo_name": "ucgmsim/gmhazard", "max_stars_repo_head_hexsha": "d3d90b4c94b3d9605597a3efeccc8523a1e50c0e", "max_stars_... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Traffic Generators Survey}\label{ap:traffic-gen-survey}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{In... | {"hexsha": "1c34ea9993e4a6502004166525f93fcc7a0f4c71", "size": 56459, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/appendix/appendixC.tex", "max_stars_repo_name": "AndersonPaschoalon/MasterDegreeThesis-ptBr", "max_stars_repo_head_hexsha": "e4cbf752deecf124aa0adfc630d510645d8c4ea6", "max_stars_repo_licenses... |
[STATEMENT]
lemma sqrt_nat_ceiling[simp]: "sqrt_nat_ceiling x = \<lceil> sqrt (real x) \<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sqrt_nat_ceiling x = \<lceil>sqrt (real x)\<rceil>
[PROOF STEP]
unfolding sqrt_nat_ceiling_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. root_nat_ceiling 2 x = \<lce... | {"llama_tokens": 172, "file": "Sqrt_Babylonian_Sqrt_Babylonian", "length": 2} |
[STATEMENT]
theorem three_divides_nat:
shows "(3 dvd n) = (3 dvd sumdig n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (3 dvd n) = (3 dvd sumdig n)
[PROOF STEP]
proof (unfold sumdig_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. (3 dvd n) = (3 dvd (\<Sum>x<nlen n. n div 10 ^ x mod 10))
[PROOF STEP]
hav... | {"llama_tokens": 1122, "file": null, "length": 10} |
function bob(stimulus::AbstractString)
stimulus = strip(stimulus)
if issilence(stimulus)
return "Fine. Be that way!"
elseif isshouting(stimulus)
return "Whoa, chill out!"
elseif isquestion(stimulus)
return "Sure."
else
return "Whatever."
end
end
issilence(stimul... | {"hexsha": "a38470e120712a2797ac60410a35a98b61dae1f2", "size": 720, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "exercises/bob/example.jl", "max_stars_repo_name": "miguelraz/julia-1", "max_stars_repo_head_hexsha": "ef059b088e967251b3180820ac4d2768f1b0ac85", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import requests
from astroquery.simbad import Simbad
import numpy as np
import pandas as pd
from astropy.table import QTable, Table, Column
from astropy import units as u
import urllib
import re
import bs4
import math
import matplotlib.pyplot as plt
def plot(star_name):
# Convert the names of stars to HIP numbers... | {"hexsha": "e1d1d763bfc8803ba66a124f5c135582b64948ac", "size": 2362, "ext": "py", "lang": "Python", "max_stars_repo_path": "hipy/plot_lightcurve.py", "max_stars_repo_name": "Yifan-Xuan/hipy", "max_stars_repo_head_hexsha": "dd569b89d6d246ea8444182a7e0f8dc7d3381c4b", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
from load_grid import LoadSudokuGrid
from visualize_results import Visualize
from sudoku_solver import SudokuSolver
import numpy as np
if __name__ == '__main__':
user_grid = LoadSudokuGrid().grid
if user_grid is not None:
solved_grid = SudokuSolver(np.array([[element for element in row] for row in user... | {"hexsha": "7a9b676afb466a994b873f991ea30dfafe40b10f", "size": 433, "ext": "py", "lang": "Python", "max_stars_repo_path": "RUN.py", "max_stars_repo_name": "MAXIORBOY/SudokuSolver", "max_stars_repo_head_hexsha": "9046feda159ff32613e9c02f5f6f21a57f09ef23", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2004-2011. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interpr... | {"hexsha": "2870c4d55062767457b34e26787df7770573f157", "size": 11355, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "libs/interprocess/test/mutex_test_template.hpp", "max_stars_repo_name": "AishwaryaDoosa/Boost1.49", "max_stars_repo_head_hexsha": "67bdb3b36d72dec7414a62f3b050162e608ea266", "max_stars_repo_license... |
#' Get document revisions.
#'
#' @export
#' @template all
#' @template return
#' @param dbname Database name
#' @param docid Document ID
#' @param simplify (logical) Simplify to character vector of revision ids.
#' If \code{FALSE}, gives back availabilit info too. Default: \code{TRUE}
#' @examples \dontrun{
#' (x <- Cu... | {"hexsha": "de194b573b268f512512d6efc99983e410603067", "size": 1330, "ext": "r", "lang": "R", "max_stars_repo_path": "R/revisions.r", "max_stars_repo_name": "FTwex/sofa-cloudant", "max_stars_repo_head_hexsha": "097577be2446865e17d41bcb015141eed19c7139", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
# -*- coding: utf-8 -*-
from jplephem.spk import SPK
import jdcal
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
mu=398600.4418
tof=30.*60.
x0 = np.array([6045,3490,0])
vC=np.array([-2.457,6.618,2.533])
x1=np.array([12214.839, 10249.467, 2000])
v1=np.array([-3.448, .924,... | {"hexsha": "f5619256691888f18e8190bd8416e381aa81a12d", "size": 1521, "ext": "py", "lang": "Python", "max_stars_repo_path": "Porkchop Plot/lambertTest.py", "max_stars_repo_name": "gereshes/Blog-Companion", "max_stars_repo_head_hexsha": "2598da9cbd5de1ac4aadee90a165c9b833496b6b", "max_stars_repo_licenses": ["MIT"], "max_... |
\documentclass{article}
\usepackage[margin=0.75cm]{geometry}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{float}
\usepackage{caption}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage[lofdepth,lotdepth]{subfig}
\title{OrpailleCC: a Library for Data Stream Analysis on Embedded Systems}
\author{Martin Kha... | {"hexsha": "4b7230b7087c978fa878d83bbd4a44f381ea3970", "size": 3629, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "paper/paper.tex", "max_stars_repo_name": "codacy-badger/OrpailleCC", "max_stars_repo_head_hexsha": "1b822d39160c359ee9576b8a2d0d8abc2e2785eb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
#include "geometrycentral/arap.h"
#include <Eigen/SparseCholesky>
#include <Eigen/SVD>
#include <Eigen/Dense>
using namespace geometrycentral;
ARAP::ARAP(HalfedgeMesh* m, Geometry<Euclidean>* g) : mesh(m), geom(g), vertexIndices(mesh), isoTriangleParam(mesh), uvCoords(mesh) {
vertexIndices = mesh->getVertexIndices... | {"hexsha": "1b8f3e544e71a595a1c9784891a9bffb5f94b8d6", "size": 7499, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/arap.cpp", "max_stars_repo_name": "connorzl/geometry-central", "max_stars_repo_head_hexsha": "99114ffaf3efb58c912f94402dd0426cbb17d3f1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
using .SnakeGames
function SnakeGameEnv(; action_style = MINIMAL_ACTION_SET, kw...)
game = SnakeGame(; kw...)
n_snakes = length(game.snakes)
num_agent_style = n_snakes == 1 ? SINGLE_AGENT : MultiAgent{n_snakes}()
SnakeGameEnv{action_style,num_agent_style,typeof(game)}(
game,
map(length,... | {"hexsha": "df3a9e87f98266945bb87064756db04df377043a", "size": 2712, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ReinforcementLearningEnvironments/src/environments/3rd_party/snake.jl", "max_stars_repo_name": "LaarsOman/ReinforcementLearning.jl", "max_stars_repo_head_hexsha": "b04e3f192e71418dbca496331ada4... |
\subsubsection{Scalable Nonparametric Directed Graphical Model Inference
and Learning}
Author: Kai Londenberg (Kai.Londenberg@gmail.com), June 2014
\paragraph{Abstract}
This short article tries to give an overview over complementary
techniques over MCMC for general inference in arbitrary directed
probabilistic graph... | {"hexsha": "a5f43929ab5a409092aebe44a49cd6c4737e6151", "size": 25160, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/Large Scale PGM Inference.tex", "max_stars_repo_name": "kadeng/pypgmc", "max_stars_repo_head_hexsha": "909445fa3a426b07b39b65d2cb8979b1db8cdfca", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
import pandas as pd
import numpy as np
import tensorflow as tf
from sklearn import metrics
from sklearn import model_selection
from sklearn.model_selection import train_test_split
import keras as K
from keras.utils.np_utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense, Drop... | {"hexsha": "fc5df4941c5996d48efc11be8dc72df5589a1135", "size": 5661, "ext": "py", "lang": "Python", "max_stars_repo_path": "99_743/mnist-2.py", "max_stars_repo_name": "kozistr/MNIST-Competition", "max_stars_repo_head_hexsha": "dbe899774c52f82454034f9e372960c0daeb4b7c", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
[STATEMENT]
lemma happens_before_new_actionD:
assumes hb: "P,E \<turnstile> a \<le>hb a'"
and new: "is_new_action (action_obs E a')"
shows "is_new_action (action_obs E a)" "action_tid E a = action_tid E a'" "a \<le> a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. is_new_action (action_obs E a) &&& action_ti... | {"llama_tokens": 6144, "file": "JinjaThreads_MM_JMM_Spec", "length": 31} |
#!/usr/bin/env python
import click
import numpy as np
import gym
def chakra_get_action(theta, ob, rng=np.random):
ob_1 = include_bias(ob)
mean = theta.dot(ob_1)
return rng.normal(loc=mean, scale=1.)
@click.command()
@click.argument("env_id", type=str, default="chakra")
def main(env_id):
# Registe... | {"hexsha": "228e03502d209d7b6bf7ff67f1d34321cafa824a", "size": 1280, "ext": "py", "lang": "Python", "max_stars_repo_path": "Assignment_2/Ques/rollout.py", "max_stars_repo_name": "pragneshrana/Reinforcement-Learning", "max_stars_repo_head_hexsha": "6d891ff42437eec828e97cbbd2ad53fb112aad9e", "max_stars_repo_licenses": ["... |
#!/usr/bin/env python3
"""Generate a test model for frugally-deep.
"""
import numbers
import sys
import numpy as np
import keras
from keras.models import Model, load_model, Sequential
from keras.layers import Input, Dense, Dropout, Flatten, Activation
from keras.layers import Conv1D, ZeroPadding1D, Cropping1D
from k... | {"hexsha": "3153385f3db6bb1da050dbcee82d232bfe6e1f03", "size": 13741, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/libfdeep/keras_export/generate_test_models.py", "max_stars_repo_name": "Telecommunication-Telemedia-Assessment/V-BMS360", "max_stars_repo_head_hexsha": "0c974451cfb9e75e20de292dcdeae11104260b... |
[STATEMENT]
lemma valofn_le_imp_exponent_le:
fixes x y :: "('e, 'f) float"
assumes "valofn x \<le> valofn y"
shows "exponent x \<le> exponent y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. IEEE.exponent x \<le> IEEE.exponent y
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1... | {"llama_tokens": 1135, "file": "MFODL_Monitor_Optimized_Code_Double", "length": 14} |
%!TeX root = scan_converter
\documentclass[paper.tex]{subfiles}
\begin{document}
\section{Scan converter}
\begin{autem}
This is an example of how the course of action can be distorted by engineering. In a non-pandemic scenario such a diversion might have been a reasonable. Indefensible. I am consoled that it did not ... | {"hexsha": "93e72205d351d4af5914a158db9abf0770d0468c", "size": 6134, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "documents/scan_converter.tex", "max_stars_repo_name": "0xDBFB7/covidinator", "max_stars_repo_head_hexsha": "e9c103e5e62bc128169400998df5f5cd13bd8949", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma Sup_real_close:
fixes e :: real
assumes "0 < e"
and S: "bdd_above S" "S \<noteq> {}"
shows "\<exists>x\<in>S. Sup S - e < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>x\<in>S. Sup S - e < x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<exists>x\<in... | {"llama_tokens": 2563, "file": "Complex_Bounded_Operators_extra_Extra_General", "length": 30} |
# O(n^3) matrix multiplication
import time
import numpy as np
def matrixmul(A,B):
I,K = A.shape
J = B.shape[1]
C = np.zeros((I,J), dtype=A.dtype)
for i in range(I):
for j in range(J):
for k in range(K):
C[i,j] += A[i,k]*B[k,j]
return C
A = np.array([[1,2,3... | {"hexsha": "5d2a4e032f092beed5e48dd237c40aaf9fbec5b5", "size": 617, "ext": "py", "lang": "Python", "max_stars_repo_path": "chapter_05/matrixmul.py", "max_stars_repo_name": "rkneusel9/MathForDeepLearning", "max_stars_repo_head_hexsha": "8db1a85ce3cef4b48aab01ebe156e3fab2dfa271", "max_stars_repo_licenses": ["MIT"], "max_... |
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ
# SPDX-FileCopyrightText: 2021 Janek Groehl
# SPDX-License-Identifier: MIT
from simpa.utils import Tags, Settings
from simpa.utils.tissue_properties import TissueProperties
from simpa.io_handling import load_data_field, save_data_field
from s... | {"hexsha": "bc24bef7364a70cd58b2d35a000d77241b14b207", "size": 5333, "ext": "py", "lang": "Python", "max_stars_repo_path": "simpa/core/processing_components/monospectral/field_of_view_cropping.py", "max_stars_repo_name": "IMSY-DKFZ/simpa", "max_stars_repo_head_hexsha": "b8bddcf43a4bff2564f0ec208dc511b82e49bfb4", "max_s... |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
#include... | {"hexsha": "830614a45c5ea386e9af5ecaf29158affe7dcd18", "size": 30966, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/prod/src/data/utilities/ConcurrentHashTable.StressTest.cpp", "max_stars_repo_name": "gridgentoo/ServiceFabricAzure", "max_stars_repo_head_hexsha": "c3e7a07617e852322d73e6cc9819d266146866a4", "m... |
import math
import random
import collections
import numpy as np
from scipy import sparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from .. import BaseModel, register_model
class GraphConvolution(nn.Module):
"""
Simple GCN layer, similar to htt... | {"hexsha": "b444d9409896fce67158efe333cd99592ee3cccf", "size": 6308, "ext": "py", "lang": "Python", "max_stars_repo_path": "cogdl/models/nn/asgcn.py", "max_stars_repo_name": "xssstory/cogdl", "max_stars_repo_head_hexsha": "ae8de495c365993f19f04774f083960fd282c2a3", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import numpy as np
import homog as hg
try:
from glumpy.api.matplotlib import *
from glumpy.transforms import *
_have_glumpy = True
except ImportError:
_have_glumpy = False
try:
import matplotlib.pyplot as plt
_have_matplotlib = True
except ImportError:
_have_matplotlib = False
def scatter(*ar... | {"hexsha": "672dba03a34f1e4f63e2fb6417b046992003971a", "size": 1420, "ext": "py", "lang": "Python", "max_stars_repo_path": "worms/vis/plot.py", "max_stars_repo_name": "abiedermann/worms", "max_stars_repo_head_hexsha": "026c45a88d5c71b0e035ac83de6f4dc107316ed8", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 1 19:57:03 2018
@author: 39105
"""
import os #only convenient for clusters of files
import numpy as np
import re
import shutil
import pandas as pd
path=r'C:\Users\39105\Downloads\精确控制频率\new_folder\新建文件夹\results'
pattern=r"\d+\.\d*"
pd.set_option('precisi... | {"hexsha": "2d5d9a21da3db86a1343a8f5f4602f2fee9e5bd6", "size": 1338, "ext": "py", "lang": "Python", "max_stars_repo_path": "trivial data analysis/txt2excel.py", "max_stars_repo_name": "Nemo-Cartman/trivial_data_analysis", "max_stars_repo_head_hexsha": "d3494d1dd301dc11b6c752011e4661d01c43ff14", "max_stars_repo_licenses... |
subroutine lmn_output(a,itask)
use typre
use Mod_Postpr
use Mod_Stream
use Mod_LowMach
implicit none
class(LowMachProblem) :: a
integer(ip) :: ndime,itask
integer(ip), save :: dopost(12)
interface
subroutine nsi_outtpo(a)
use typre
import LowMachProblem
... | {"hexsha": "35e8e6f1f55969a994d7b02e12789d65f1c5b0b9", "size": 2601, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Sources/modules/lmachn/lmn_output.f90", "max_stars_repo_name": "ciaid-colombia/InsFEM", "max_stars_repo_head_hexsha": "be7eb35baa75c31e3b175e95286549ccd84f8d40", "max_stars_repo_licenses": ["MIT... |
import numpy as np
import pandas as pd
import re
def one_hot_encode_vector(x, dict_size):
a = np.array(x)
v = np.zeros((dict_size, len(x)))
v[a, np.arange(len(x))] = 1
return v
def one_hot_encode_matrix(A, dict_size):
return np.array([one_hot_encode_vector(x, dict_size)
for... | {"hexsha": "94eb75da45616b2e35b1e042e58c1f1e5fc0ff7d", "size": 3670, "ext": "py", "lang": "Python", "max_stars_repo_path": "nplm/data_manipulation.py", "max_stars_repo_name": "willyrv/nplm", "max_stars_repo_head_hexsha": "1ab35a1aa447572f35704787c3765f00fe3280f6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- The identity function
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Function.Construct.Identity where
open import Data.Product using (_,_)
o... | {"hexsha": "2207a5789894e6497f96028bb47d708c27d0845e", "size": 4077, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "agda-stdlib/src/Function/Construct/Identity.agda", "max_stars_repo_name": "DreamLinuxer/popl21-artifact", "max_stars_repo_head_hexsha": "fb380f2e67dcb4a94f353dbaec91624fcb5b8933", "max_stars_repo_... |
from ..stats import irr, sequence
import itertools
import numpy
import pandas
import unittest
class SequenceTest(unittest.TestCase):
def setUp(self) -> None:
pass
def tearDown(self) -> None:
pass
def test_transition_matrix(self):
# Test that works as expected with a list, no fi... | {"hexsha": "3043fbbaf2fe57a722cfe76b13b80539cf2656c4", "size": 4180, "ext": "py", "lang": "Python", "max_stars_repo_path": "caastools/tests/test_stats.py", "max_stars_repo_name": "Awesomium40/caastools", "max_stars_repo_head_hexsha": "acfae5e9117f0d9a49ebf78fd20c471070cf3915", "max_stars_repo_licenses": ["MIT"], "max_s... |
[STATEMENT]
lemma Digamma_real_three_halves_pos: "Digamma (3/2 :: real) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. 0 < Digamma (3 / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. 0 < Digamma (3 / 2)
[PROOF STEP]
have "-Digamma (3/2 :: real) = -Digamma (of_nat 1 + 1/2)"
[PROOF STAT... | {"llama_tokens": 1218, "file": null, "length": 14} |
import numpy as np
from typing import Callable
def SimulatedAnnealing(cost_function, x0=0, alpha=0.01, T0=100, Tf=1, neighbourhood_sigma=1, find_max=False, maxiter=1000000):
iteration=0
if alpha < 0 or alpha>1:
print("alpha should be between 0 and 1")
return None
x = x0
x_cost = cost_function(x)
if find_max ... | {"hexsha": "09bf9ea9e6cc3ae1765d42852d954e87ef3438d8", "size": 1090, "ext": "py", "lang": "Python", "max_stars_repo_path": "simulatedAnnealing.py", "max_stars_repo_name": "caldasdeoliveira/simulatedAnnealing", "max_stars_repo_head_hexsha": "7802001cc11147654412e854b53f504e58d8d5e0", "max_stars_repo_licenses": ["MIT"], ... |
[STATEMENT]
lemma length_remdups_less_eq:
assumes "set xs \<subseteq> set ys"
shows "length (remdups xs) \<le> length (remdups ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. length (remdups xs) \<le> length (remdups ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> set ... | {"llama_tokens": 189, "file": "Regular_Tree_Relations_Tree_Automata_Tree_Automata_Pumping", "length": 2} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.