text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File for testing SSD 7 model
"""
from tensorflow import keras
K = keras.backend
Input = keras.layers.Input
Model = keras.models.Model
Progbar = keras.utils.Progbar
Adam = keras.optimizers.Adam
CSVLogger = keras.callbacks.CSVLogger
ModelCheckpoint = keras.callbacks.Mo... | {"hexsha": "1d957d9277fe8b42e0dc8899243950b6c3b13e4e", "size": 5787, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_ssd7.py", "max_stars_repo_name": "stanley-king/ssd_kerasex", "max_stars_repo_head_hexsha": "54100732342076815113b48c1720898a70f6806e", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co... |
import json
import numpy as np
import pandas as pd
from sklearn import preprocessing
from sklearn import model_selection
df = pd.read_csv(r'/home/rahul/Workspace/Maa ji for Bachelor/functionalities/Pulse Classification/req_files/dataset.csv')
''' K - Fold validation '''
K = 5 # 5 Folds
df = df.sample(frac=1).rese... | {"hexsha": "cafb7cddbce7efe8db164e2f76c70b6415ab97ec", "size": 1476, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/get_folds.py", "max_stars_repo_name": "RsTaK/pulses-classification", "max_stars_repo_head_hexsha": "e8d2b2f753dbecf93424e5b8ac273b896a5234b5", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import numpy
from math import *
#radius of Earth in meters
R = 6371000
#returns the spherical distance between two coordinates in given in lat,lon
#result should be multiplied by R for the actual distance in meters
def distance(lat1, lon1, lat2, lon2):
dlat = lat2-lat1
dlon = lon2-lon1
#using haversine f... | {"hexsha": "cfe8b2f14b082a1a5480008202c5af0ac9b721c3", "size": 1190, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/omuse/community/cdo/spherical_geometry.py", "max_stars_repo_name": "ipelupessy/omuse", "max_stars_repo_head_hexsha": "83850925beb4b8ba6050c7fa8a1ef2371baf6fbb", "max_stars_repo_licenses": ["Ap... |
'''
Scalar and Block tridiagonalized matrices.
Also, there is some uitlities in this module that will help us build tridiagonal matrices.
A <TridMatrix> and it's derivatives can be parse to csr/coo matrices and array freely.
Some other matrix types are also supported.
In the following description, we take p -> the b... | {"hexsha": "214c2d9ef0d1d55a28e8a46489bcfa54515d5123", "size": 10603, "ext": "py", "lang": "Python", "max_stars_repo_path": "trid.py", "max_stars_repo_name": "GiggleLiu/tridmat", "max_stars_repo_head_hexsha": "c413a39efdd4ff5ab1dcd4da48891fcb2653e72a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s... |
[STATEMENT]
lemma Mignotte_bound:
shows "of_int \<bar>coeff g k\<bar> \<le> (degree g choose k) * mahler_measure g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
proof (cases "k \<le> degree g \<and> g \<noteq> ... | {"llama_tokens": 5792, "file": "Berlekamp_Zassenhaus_Factor_Bound", "length": 42} |
#!/usr/bin/env python3
"""
Recipe for training a Voice Activity Detection (VAD) model on LibriParty.
This code heavily relis on data augmentation with external datasets.
(e.g, open_rir, musan, CommonLanguge is used as well).
Make sure you download all the datasets before staring the experiment:
- LibriParty: https://d... | {"hexsha": "ea16333d1a91da85fde178bd384f3fadd47c7c3b", "size": 9125, "ext": "py", "lang": "Python", "max_stars_repo_path": "recipes/LibriParty/VAD/train.py", "max_stars_repo_name": "JasonSWFu/speechbrain", "max_stars_repo_head_hexsha": "cb78ba2b33fceba273b055dc471535344c3053f0", "max_stars_repo_licenses": ["Apache-2.0"... |
from tensorflow.python.keras.layers import Input, AveragePooling2D, Dense, Conv2D, Flatten
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.datasets import cifar10
from tensorflow.python.keras.utils.np_utils import to_categorical
from tensorflow.python.keras.preprocessing.image import Image... | {"hexsha": "4b3a2a842307aa6a7cda94cbde5a977e948fb70f", "size": 2837, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/CustomKerasLayers/tests/DenseBlockCifar10.py", "max_stars_repo_name": "Zelgunn/Video-Latent-Lerp", "max_stars_repo_head_hexsha": "c479a26c0be5174543268667bde09f1154d2ff79", "max_stars_repo_li... |
import numpy as np
from baseline.remote import RemoteModelREST, RemoteModelGRPC, register_remote
def _convert(data):
if isinstance(data, np.ndarray):
return data
return np.array(data)
@register_remote('http')
class RemoteModelRESTPytorch(RemoteModelREST):
"""JSON schema:
{
"... | {"hexsha": "0230c7ab3a1a2751a5314bd941b127e18760c92f", "size": 2572, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/baseline/pytorch/remote.py", "max_stars_repo_name": "domyounglee/baseline", "max_stars_repo_head_hexsha": "2261abfb7e770cc6f3d63a7f6e0015238d0e11f8", "max_stars_repo_licenses": ["Apache-2.0... |
[STATEMENT]
lemma PO_m1_step5_refines_ir_a0i_running:
"{R_a0im1_ir}
(a0i_running [A, B] (Kab, Nb)), (m1_step5 Rb A B Nb Kab)
{> R_a0im1_ir}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. {R_a0im1_ir} a0i_running [A, B] (Kab, Nb), m1_step5 Rb A B Nb Kab {> R_a0im1_ir}
[PROOF STEP]
by (simp add: PO_rhoare... | {"llama_tokens": 208, "file": "Security_Protocol_Refinement_Key_establish_m1_nssk", "length": 1} |
[STATEMENT]
lemma rem_cycles_subs: "set (rem_cycles i j xs) \<subseteq> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. set (rem_cycles i j xs) \<subseteq> set xs
[PROOF STEP]
by (meson order_trans remove_all_cycles_subs remove_all_subs remove_all_rev_subs) | {"llama_tokens": 110, "file": "Floyd_Warshall_Floyd_Warshall", "length": 1} |
import pickle
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from mc_lib.observable import RealObservable, block_stats
def test_simple():
r = RealObservable()
lst = list(range(4096))
for val in lst:
r.add_measurement(val)
assert_allclose(r.mean,
... | {"hexsha": "d9db95e946d77eb85b3a2b667444a442d44c8533", "size": 2027, "ext": "py", "lang": "Python", "max_stars_repo_path": "mc_lib/tests/test_observable.py", "max_stars_repo_name": "MoskalenkoRomanBorisovich/mc_lib", "max_stars_repo_head_hexsha": "024e82cdeb214a76d8b2157de1de6537cd0277ab", "max_stars_repo_licenses": ["... |
#Daniel Sand
import numpy as np
from sklearn import metrics
from sklearn.metrics import classification_report, roc_curve, precision_recall_curve, roc_auc_score, auc, make_scorer, recall_score, accuracy_score, precision_score, confusion_matrix
import pandas as pd
def ROC_LOO_binary(ylabels, scores):
from sk... | {"hexsha": "8cc7d11ae68ce6b597f7fdd46f761e437c06f36a", "size": 8445, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python/Functions_base/Functions/AUC_func.py", "max_stars_repo_name": "DanielHuji-RB/RB-article", "max_stars_repo_head_hexsha": "e5a9ba30edfb030db1cd3bcf562c6abff3f9d48e", "max_stars_repo_licenses"... |
# -*- coding: utf-8 -*-
import numpy as np, arviz as az, matplotlib.pyplot as plt
from cmdstanpy import CmdStanModel
rng = np.random.default_rng(seed = 123) # newly introduced type of random generator
pA, N = .05, 1500
occurrences = rng.binomial(N, pA)
mdl_data = {"N": N, "occur": occurrences}
modelfile = ... | {"hexsha": "389d4186082a8d4f993aa725a8f6130a42571165", "size": 1534, "ext": "py", "lang": "Python", "max_stars_repo_path": "STANchap2ex2.py", "max_stars_repo_name": "phineas-pta/Bayesian-Methods-for-Hackers-using-PyStan", "max_stars_repo_head_hexsha": "d708faab0fdd43800e8726e2c6dd99452c8dcedb", "max_stars_repo_licenses... |
# David R Thompson
import numpy as np
# OSF seam channels
osf_seam_positions = ((187,189),)
# Number of basis vectors used to describe EMIT nonlinearity
linearity_nbasis = 2
# The columns on either side of the FPA are masked.
last_masked_col_left, first_masked_col_right = 9, 1272
# The first and last represent the ... | {"hexsha": "b52ee0751f6e317aea029594162bb46b7271a66a", "size": 2724, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/emit_fpa.py", "max_stars_repo_name": "emit-sds/emit-sds-l1b", "max_stars_repo_head_hexsha": "be5307fe6821a043971becdd33609b4cf89b1974", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <boost/asio.hpp>
#include <chrono>
using boost::asio::ip::tcp;
int numChannelsToTest = 1;
int sendCommand(const char* ip, const char* port, const char* command, size_t command_length)
{
try
{
boost::asio::io_service io_service;
tcp::sock... | {"hexsha": "dec3609aa2d17aadd4145e1816fc0546c392386f", "size": 1223, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "ui.cpp", "max_stars_repo_name": "mikeepiazza/NETS", "max_stars_repo_head_hexsha": "107ddfb11747605380c3cb1caaafc8fc4ba476b4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2.0, "max_stars_r... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
# @author : biao chen
# @Email : chenbiao@sleepace.net
# @Project : Python_Files
# @File : utils.py
# @Software: PyCharm
# @Time : 2021/5/20 下午7:42
"""
import os
import struct
import sys
import time
import traceback
from datetime import datetime
from pathlib import Path
i... | {"hexsha": "79f107653e5a7204965621d15204397792defbbd", "size": 35471, "ext": "py", "lang": "Python", "max_stars_repo_path": "slp_utils/utils.py", "max_stars_repo_name": "66chenbiao/sleepace_verification_tool", "max_stars_repo_head_hexsha": "6271312d9d78ee50703e27a75787510cab4c7f4d", "max_stars_repo_licenses": ["Apache-... |
import pandas as pd
import seaborn as sns
import numpy as np
from skforecast.ForecasterAutoreg import ForecasterAutoreg
from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
from skforecast.ForecasterAutoregMultiOutput import ForecasterAutoregMultiOutput
from skforecast.model_selection import gri... | {"hexsha": "e06c988db6714a9b2c1fc8ad0ac22bdc5d1ba77f", "size": 4539, "ext": "py", "lang": "Python", "max_stars_repo_path": "EApp/predictions.py", "max_stars_repo_name": "eljimenezj/Team_51_DS4A_2021", "max_stars_repo_head_hexsha": "6f8e1fca0962e1698e4b533fee6eabd36abea1cf", "max_stars_repo_licenses": ["MIT"], "max_star... |
#%% Necessary Dependencies
import numpy as np
import logging
import yaml
try:
import matplotlib.pyplot as plt
matplot=True
except(ImportError):
logging.warning(f'no matplotlib, debug plotting disabled')
matplot=False
from hexrd.grainmap import nfutil
from hexrd.grainmap import tomoutil
from hexrd ... | {"hexsha": "8f2bcdb813ed6cd614d62c685c35c1f2a8bb3dcb", "size": 7979, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/preprocess_tomo_mask.py", "max_stars_repo_name": "cjh1/hexrd", "max_stars_repo_head_hexsha": "057deee3e9d9beb09a30aac8ed263eff3febf3ec", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
@testset "Unification" begin
# Test unification of constant with zero-arity compound
subst = unify(@julog(constant), @julog(constant()))
@test subst == @varsub {}
# Test unification of nested terms
subst = unify(@julog(f(g(X, h(X, b)), Z)), @julog(f(g(a, Z), Y)))
@test subst == @varsub {X => a, Z => h(a, b), Y => h(a... | {"hexsha": "5f946e604c9ef72ca3b53333fa97eaad5a1583c7", "size": 1988, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/unify.jl", "max_stars_repo_name": "Herb-AI/Julog.jl", "max_stars_repo_head_hexsha": "490646ca15ec3dd93fb69443d003b988576b5259", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 4,... |
"""
Copyright 2013 Steven Diamond and Xinyue Shen.
This file is part of CVXPY.
CVXPY 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 3 of the License, or
(at your option) any later version.
CVXPY... | {"hexsha": "3f0786fc627760047e109583953e81527e9c2991", "size": 1824, "ext": "py", "lang": "Python", "max_stars_repo_path": "cvxpy/transforms/linearize.py", "max_stars_repo_name": "quantopian/cvxpy", "max_stars_repo_head_hexsha": "7deee4d172470aa8f629dab7fead50467afa75ff", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
import networkx as nx
import numpy
import pytest
from nereid.src.land_surface.tasks import land_surface_loading
from nereid.tests.utils import generate_random_land_surface_request
@pytest.fixture
def watershed_graph():
g = nx.gnr_graph(n=13, p=0.0, seed=0)
nx.relabel_nodes(g, lambda x: str(x), copy=False)
... | {"hexsha": "f6d6caa1befad239b44df4f155ab80f6a7295c7a", "size": 745, "ext": "py", "lang": "Python", "max_stars_repo_path": "nereid/nereid/tests/test_src/test_watershed/conftest.py", "max_stars_repo_name": "Geosyntec/nereid", "max_stars_repo_head_hexsha": "3399b616ae19dfc75f5b6ba83d598495db9b09fb", "max_stars_repo_licens... |
# Represents a graph which with different lincomb functionality:
# It can add more than two matrices. Only used in code generation.
struct MultiLincombCompgraph{T}
operations::Dict{Symbol,Symbol}
parents::Dict{Symbol,NTuple{<:Any,Symbol}}
coeffs::Dict{Symbol,NTuple{<:Any,T}}
outputs::Vector{Symbol}
end
... | {"hexsha": "7369096951e5fc285e66c6d9ba598087049726aa", "size": 7604, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/code_gen/multilincomb.jl", "max_stars_repo_name": "matrixfunctions/GraphMatFun.jl", "max_stars_repo_head_hexsha": "1fac14aa849e7f050ae5281bf6414b4356807199", "max_stars_repo_licenses": ["MIT"],... |
#!/usr/bin/env python
import ldac, getopt, sys, os, glob
def make_eazy_filter_file(filterlist):
f = open('test.RES','w')
f_info = open('test.RES.info','w')
f_translate = open('zphot.translate','w')
line_c = 1
i = 0
for filter_name in filterlist:
i += 1
f_translate.write('f_' +... | {"hexsha": "cf1b9dae35520ac4fa1f9438529e50a3cfdff042", "size": 31891, "ext": "py", "lang": "Python", "max_stars_repo_path": "make_lephare_cats.py", "max_stars_repo_name": "deapplegate/wtgpipeline", "max_stars_repo_head_hexsha": "9693e8562022cc97bf5a96427e22965e1a5e8497", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# Base class for "other" kinetic (radius + momentum + time) quantities
#
import matplotlib.pyplot as plt
import numpy as np
from . OutputException import OutputException
from . ScalarQuantity import ScalarQuantity
class OtherScalarQuantity(ScalarQuantity):
def __init__(self, name, data, description, grid,... | {"hexsha": "28e4e527bec2800729808b15cdf8f96f565b2f0b", "size": 1035, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/DREAM/Output/OtherScalarQuantity.py", "max_stars_repo_name": "chalmersplasmatheory/DREAM", "max_stars_repo_head_hexsha": "715637ada94f5e35db16f23c2fd49bb7401f4a27", "max_stars_repo_licenses": [... |
"""
`InitialGuessODE`: Initial guess for ordinary differential equations
### Fields
* `int`: interpolation structure
* `v`: vector field
* `Δt`: time step
* `s`: number of extrapolation stages (for initialisation)
"""
mutable struct InitialGuessODE{DT, TT, VT, IT <: Interpolator}
int::IT
v::VT
Δt::T... | {"hexsha": "5845f27430d216576993793c8b6ffbd790190b83", "size": 2933, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/integrators/initial_guess/initial_guess_ode.jl", "max_stars_repo_name": "TomaszTyranowski/GeometricIntegrators.jl", "max_stars_repo_head_hexsha": "8f514c18548754186d14ae2ef49ae956561ca529", "ma... |
"""Utility functions for managing model paths and the hparams dict."""
import os
import pickle
import numpy as np
from behavenet.data.utils import get_data_generator_inputs
def get_subdirs(path):
"""Get all first-level subdirectories in a given path (no recursion).
Parameters
----------
path : :obj:... | {"hexsha": "9ad4383d7a1710ee29829bd83e8b114847333911", "size": 38297, "ext": "py", "lang": "Python", "max_stars_repo_path": "behavenet/fitting/utils.py", "max_stars_repo_name": "cxrodgers/behavenet", "max_stars_repo_head_hexsha": "061b0b30f5d03b9d5be0dd965d81dc37b7409070", "max_stars_repo_licenses": ["MIT"], "max_stars... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import numpy as np
from geoedfframework.utils.GeoEDFError import GeoEDFError
""" Helper module for converting nuneric values to colors
"""
def val2color(value,min_value,max_value):
try:
if (math.isnan(value)):
return '#000000'
... | {"hexsha": "4fd39a7bb8b595f5ff8112ff2616d433f39b19d1", "size": 658, "ext": "py", "lang": "Python", "max_stars_repo_path": "wqpmap/GeoEDF/processor/helper/ColorHelper.py", "max_stars_repo_name": "rkalyanapurdue/processors", "max_stars_repo_head_hexsha": "e420f28b9fdf395af18389aa6f457cf8b44c0ca1", "max_stars_repo_license... |
import numpy as np
import theano
import theano.tensor as T
import time
x = T.tensor4('x')
x = theano.shared(
np.random.rand(32, 128, 256, 256).astype(theano.config.floatX),
'x')
filters = theano.shared(
np.random.rand(256, 128, 3, 3).astype(theano.config.floatX),
'filters')
# B x 1 x 1 x T
y = theano.g... | {"hexsha": "6f3e4c6271d1f534b002653e273cb8c7e09f74ed", "size": 589, "ext": "py", "lang": "Python", "max_stars_repo_path": "theano_conv.py", "max_stars_repo_name": "ReyhaneAskari/theano_experiments", "max_stars_repo_head_hexsha": "f03b57fc2347557f0761d102e7bac8e095dc7291", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
/*
* TmxJ2735.hpp
*
* Created on: Apr 27, 2016
* Author: ivp
*/
#ifndef TMX_MESSAGES_TMXJ2735_HPP_
#define TMX_MESSAGES_TMXJ2735_HPP_
#include <cerrno>
#include <memory>
#include <stdexcept>
#include <stdio.h>
#include <asn_application.h>
#include <boost/any.hpp>
#include <tmx/TmxApiMessa... | {"hexsha": "70b3f4076a6dfc87792ffddef7990d36d8f7a785", "size": 7099, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/tmx/TmxApi/tmx/messages/TmxJ2735.hpp", "max_stars_repo_name": "gbaumgardner/V2I-Hub", "max_stars_repo_head_hexsha": "447eb51d70059540919c72d8076809a58c807ef1", "max_stars_repo_licenses": ["Apach... |
import logging
from collections import OrderedDict
import numpy as np
import pandas as pd
from ceteris_paribus.utils import transform_into_Series
def individual_variable_profile(explainer, new_observation, y=None, variables=None, grid_points=101,
variable_splits=None):
"""
Ca... | {"hexsha": "61596a3fa6f7b65128bad8db7fd3f36820a333ed", "size": 7863, "ext": "py", "lang": "Python", "max_stars_repo_path": "ceteris_paribus/profiles.py", "max_stars_repo_name": "vittot/pyCeterisParibus", "max_stars_repo_head_hexsha": "efe5835574026fe6b1a6993cc08cc34e67b8e018", "max_stars_repo_licenses": ["Apache-2.0"],... |
"""
oldpred.py
This file contains the functions to analyze the old OpenAPS prediction algorithms from the devicestatus.json files.
It examines entries spaced out by 5 minutes (MIN_ENTRY_SPACING_MINUTE).
The data must be in the data folder in another folder with the ID only as the title.
The data must be named devicesta... | {"hexsha": "5610a36c9fdffb6b962cf5801885a40bc8822c2c", "size": 17073, "ext": "py", "lang": "Python", "max_stars_repo_path": "oldpred.py", "max_stars_repo_name": "medicinexlab/openAPS", "max_stars_repo_head_hexsha": "76ff91a92adcf2815f97a3cf905ce3b2b6d6dfba", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 8, "ma... |
# This file is part of GridCal.
#
# GridCal 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 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... | {"hexsha": "d1a559dbfdbea5d020fad791f9a09d9b2b41a761", "size": 17376, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/GridCal/Engine/Simulations/Stochastic/monte_carlo_driver.py", "max_stars_repo_name": "vineetjnair9/GridCal", "max_stars_repo_head_hexsha": "5b63cbae45cbe176b015e5e99164a593f450fe71", "max_sta... |
#!/usr/bin/python
from __future__ import division
import copy
import numpy as np
from matplotlib import animation
from matplotlib import pyplot as plt
import constants
from utils import cart2pol, pol2cart
def animate(frame):
global positions
update_boids()
scatter.set_offsets(positions.transpose())... | {"hexsha": "8ebd4a3d095eb0eceb20f0fabd9f38038647fd1b", "size": 7804, "ext": "py", "lang": "Python", "max_stars_repo_path": "simple_boids.py", "max_stars_repo_name": "Dradoue/Simple_boids", "max_stars_repo_head_hexsha": "b96cdd45d32444ac2acedaac3cac4bed3922305e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
! This Software is property of University College London. The Licensee shall reproduce a copyright notice on every
! copy of the Software (including partial copies) and on any accompanying manuals and documentation in the form
! "Copyright (c) University College London, All rights reserved". Trademark and other propri... | {"hexsha": "1ab22fcaa79e87167c219071124ba3cb1cb2c036", "size": 25541, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Fortran_src/output_handle_module.f90", "max_stars_repo_name": "WayneYann/Zacros-Wrapper", "max_stars_repo_head_hexsha": "992f239530600ecf84f07f9ab7c4152b9bb64c25", "max_stars_repo_licenses": ["... |
# This file is adapted from astropy/io/fits/connect.py in the developer version
# of Astropy. It can be removed once support for Astropy v0.2 is dropped (since
# Astropy v0.3 and later will include it).
# Copyright (c) 2011-2013, Astropy Developers
#
# All rights reserved.
#
# Redistribution and use in source and bina... | {"hexsha": "db5c805702a351fa62fd20e140fd8594da3b85da", "size": 10596, "ext": "py", "lang": "Python", "max_stars_repo_path": "glue/external/fits_io.py", "max_stars_repo_name": "yuvallanger/glue", "max_stars_repo_head_hexsha": "1e27b47328db1e9a44eb6734e894a897c4b693be", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
# transact helper method
function transact(fa::FinancialAsset, qty::Int, fill::Float64)
if fa.quantity + qty == 0
fa.basis = 0
fa.quantity = 0
else
fa.basis = ((fa.basis * fa.quantity) + (fill * qty)) / (fa.quantity + qty)
fa.quantity += qty
end
fa
end
| {"hexsha": "7791e165ca7c2f2a5dde736b4bb062af523e885c", "size": 303, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/operators.jl", "max_stars_repo_name": "JuliaQuant/Grist.jl", "max_stars_repo_head_hexsha": "b1a30a736dbdb280da9a18bbb7363b3a51ad81de", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "... |
[STATEMENT]
lemma [code]: "exewf_sort sub S \<equiv> (S = {} \<or> exenormalized_sort sub S \<and> exesort_ex sub S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. exewf_sort sub S \<equiv> S = full_sort \<or> exenormalized_sort sub S \<and> exesort_ex sub S
[PROOF STEP]
by simp (smt ball_empty bot_set_def empty_Co... | {"llama_tokens": 134, "file": "Metalogic_ProofChecker_SortsExe", "length": 1} |
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Twist
import numpy as np
import tf.transformations
from plotter import plotter
class husky_pi():
def __init__(self, set_point, dt = 0.1, Teval = 1., simulation = True):
self.position = np.zeros(3)
self.vel_v = np.zeros(... | {"hexsha": "4832ffa253ef045db4e3ce7cf6d770935dd22cab", "size": 5797, "ext": "py", "lang": "Python", "max_stars_repo_path": "husky.py", "max_stars_repo_name": "INTELYMEC/Double_QPID", "max_stars_repo_head_hexsha": "3a84d58d2ce22eed2e695eea1b0497c37a010266", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 13, "max... |
#!/usr/bin/python
import numpy as np
import cv2
import argparse
import dewarp
import feature_matching
import optimal_seamline
import blending
import cropping
import os
# --------------------------------
# output video resolution
W = 2560
H = 1280
# --------------------------------
# field of view, width of de-warped i... | {"hexsha": "6a9c2fcff7b36903f1afbb8bfda43402ba51f354", "size": 9347, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "suzhengpeng/dual-fisheye-video-stitching", "max_stars_repo_head_hexsha": "b578c2f974fcd38f17a4bd3d811b04675c099776", "max_stars_repo_licenses": ["MIT"], "max_star... |
#!/usr/bin/env python
# Title :loader.py
# Author :Venkatraman Narayanan, Bala Murali Manoghar, Vishnu Shashank Dorbala, Aniket Bera, Dinesh Manocha
# Copyright :"Copyright 2020, Proxemo project"
# Version :1.0
# License :"MIT"
# Maintainer :Venkatraman Narayanan, Bala Mura... | {"hexsha": "1cf12d17bde2167a7d6fcf6dedbb457793e036ca", "size": 6895, "ext": "py", "lang": "Python", "max_stars_repo_path": "pose_tracking/human_tracking_3D.py", "max_stars_repo_name": "vijay4313/proxemo", "max_stars_repo_head_hexsha": "98c4e2133047aa8519cc2f482b59565d9160e81a", "max_stars_repo_licenses": ["MIT"], "max_... |
%% Demo of *plot_littlewood_paley_1d*
%% Usage
% littlewood = *plot_littlewood_paley_1d*(filters) (see
% <matlab:doc('plot_littlewood_paley_1d') plot_littlewood_paley_1d>).
%
%% Description
% *plot_littlewood_paley* computes, at every frequency, the
% Littlewood-Paley sum of a filter bank, i.e. the total power spectr... | {"author": "scatnet", "repo": "scatnet", "sha": "59d935afa20359845282a3518134e24244862c1f", "save_path": "github-repos/MATLAB/scatnet-scatnet", "path": "github-repos/MATLAB/scatnet-scatnet/scatnet-59d935afa20359845282a3518134e24244862c1f/demo/display/demo_plot_littlewood_paley_1d.m"} |
# ARIMA Model
from statsmodels.tsa.arima.model import ARIMA
import numpy as np
import pandas as pd
import datetime
class ArimaModel:
def __init__(self, order=(5,1,0)):
self.order = order
def predict_with_arima(self, dataset, code='PT', y='Total_Cases', days=5):
tmp = dataset[[y+code]]... | {"hexsha": "33ff36794c444e4f7f28320c51ebbb93e6d84161", "size": 1173, "ext": "py", "lang": "Python", "max_stars_repo_path": "predictions/Models/ArimaModel.py", "max_stars_repo_name": "BrunoMartins11/covid-19-API", "max_stars_repo_head_hexsha": "d6f6c725688ad54007efafb6f01b7326126885d7", "max_stars_repo_licenses": ["MIT"... |
"""Communication logic for controlling a Hanover sign"""
import numpy as np
from pyflipdot.data import ImagePacket
class HanoverSign:
"""A Hanover sign
Attributes:
address (int): Address of the sign
flip (bool): True if the sign is upside-down
height (int): Pixel height of the sign
... | {"hexsha": "e452aa5f8dea7be85c6c4715bb4e12302406eed6", "size": 1987, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyflipdot/sign.py", "max_stars_repo_name": "briggySmalls/hanover_flipdot", "max_stars_repo_head_hexsha": "2b14f57541eb039090527197f01cc3da004ab339", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
subroutine php_endite(a,itask)
!-----------------------------------------------------------------------
! DESCRIPTION
! This routine checks convergence and performs updates at:
! - itask=1 The end of an internal iteration
! - itask=2 The end of the internal loop iteration
!-------------------... | {"hexsha": "40b0fcb7528cac2d91266f77d612ac9f6c6fcc1c", "size": 1186, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Sources/modules/PhysicalProblem/php_endite.f90", "max_stars_repo_name": "ciaid-colombia/InsFEM", "max_stars_repo_head_hexsha": "be7eb35baa75c31e3b175e95286549ccd84f8d40", "max_stars_repo_license... |
[STATEMENT]
lemma sup_state_conv2:
"P \<turnstile> s1 \<le>\<^sub>i s2 = (P \<turnstile> fst s1 [\<le>] fst s2 \<and> P \<turnstile> snd s1 [\<le>\<^sub>\<top>] snd s2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. P \<turnstile> s1 \<le>\<^sub>i s2 = (P \<turnstile> fst s1 [\<le>] fst s2 \<and> P \<turnstile> s... | {"llama_tokens": 188, "file": "JinjaThreads_BV_JVM_SemiType", "length": 1} |
import numpy as np
import pandas as pd
from os.path import join as joinPaths
from os.path import isdir
from os.path import isfile
from os import listdir as ls
from IPython.display import display, Markdown, Latex
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from matplotlib.pyplot import cm
from mult... | {"hexsha": "f8f5648ef00f1434032b135d8a990b85579e5f63", "size": 18859, "ext": "py", "lang": "Python", "max_stars_repo_path": "yasb/bikbox.py", "max_stars_repo_name": "k323r/YASB-tools", "max_stars_repo_head_hexsha": "581dfd8979e043c8c08b138d1fe1028a10a688c3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This script contains basic functions for Conv Neural Nets.
foward conv and pooling
backward conv and pooling
@author: xuping
"""
import numpy as np
import h5py
import matplotlib.pyplot as plt
def Conv_forward(A_prev, W, b, para):
'''
This is the forward prop... | {"hexsha": "20b85e774f4f333362b32f59f4d25bf560a3cebc", "size": 6997, "ext": "py", "lang": "Python", "max_stars_repo_path": "NN_buildingblock/ConvNN.py", "max_stars_repo_name": "xupingxie/deep-learning-models", "max_stars_repo_head_hexsha": "cc76aedf9631317452f9cd7df38998e2de727816", "max_stars_repo_licenses": ["MIT"], ... |
// (C) Copyright Edward Diener 2011
// Use, modification and distribution are subject to 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).
#if !defined(TTI_HAS_TYPE_HPP)
#define TTI_HAS_TYPE_HPP
#include <boost/preprocessor/cat... | {"hexsha": "40ac5f15e910e5aa9db67ab3e915ce5044ea68b8", "size": 3195, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "boost/tti/has_type.hpp", "max_stars_repo_name": "juslee/boost-svn", "max_stars_repo_head_hexsha": "6d5a03c1f5ed3e2b23bd0f3ad98d13ff33d4dcbb", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_count... |
"""Truncated singular value decomposition."""
import logging
import numpy as np
import optht
import sklearn.base
from scipy import linalg
log = logging.getLogger(__name__)
class Tsvd(sklearn.base.BaseEstimator):
"""Truncated singular value decomposition.
Attributes
----------
left_singular_vectors... | {"hexsha": "08083d9a92c683b14e2c335a51b05ccd8c8ec2f5", "size": 5659, "ext": "py", "lang": "Python", "max_stars_repo_path": "pykoop/tsvd.py", "max_stars_repo_name": "decarsg/pykoop", "max_stars_repo_head_hexsha": "6a8b7c83bdc7de3419e2fac48c1035fa06966e24", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 9, "max_s... |
import numpy as np
from mujoco_worldgen.util.rotation import quat_mul, quat_conjugate
def dist_pt_to_cuboid(pt1, cuboid_center, cuboid_dims, cuboid_quat):
'''
This function calculates the shortest distance between test points
and cuboids at arbitrary locations, widths and rotations
Args:
... | {"hexsha": "fb252d6d305e96f6785b09b475b0c962b5f6a9e0", "size": 2602, "ext": "py", "lang": "Python", "max_stars_repo_path": "mae_envs/util/geometry.py", "max_stars_repo_name": "bglick13/multi-agent-emergence-environments", "max_stars_repo_head_hexsha": "e02d66f0734d95470d15a4508ff369a75fa093a4", "max_stars_repo_licenses... |
import numpy as np
import torch
from . import nms_cuda, nms_cpu
from .soft_nms_cpu import soft_nms_cpu
def nms(dets, iou_thr, device_id=None):
"""Dispatch to either CPU or GPU NMS implementations.
The input can be either a torch tensor or numpy array. GPU NMS will be used
if the input is a gpu tensor or... | {"hexsha": "80d691c5b3c451dbd1b0740dbd2ac6561d8ff68a", "size": 6086, "ext": "py", "lang": "Python", "max_stars_repo_path": "mmdet/ops/nms/nms_wrapper.py", "max_stars_repo_name": "arthur801031/3d-multi-resolution-rcnn", "max_stars_repo_head_hexsha": "8e5454a72f8daa174bf3eabfa5964152f04ab287", "max_stars_repo_licenses": ... |
/*
* Copyright (c) 2018 Ryan Berryhill, University of Toronto
* 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,... | {"hexsha": "9253d1e85c22f231144b9364b4613bc1e6b42247", "size": 3304, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/test_find_minimal_support.cpp", "max_stars_repo_name": "ryanberryhill/pme", "max_stars_repo_head_hexsha": "416be2d52c920d285cc686a56d2f30bfab66bc51", "max_stars_repo_licenses": ["MIT"], "max_s... |
import enum
import random
import keras.backend as K
import numpy as np
from keras.layers import Dense
from keras.models import Sequential
class Move(enum.Enum):
PASS = 0
FORFEIT = 1
class ReferenceAgent(object):
"""Agent that never learns."""
def select_move(self):
return random.choice([Mov... | {"hexsha": "0ec506a2f44c93aad3692d727a818220f29619f4", "size": 2704, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/scratch/forfeiture.py", "max_stars_repo_name": "BachFive/GammaGo_3", "max_stars_repo_head_hexsha": "3eb8e82eef01718684ba8594be49fdac04503e5e", "max_stars_repo_licenses": ["MIT"], "max_sta... |
MODULE readin_data
USE stel_kinds
USE general_dimensions
INTEGER,DIMENSION(:),ALLOCATABLE :: list
REAL(rprec), DIMENSION(:), ALLOCATABLE :: hiota, hphip,
1 hpres
REAL(rprec), DIMENSION(:), ALLOCATABLE :: xn_v, xm_v
REAL(rprec), DIMENSION(:), ALLOCATABLE :: lmnsh, bmnch,
... | {"hexsha": "5391c3e8b6df56adbddd6935f20522e4926ac3ed", "size": 544, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "COBRAVMEC/Sources/readin_data.f", "max_stars_repo_name": "joseluisvelasco/STELLOPT", "max_stars_repo_head_hexsha": "e064ebb96414d5afc4e205f43b44766558dca2af", "max_stars_repo_licenses": ["MIT"], "m... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl... | {"hexsha": "5edf9cb615f6c0ce94f81b5fc4d073a42d03fbe7", "size": 8361, "ext": "py", "lang": "Python", "max_stars_repo_path": "pennylane/devices/tests/conftest.py", "max_stars_repo_name": "MoritzWillmann/pennylane", "max_stars_repo_head_hexsha": "2b07d22cfcc6406ba28e5c647062340b240a4ee5", "max_stars_repo_licenses": ["Apac... |
#pragma once
#include <boost/iterator/filter_iterator.hpp>
#include <boost/mpl/identity.hpp>
#include <functional>
#include <tuple>
namespace boltzmann {
template <typename ITERATOR, typename ELEM>
std::tuple<boost::filter_iterator<std::function<bool(const ELEM &)>, ITERATOR>,
boost::filter_iterator<std... | {"hexsha": "874061783fdf4b09ed4836c59853df700504bc9d", "size": 706, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "spectral/filtered_range.hpp", "max_stars_repo_name": "simonpp/2dRidgeletBTE", "max_stars_repo_head_hexsha": "5d08cbb5c57fc276c7a528f128615d23c37ef6a0", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
#!/usr/bin/env python
"""
genalg.py:
Core of the genetic algorithm.
"""
from copy import deepcopy
from operator import attrgetter
import numpy as np
from instances.vrp import VRP
from algorithms.timer import Timer
import algorithms.plotting.plot_manager as plot_manager
from algorithms.plotting.plot_data import Plo... | {"hexsha": "35665d91b5baa87b3fbcd421f3f8b321d8fa3465", "size": 46716, "ext": "py", "lang": "Python", "max_stars_repo_path": "algorithms/genalg.py", "max_stars_repo_name": "terratenff/vrp-gen-alg", "max_stars_repo_head_hexsha": "3910ff7977a84b03e14c4f500909bcb86e6dd608", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
"""
meerkat_api util functions
"""
from datetime import datetime
from dateutil import parser
import meerkat_abacus.util as abacus_util
import numpy as np
import meerkat_abacus.util.epi_week
def series_to_json_dict(series):
"""
Takes pandas series and turns into a dict with string keys
Args:
seri... | {"hexsha": "3a1ea458d526f1cf463aad6d844f8d30509d9ae4", "size": 4531, "ext": "py", "lang": "Python", "max_stars_repo_path": "meerkat_api/util/__init__.py", "max_stars_repo_name": "meerkat-code/meerkat_api", "max_stars_repo_head_hexsha": "9ab617498e52df5a49b993ee1c931071eab6ab92", "max_stars_repo_licenses": ["MIT"], "max... |
import matplotlib
# don't use xwindow
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import re
import sys
import os
basedir = sys.argv[1] + "/"
files = map(lambda x: basedir + x, sorted(os.listdir(basedir), key=int))
def process_uartlog(uartlogpath):
""" process the... | {"hexsha": "e17b35d4a2901cfc9497625209a8fff864756d18", "size": 2235, "ext": "py", "lang": "Python", "max_stars_repo_path": "deploy/workloads/ping-latency/ping-latency-graph.py", "max_stars_repo_name": "GaloisInc/BESSPIN-firesim", "max_stars_repo_head_hexsha": "0da74414291708563f9b512634d1315d53077e91", "max_stars_repo_... |
function oneDArray(t::DataType, len::Int)
return zeros(t, len)
end
function twoDArray(t::DataType, len_x::Int, len_y::Int)
return zeros(t, len_x, len_y)
end | {"hexsha": "bf9f6a51dd01084fcd5999e8e6dcc81690fc4e06", "size": 165, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/types.jl", "max_stars_repo_name": "gaelforget/Diffusion.jl", "max_stars_repo_head_hexsha": "2fe126f0f777f947b3a5deb6fa6d8e66cc8ba17b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 27, ... |
function dbName = response_demo_database
%RESPONSE_DEMO_DATABASE returns the absolute path to the demo database
% DBNAME = RESPONSE_DEMO_DATABASE
file = which('response_cookbook');
path = fileparts(file);
if ~exist([path '/demo'])
error('response_demo_database: demo database not found');
else
dbName = [path '/d... | {"author": "geoscience-community-codes", "repo": "GISMO", "sha": "a4eafca9d2ac85079253510005ef00aa9998d030", "save_path": "github-repos/MATLAB/geoscience-community-codes-GISMO", "path": "github-repos/MATLAB/geoscience-community-codes-GISMO/GISMO-a4eafca9d2ac85079253510005ef00aa9998d030/contributed/instrument_response/r... |
#
# Copyright © 2021 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. No copyright is claimed
# in the United States under Title 17, U.S. Code. All Other Rights Reserved.
#
# SPDX-License-Identifier: NASA-1.3
#
"""
Dust map infrastructure. Software mod... | {"hexsha": "c6696b1e43927e15fa2918816fde083f91979220", "size": 2417, "ext": "py", "lang": "Python", "max_stars_repo_path": "dorado/scheduling/dust.py", "max_stars_repo_name": "bwgref/dorado-scheduling", "max_stars_repo_head_hexsha": "f3f8784bcc0646d10b7bc2c11040ef9c933b92b1", "max_stars_repo_licenses": ["NASA-1.3"], "m... |
"""
Presumably I copied this in from holoviews and hacked til it worked,
as a proof of concept? But since holoviews is deprecating magics, no
attempt was ever made (or will ever be made...) to do it properly :)
"""
from itertools import groupby
IGNORED_LINE_MAGICS = ['output']
IGNORED_CELL_MAGICS = ['output']
try:
... | {"hexsha": "d35cc2bcf2d072bd273bd3c66926f06751e2d017", "size": 4380, "ext": "py", "lang": "Python", "max_stars_repo_path": "nbsmoke/lint/magics/holoviews_support.py", "max_stars_repo_name": "ianthomas23/nbsmoke", "max_stars_repo_head_hexsha": "a9c58a43af3b57c4c76ea0efc8315e0ea3344d87", "max_stars_repo_licenses": ["BSD-... |
#!/usr/bin/env python
import os
import os.path as pt
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import argparse
#TODO: take decimal places as parameter for printing.
def sizeof_pp(num):
for unit in ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB']:
if abs(num) < 1024.... | {"hexsha": "7bbce2fc454d2582a73d1544a7f10ce703ecbc9f", "size": 2182, "ext": "py", "lang": "Python", "max_stars_repo_path": "spy_dir.py", "max_stars_repo_name": "TheGhostHuCodes/spy_dir", "max_stars_repo_head_hexsha": "23d78a0fecbf6fcc78decb83dc3d02917a46844d", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count... |
import os, sys
import glob
import json
import cv2
import subprocess
import re
import requests
import cv2
import numpy as np
def save_frames(filepath, directory):
subprocess.check_output(['ffmpeg','-loglevel','panic','-i', filepath, '-vf', 'scale=320:-1', '-r', '10', '-y', os.path.join(directory, "frame_%3d.png")])... | {"hexsha": "41956f12c1d61b44025ec041ad3c2d91ce82e4ad", "size": 11218, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/analyze_with_image_processing.py", "max_stars_repo_name": "annitrolla/car-insurance-tool", "max_stars_repo_head_hexsha": "ac54f9f61e154afc8cb1aa5cf5bd6dec3a7991bb", "max_stars_repo_licen... |
from os.path import *
import glob
import json
import numpy as np
from util.plot_utils import plot_curves, plot_multi_loss_distribution
TMPJPG = expanduser("~/Pictures/")
def plot_multi_logs(exp_name, keys, save_name, epoch, addition_len):
root_path = expanduser("/raid/dataset/detection/detr_exp")
folder_cand... | {"hexsha": "81daacebc9755ed9fad67d0bb9146bb8f488fc5d", "size": 2728, "ext": "py", "lang": "Python", "max_stars_repo_path": "util/visualize_loss.py", "max_stars_repo_name": "whq-hqw/detr_change", "max_stars_repo_head_hexsha": "142f75cc5e0b59ca6e07928ddcbed3e461816611", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
from copy import deepcopy
import itertools
import os
import numpy as np
import scipy
import torch
import torch.nn as nn
import torch.nn.functional as F
from bootstrap.lib.options import Options
from bootstrap.lib.logger import Logger
import block
from block.models.networks.vqa_net import factory_text_enc
from block.mod... | {"hexsha": "1db91d64ffc5561787ad34980a1814b13da9c425", "size": 7498, "ext": "py", "lang": "Python", "max_stars_repo_path": "cfvqa/models/networks/updn_net.py", "max_stars_repo_name": "Mike4Ellis/VQA-Based-CF-VQA", "max_stars_repo_head_hexsha": "18b61010af551f8077bcc309f6290c7c9d251e00", "max_stars_repo_licenses": ["Apa... |
#! /usr/bin/env python3
import sympy as sp
import dataclasses
import cgeneration as cg
r"""
# Lawson scheme
In this module we present some Lawson methods. Each function
represents a Lawson method, and returns an object that contains every
stages of the method.
"""
@dataclasses.dataclass
class lawson:
stages = []... | {"hexsha": "f1755bb2ddef01af3880bd0c89df8d35d84ef520", "size": 3174, "ext": "py", "lang": "Python", "max_stars_repo_path": "script/schemes.py", "max_stars_repo_name": "kivvix/vlasovpp", "max_stars_repo_head_hexsha": "123072d42ddcceef9278e0cd3ac18d5b3fa4b3c0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
import os
import numpy as np
import functools
from . import dpath, chunks, resolve_symbols, namespace_dir, group_blocks_into_fills, write_fill
def check_bounds(voxels):
"""gives the bounds for a list of Voxels"""
bounds = functools.reduce(
lambda bounds, voxel: (
min(bounds[0], voxel[0]),... | {"hexsha": "2cf0a9dae316ce461c00f5c02fe1b797715b965a", "size": 3494, "ext": "py", "lang": "Python", "max_stars_repo_path": "functions/dome.py", "max_stars_repo_name": "msb/minecraft-functions", "max_stars_repo_head_hexsha": "d9fa2d73a9038c29e4be0aa03e4286a33d0eda46", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import numpy as np
class Sampler(object):
def __init__(self, data_source):
pass
def __iter__(self):
raise NotImplementedError
def __len__(self):
raise NotImplementedError
class SequentialSampler(Sampler):
def __init__(self, data_source):
self.data_source = data_sour... | {"hexsha": "ef9126c0b9b9ac1ad967e3ab809a4a6ed62ac71a", "size": 1745, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/data_m/sampler.py", "max_stars_repo_name": "mengdongwei/ai4khdr_mmsr", "max_stars_repo_head_hexsha": "5f16b667f5735b530e2c88c05b125e57a3cd2aa2", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
import logging
import argparse
import numpy as np
from gensim.models import Word2Vec
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
def main(args):
walk_path = args.walk_path
embed_size = args.embed_size
window_size = args.window_size
negative = args.nega... | {"hexsha": "6ef52063e44feb5c04f952d48b87df1abdccf8e2", "size": 1609, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_embedding.py", "max_stars_repo_name": "abidikhairi/embedding_with_lrw", "max_stars_repo_head_hexsha": "8152b3e4b61b197857d1293d5a50bff118804109", "max_stars_repo_licenses": ["MIT"], "max_sta... |
%----------------------------------------------------------------------------
% Magic tutorial number S-2
%----------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\documentclass[letterpaper,twoside,12pt]{article}
\usepackage{epsfig,times}
\setlength{\textwidth... | {"hexsha": "6d8531ee800818e6da8a71dd44ee97c485bdefde", "size": 8173, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/latexfiles/tutscm2.tex", "max_stars_repo_name": "wisehackermonkey/magic", "max_stars_repo_head_hexsha": "fb85e97b9233cff352d964823173c18527c714aa", "max_stars_repo_licenses": ["TCL", "X11", "MIT... |
// Copyright (c) 2013, Manuel Blum
// All rights reserved.
#include <Eigen/Dense>
#include <iostream>
#include <cstdio>
#include "nn.h"
int main (int argc, const char* argv[]) {
// input dimensionality
int n_input = 2;
// output dimensionality
int n_output = 1;
// number of training samples
int m = 4;
... | {"hexsha": "301bde4d19088e88a2852c889fe4b85888f79ce0", "size": 1549, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tutorial.cpp", "max_stars_repo_name": "mblum/nn", "max_stars_repo_head_hexsha": "f5fbba4ad93ce72798828d03b9b7d34dfb48a10f", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 11.0, "max... |
from tensorflow.keras.models import Sequential, model_from_json
from tensorflow.keras.layers import Conv3D, Conv2D
from tensorflow.keras.layers import ConvLSTM2D
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras import losses
import numpy as np
import pandas as pd
import random
import... | {"hexsha": "59079e0f74e8b8f489e827252f0d4fcf6fac4711", "size": 26849, "ext": "py", "lang": "Python", "max_stars_repo_path": "model.py", "max_stars_repo_name": "swarna-kpaul/indiacovidforecast", "max_stars_repo_head_hexsha": "bfd2e000ef1ae338f313ea8e9d3ad5e972a3cf94", "max_stars_repo_licenses": ["Apache-2.0"], "max_star... |
type ClusterInfo
meta::Dict
locked::Bool
cloudname::AbstractString
skipticks::Bool
version::AbstractString
cloudsize::Int
healthy::Bool
badnodes::Int
excludefields::AbstractString
nodes::Vector
clouduptimemillis::Int
nodeidx::Int
consensus::Bool
isclient::Bool
end | {"hexsha": "75fb5c0d224290ec4aa8bfd0ba6e3ae2a5dedafc", "size": 278, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/types/clusterinfo.jl", "max_stars_repo_name": "drewgendreau/H2O.jl", "max_stars_repo_head_hexsha": "559c7f924965a9634dd53b692be5391dc2be2161", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
// smooth: Lie Theory for Robotics
// https://github.com/pettni/smooth
//
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
//
// Copyright (c) 2021 Petter Nilsson
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation fi... | {"hexsha": "ddae25f2407b2652618305eee36c66b11ef979e7", "size": 19928, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/smooth/internal/se3.hpp", "max_stars_repo_name": "tgurriet/smooth", "max_stars_repo_head_hexsha": "c19e35e23c8e0084314726729d0cf6729192240f", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import os
import shutil
import matplotlib.pyplot as plt
import numpy as np
from armor_py.options import args_parser
from armor_py.utils import alter_re, alter, del_blank_line, dict_avg, test_remove
def asr_per_process():
client_num_in_total = args.client_num_in_total
path = dataset_path + "client_num_{}/".for... | {"hexsha": "410f7a60a9fc8ed7f0f48f723a8541304b9e746a", "size": 11167, "ext": "py", "lang": "Python", "max_stars_repo_path": "process_exp.py", "max_stars_repo_name": "ARMOR-FL/ARMOR", "max_stars_repo_head_hexsha": "c2ec73dbc436c9f478a789a49fbb40e9c465b0d9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_... |
\appendix
\chapter{Analytical Modelling of Buckled Beam Mechanism}\label{chap:appendixA}
The bistable mechanism consists of an initially flat beam which, when compressed by a distance $\Delta l$, buckles and forms a structure that exists in two stable positions. In the case of the actuator, which consists of a pair of ... | {"hexsha": "b6268f2c3965c335a8bec9666baec416c66cfb71", "size": 4323, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tail/appendix.tex", "max_stars_repo_name": "seanthomas0409/sethomas_EPFL_thesis", "max_stars_repo_head_hexsha": "5cc1b082be09da01e7545b7da93d1b113edc77b6", "max_stars_repo_licenses": ["MIT"], "max_s... |
[STATEMENT]
lemma card_surjective_functions_range_permutation:
assumes "finite A" "finite B"
shows "card ({f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // range_permutation A B) = Stirling (card A) (card B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. card ({f \<in> A \<rightarrow>\<^sub>E B. f ` A = B} // r... | {"llama_tokens": 1770, "file": "Twelvefold_Way_Twelvefold_Way_Entry9", "length": 15} |
from numpy.core.arrayprint import DatetimeFormat
from numpy.lib.function_base import piecewise
import taichi as ti
import numpy as np
from .sph_solver import SPHSolver
class SoilSPHSolver(SPHSolver):
def __init__(self, particle_system, TDmethod, gamma, coh, fric):
super().__init__(particle_system, TDmethod... | {"hexsha": "d6b3f8503c69d9feffa7c63fe1f8d67b997691dc", "size": 12674, "ext": "py", "lang": "Python", "max_stars_repo_path": "temp/eng - 20220411/soilsph.py", "max_stars_repo_name": "Rabmelon/tiSPHi", "max_stars_repo_head_hexsha": "8ffb0e505edd01cb31cb049bfe54f1f2b99cf121", "max_stars_repo_licenses": ["MIT"], "max_stars... |
from itertools import product
from pyomo.core import *
class Model:
model = AbstractModel()
model.T = Set() # Index Set for time steps of optimization horizon
# Feasible charge powers to ESS under the given conditions
model.Feasible_ESS_Decisions = Set()
# Feasible charge powers to VAC under t... | {"hexsha": "fc0ece31136e7b4f0fac9e5635d147e6434c0179", "size": 8896, "ext": "py", "lang": "Python", "max_stars_repo_path": "optimization/models/StochasticResidentialMaxPVSimulation.py", "max_stars_repo_name": "garagonc/optimization-framework", "max_stars_repo_head_hexsha": "1ca57699d6a3f2f98dcaea96430e75c3f847b49f", "m... |
// Copyright (c) 2013, German Neuroinformatics Node (G-Node)
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted under the terms of the BSD License. See
// LICENSE file in the root of the Project.
#include <nix/hydra/multiArray.hpp>
#includ... | {"hexsha": "81828e15199b071420ecc654b5d16e9a8d02b032", "size": 2602, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "test/TestValidate.hpp", "max_stars_repo_name": "mpsonntag/nix", "max_stars_repo_head_hexsha": "3e2b874973355f51fcfbaee31eeeb5d9eccab943", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun... |
import json
import os
import numbers
import datetime
import operator
# File description:
# Generates lightweight decision tree and ensemble models using SKLearn
# Then ports these models into JSON string so that the frontend can
# parse and evaluate the model.
# The ported version is still based on the sklearn interna... | {"hexsha": "bad38641d029396d12f891a62aa679c07d1d34cf", "size": 14253, "ext": "py", "lang": "Python", "max_stars_repo_path": "ts/shared/util/suggest/makeSKLearnModel.py", "max_stars_repo_name": "xcalar/xcalar-idl", "max_stars_repo_head_hexsha": "69aa08fb42cde6c905b3aa2129c365c4c3e575f9", "max_stars_repo_licenses": ["Apa... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | {"hexsha": "ee8cf4e82f72c00d6b7a9496f357ac19b62912df", "size": 6313, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unit/test__geometric_intersection.py", "max_stars_repo_name": "dibir-magomedsaygitov/bezier", "max_stars_repo_head_hexsha": "a3c408d11133aa1b97fb6dd673888cf56f03178e", "max_stars_repo_licens... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
[path]
cd /Users/brunoflaven/Documents/03_git/BlogArticlesExamples/extending_streamlit_usage/010_streamlit_design/
[file]
streamlit run streamlit_design_4.py
# source
https://github.com/Jcharis/Streamlit_DataScience_Apps/blob/master/Streamlit_Python_Crash_Course/docs... | {"hexsha": "63ef5e37b1a5fdd9050a2ee017ceeb6de259d69e", "size": 3483, "ext": "py", "lang": "Python", "max_stars_repo_path": "extending_streamlit_usage/010_streamlit_design/streamlit_design_4.py", "max_stars_repo_name": "bflaven/BlogArticlesExamples", "max_stars_repo_head_hexsha": "5df2dfc26170ffbbade78ba136bf3172391e3b2... |
import numpy as np
from locintel.core.datamodel.geo import GeoCoordinate
from locintel.graphs.datamodel.jurbey import Edge
from locintel.graphs.datamodel.types import (
EdgeType,
RoadClass,
RoadAccessibility,
VehicleType,
)
from typing import Sequence
def no_geometry(coord1, coord2):
return {}
... | {"hexsha": "ddb0f3cff1424c908ba8bd575ceda138c3aec2cc", "size": 1910, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/graphs/synthetic/utils.py", "max_stars_repo_name": "pedrofreitascampospro/locintel", "max_stars_repo_head_hexsha": "eb9c56cdc308660c31d90abe9fe62bd3634ba273", "max_stars_repo_licenses": ["MI... |
open import Level using (0ℓ)
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; cong; cong₂; isEquivalence; setoid)
open import Relation.Binary.PropositionalEquality.WithK using (≡-irrelevant)
open import Data.Unit using (⊤; tt)
open import Agda.Builtin.FromNat using (Number)
open import Data.Product ... | {"hexsha": "935be09790206cdd540adc00726d7f0546c5d774", "size": 4321, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "proofs/AKS/Rational/Properties.agda", "max_stars_repo_name": "mckeankylej/thesis", "max_stars_repo_head_hexsha": "ddad4c0d5f384a0219b2177461a68dae06952dde", "max_stars_repo_licenses": ["MIT"], "ma... |
#include "graph-properties-convert-mysql.h"
#include <mysql.h>
#include <unistd.h>
#include <algorithm>
#include <cstdint>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <iostream>
#include <limits>
#include <map>
#include <optional>
#include <random>
#include <sstream>
#include <unordered_map>
#incl... | {"hexsha": "4b20d2865f7e20280b470e6b79e623a21d0bc2f9", "size": 27984, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tools/graph-convert/graph-properties-convert-mysql.cpp", "max_stars_repo_name": "chakpongchung/katana", "max_stars_repo_head_hexsha": "3278a39b504e0aeaec30d06cf629ab97dfeb3f22", "max_stars_repo_lic... |
import numpy as np
import tensorflow as tf
data = np.load("./cifar-10-test-data.npz")
labels = data.f.labels
data = data.f.data
w = tf.io.TFRecordWriter("./cifar-10-test-data.tfrecords")
for i in range(10000):
example = tf.train.Example(
features=tf.train.Features(
feature={
... | {"hexsha": "14aebe27c20c8b388b9334f6049c3c0318a25994", "size": 976, "ext": "py", "lang": "Python", "max_stars_repo_path": "elastic_demos/record.py", "max_stars_repo_name": "AlanFokCo/compensation-tools", "max_stars_repo_head_hexsha": "e3fbf2f583ff370d32ffa0e2b6a0c57c20ca9eb0", "max_stars_repo_licenses": ["Apache-2.0"],... |
SUBROUTINE MD03BB( COND, N, IPAR, LIPAR, R, LDR, IPVT, DIAG, QTB,
$ DELTA, PAR, RANKS, X, RX, TOL, DWORK, LDWORK,
$ INFO )
C
C SLICOT RELEASE 5.7.
C
C Copyright (c) 2002-2020 NICONET e.V.
C
C PURPOSE
C
C To determine a value for the parameter PAR such ... | {"hexsha": "108a3e49ec186eb86361048bfb31578b0de0e246", "size": 7054, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/MD03BB.f", "max_stars_repo_name": "bnavigator/SLICOT-Reference", "max_stars_repo_head_hexsha": "7b96b6470ee0eaf75519a612d15d5e3e2857407d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | {"hexsha": "8a504a829ffc05c07637092fabef53b45b84adfc", "size": 5968, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/common/test_run/vector_matmul_run.py", "max_stars_repo_name": "laekov/akg", "max_stars_repo_head_hexsha": "5316b8cb2340bbf71bdc724dc9d81513a67b3104", "max_stars_repo_licenses": ["Apache-2.0"... |
import cv2
import numpy as np
import alglib.colour_space as colour
def hsv_mask(frame, lower=np.array([2, 35, 128], np.uint8), upper=np.array([30, 124, 255], np.uint8)):
colour_space = colour.hsv(frame)
mask = cv2.inRange(colour_space, lower, upper)
return mask
def auto_canny(image, sigma=0.33):
... | {"hexsha": "8eaa6068f254d6d582959722e45ae67bbe9398d1", "size": 1941, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/alglib/processing.py", "max_stars_repo_name": "zeryter-xyz/OpenHandTrack", "max_stars_repo_head_hexsha": "c619bd87c48fc8c64fa8855394369520f7931f7f", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma aadd_two_negg[simp]:"\<lbrakk>a < (0::ant); b < 0\<rbrakk> \<Longrightarrow> a + b < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>a < 0; b < 0\<rbrakk> \<Longrightarrow> a + b < 0
[PROOF STEP]
by auto | {"llama_tokens": 111, "file": "Valuation_Valuation1", "length": 1} |
# coding: utf-8
# # Fomalhaut A's vertical structure
# Multiple pointings... See splits.py for splits, statwt, and uv table creation
# In[1]:
import os
import numpy as np
import emcee
import scipy.optimize
import scipy.signal
import matplotlib.pyplot as plt
import corner
import pymultinest as pmn
import galario.do... | {"hexsha": "dc68680792464dfc436dc4bd8c08ff427a2a8fc2", "size": 11899, "ext": "py", "lang": "Python", "max_stars_repo_path": "fomalhaut/vis_model_mn.py", "max_stars_repo_name": "drgmk/eccentric-width", "max_stars_repo_head_hexsha": "4506bb0a856c62a106c4105147121e818802efd0", "max_stars_repo_licenses": ["MIT"], "max_star... |
import json
import argparse
from typing import Dict, List
from collections import namedtuple
from enum import IntFlag
import networkx as nx
from networkx import DiGraph
# BBNode is used for the nodes in the networkx digraph
BBNode = namedtuple("BBNode", ["index"])
# EdgeData is used to store edge metadata in the netw... | {"hexsha": "f5d00976b119de32e6fc13239f8193cf544e68fd", "size": 5067, "ext": "py", "lang": "Python", "max_stars_repo_path": "automates/program_analysis/GCC2GrFN/gcc_basic_blocks_to_digraph.py", "max_stars_repo_name": "ml4ai/automates", "max_stars_repo_head_hexsha": "3bb996be27e9ee9f99e931b885707dae2c2ac567", "max_stars_... |
# encoding: utf-8
"""
@author : zhirui zhou
@contact: evilpsycho42@gmail.com
@time : 2020/5/20 17:17
"""
import pytest
from deepseries.dataset import create_seq2seq_data_loader
import numpy as np
def test_create_seq2seq_data_loader():
x = np.random.rand(30, 1, 24)
dl = create_seq2seq_data_loader(x, 12, 12, ... | {"hexsha": "4ccdfad7ecc3a817afc0304488bcf0cb4b0738ec", "size": 473, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_dataset.py", "max_stars_repo_name": "EvilPsyCHo/Deep-Time-Series-Prediction", "max_stars_repo_head_hexsha": "f6a6da060bb3f7d07f2a61967ee6007e9821064e", "max_stars_repo_licenses": ["Apache... |
module asflowf_cube_to_vtk
use asflowf_crystal, only : write_xyz
use asflowf_cube, only : cube
use asflowf_constants
implicit none
contains
subroutine cube_to_vtk(cube_file_in, vtk_file_out)
integer :: i, j, k
integer :: ngridx, ngridy, ngridz
ty... | {"hexsha": "7644fbbea96b4d2c45433b2f136d7c6712e3a006", "size": 5060, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "fortran/atomsciflowf/src/cube_to_vtk.f90", "max_stars_repo_name": "DeqiTang/build-test-atomsciflow", "max_stars_repo_head_hexsha": "6fb65c79e74993e2100fbbca31b910d495076805", "max_stars_repo_lic... |
##
# @file casmo.py
# @package openmoc.compatible.casmo
# @brief The parsing module provides utility functions to parse in data
# necessary to construct assembly geometries in OpenMOC
# @author Davis Tran (dvtran@mit.edu)
# @date April 24, 2014
import numpy
import h5py
import os
import openmoc.log as log
##
#... | {"hexsha": "e18058b718c694eb84a9ffb485e1cd13f6f45e10", "size": 32974, "ext": "py", "lang": "Python", "max_stars_repo_path": "openmoc/compatible/casmo.py", "max_stars_repo_name": "AI-Pranto/OpenMOC", "max_stars_repo_head_hexsha": "7f6ce4797aec20ddd916981a56a4ba54ffda9a06", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
function fig()
figure
| {"author": "Sable", "repo": "mcbench-benchmarks", "sha": "ba13b2f0296ef49491b95e3f984c7c41fccdb6d8", "save_path": "github-repos/MATLAB/Sable-mcbench-benchmarks", "path": "github-repos/MATLAB/Sable-mcbench-benchmarks/mcbench-benchmarks-ba13b2f0296ef49491b95e3f984c7c41fccdb6d8/18016-video-demonstration-of-how-to-use-matl... |
!------------------------------------------------------------------------!
! The Community Multiscale Air Quality (CMAQ) system software is in !
! continuous development by various groups and is based on information !
! from these groups: Federal Government employees, contractors working !
! within a United ... | {"hexsha": "e2e2c2c840c8459d2c6b39865e242875949a835d", "size": 3577, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "CCTM/src/STENEX/noop/noop_global_sum_module.f", "max_stars_repo_name": "Simeng-unique/CMAQ-changed", "max_stars_repo_head_hexsha": "cb83401728ed7ea1bb19a6986c0acc84dabe11a4", "max_stars_repo_licen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.