text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
% SIAM Article Template
\documentclass[review,onefignum,onetabnum]{siamart171218}
% Information that is shared between the article and the supplement
% (title and author information, macros, packages, etc.) goes into
% ex_shared.tex. If there is no supplement, this file can be included
% directly.
\input{ex_shared}
... | {"hexsha": "c7f0485eaf7ca01a5bd2b883ed91790cd36ec2b3", "size": 68627, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/latex_src/ex_article.tex", "max_stars_repo_name": "microprediction/winning", "max_stars_repo_head_hexsha": "f03b74fc87cfe4b317a3b0ac3e165bc5e49a39fc", "max_stars_repo_licenses": ["MIT"], "max_... |
# vim: expandtab tabstop=4 shiftwidth=4
from numpy import array as nparray
from numpy import floor, ceil, sqrt, log2, log10, arange
from matplotlib import pyplot as plt
from dspftw import decimal_convert_to_base, vector_power
def constellation_plot(constellation: nparray, binary_mode: int=0, scale: int=100):
"""... | {"hexsha": "a7b9da981f1311ef2210ce1ee3928af0d9f3a4da", "size": 2723, "ext": "py", "lang": "Python", "max_stars_repo_path": "dspftwplot/constellation_plot.py", "max_stars_repo_name": "dspftw/dspftwplot", "max_stars_repo_head_hexsha": "2dd7e7300bfb86062a978fbc2b7afe583fa96c05", "max_stars_repo_licenses": ["MIT"], "max_st... |
#---------------------------------------------------------------------
#* only vapour phase
#*--------------------------------------------------------------------
type tank_vap
tank_vap()=begin
new(
tank_basic(),
[
:(_base_1.Outletm.v = 1),
:(_base_1.Outletm.h = _base_1.PP.VapourEnthalpy(_base_1.Outlet... | {"hexsha": "0ff811c66cee40b70c8257ba10be9a1d793ffc11", "size": 1177, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "JuliaEMSOModels/reactors/tank_basic/tank_vap.jl", "max_stars_repo_name": "DANA-Laboratory/EMSOModelLibrary.jl", "max_stars_repo_head_hexsha": "e28904cc1bdf8f67c6839ad35b4658dd399c0e47", "max_stars_... |
import numpy as np
import matplotlib.pyplot as plt
import os
from PIL import Image
def change_range(data, input_min, input_max, output_min, output_max):
result = ((data - input_min) / (input_max - input_min)) * (output_max - output_min) + output_min
return result
def plot_other(imgs, subtitles, title='', nc... | {"hexsha": "1800d62edd230e9f10afba48a18883e77cce0f4e", "size": 1614, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/misc_img_func.py", "max_stars_repo_name": "dora-alvarado/robust-MTA-detection-modeling", "max_stars_repo_head_hexsha": "9e8f48c3ec0d532162d0dd0912ed25096dc6b57c", "max_stars_repo_licenses": ["... |
import os
from pathlib import Path
from abc import abstractmethod
from typing import Type, Dict, Sequence, List, Callable, Tuple
import torch
import numpy as np
from tqdm import tqdm
from loguru import logger
from torchvision.models.detection.rpn import AnchorGenerator
from nndet.utils.info import SuppressPrint
with... | {"hexsha": "cc048039c6c0d1aa8547a8934361f4950e5117a5", "size": 27030, "ext": "py", "lang": "Python", "max_stars_repo_path": "nndet/planning/architecture/boxes/base.py", "max_stars_repo_name": "joeranbosma/nnDetection", "max_stars_repo_head_hexsha": "2ebbf1cdc8a8794c73e325f06fea50632c78ae8c", "max_stars_repo_licenses": ... |
from datetime import datetime
from collections import defaultdict
import numpy as np
import h5py
import pandas as pd
from exetera.core import exporter, persistence, utils
from exetera.core.persistence import DataStore
def method_paper_summary_pipeline(ds, src_data, dest_data, first_timestamp, last_timestamp):
s_p... | {"hexsha": "7d087d573c02c30c3b678d08aa62dcddd31af2e0", "size": 10119, "ext": "py", "lang": "Python", "max_stars_repo_path": "exeteracovid/scripts/method_paper_summary.py", "max_stars_repo_name": "deng113jie/ExeTeraCovid", "max_stars_repo_head_hexsha": "ee9ec90983d7c2c711962c7fe9ac25251392e41b", "max_stars_repo_licenses... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""harrypotter magicawakened auto quiz
auto_quiz is the friendly quiz fork by biechuyangwang (and Contributors).
https://github.com/biechuyangwang/universalautomaticanswer/
usage:
python auto_quiz.py
Interactive input
sel:
{1:大神云游戏麻瓜,2:魔法史,3:院活,4:麻瓜多开,5:魔法史多... | {"hexsha": "4042e9c768d03ba2571cbaa03738f7f3c78f227c", "size": 31377, "ext": "py", "lang": "Python", "max_stars_repo_path": "mumu_auto_quiz.py", "max_stars_repo_name": "biechuyangwang/UniversalAutomaticAnswer", "max_stars_repo_head_hexsha": "4c558396cc04b36224e9be4409f80f9654c4aa88", "max_stars_repo_licenses": ["Apache... |
"""
Camera module for camera calibration and undistorting camera images
"""
import pickle
import logging
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
class Warper:
def __init__(self):
bottom = 720
left = 210
right = 1110
top = 460
top_left = 5... | {"hexsha": "a9f047e05165e31d4cc531e8161b7501a46c3e33", "size": 6945, "ext": "py", "lang": "Python", "max_stars_repo_path": "camera.py", "max_stars_repo_name": "flsilves/CarND-Advanced-Lane-Lines", "max_stars_repo_head_hexsha": "5f4c3bf29d52df56371740d576e7a8c6d9db21ae", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
# This file was generated, do not modify it. # hide
yMode = [mode(ŷ[i]) for i in 1:length(ŷ)]
y = coerce(y[:,1], OrderedFactor)
yMode = coerce(yMode, OrderedFactor)
confusion_matrix(yMode, y) | {"hexsha": "6809c54c8f2d3da959e81ec72256cfff37c1d12f", "size": 191, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "__site/assets/end-to-end/glm/code/ex12.jl", "max_stars_repo_name": "giordano/DataScienceTutorials.jl", "max_stars_repo_head_hexsha": "8284298842e0d77061cf8ee767d0899fb7d051ff", "max_stars_repo_licen... |
#%%
import random
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras as keras
import numpy as np
import pickle
from sklearn.model_selection import StratifiedKFold
from math import log2, ceil
import sys
sys.path.append("../../src/")
from lifelong_dnn import LifeLongDNN
from joblib import... | {"hexsha": "fd952ed530a45bdb391e35178a5040b264aa2371", "size": 5043, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/xor_rxor_spiral_exp/control_exp.py", "max_stars_repo_name": "mkusman1/progressive-learning", "max_stars_repo_head_hexsha": "af26fc89a14d6d41505d10d0d30a949ef8aa69d9", "max_stars_repo_l... |
import numpy as np
from numpy.random import default_rng
from scipy.special import expit
import numpy.linalg as la
from scipy.sparse import coo_matrix, csr_matrix, hstack, vstack
from prep_data import number_of_features
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
import warn... | {"hexsha": "fc7cef95a51756866daa1d827888d67673bbda44", "size": 31725, "ext": "py", "lang": "Python", "max_stars_repo_path": "models.py", "max_stars_repo_name": "gaseln/FLIX_small_scale_experiments", "max_stars_repo_head_hexsha": "af9ebd7f192fc0f67a6a94af7939fd3d6f548bd6", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[GOAL]
α : Type u_1
β : Type u_2
inst✝ : TopologicalSpace α
r : Rel β α
l : Filter β
a : α
⊢ RTendsto' r l (𝓝 a) ↔ ∀ (s : Set α), IsOpen s → a ∈ s → Rel.preimage r s ∈ l
[PROOFSTEP]
rw [rtendsto'_def]
[GOAL]
α : Type u_1
β : Type u_2
inst✝ : TopologicalSpace α
r : Rel β α
l : Filter β
a : α
⊢ (∀ (s : Set α), s ∈ 𝓝 a ... | {"mathlib_filename": "Mathlib.Topology.Partial", "llama_tokens": 4179} |
import numpy as np
import aimsprop as ai
# => Parse/Align/Weight/Clean <= #
# Parse a series of FMS90 trajectories that Hayley has run for Stilbene
# Troubles: 11, 12 (not finished), 15
# trajs = [ai.parse_fms90('/home/hweir/stilbene/5-aims/s0_extension/aims_%04d/job1' % x) for x in range(1,16+1) if x not in [11, 12... | {"hexsha": "b6a95ab9125947de0051a09a5fa111a9b2be2c4e", "size": 2155, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/xray-1/example.py", "max_stars_repo_name": "mtzgroup/aimsprop", "max_stars_repo_head_hexsha": "464d88ad7a817da73027fd2ab7b12476bf59f83d", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
\documentclass[12pt]{article}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum} % for dummy text
\pagestyle{myheadings}
\pagestyle{fancy}
\fancyhf{}
\setlength{\headheight}{30pt}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{2pt}
\lhead{\includegraphics[width=1cm]{... | {"hexsha": "0eaf0ec18d7b4ac6d9968c56ff8c37314e26b75d", "size": 486, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "HS Bremerhaven Latex Vorlage/examples/header-footer-lastpage.tex", "max_stars_repo_name": "DiesDasJenes/Latex-Template-HS-Bremerhaven", "max_stars_repo_head_hexsha": "6579125cbaafe47b9d67508830673b7d... |
from __future__ import division
import math
import os
import numpy as np
import tensorflow as tf
from sklearn import metrics
from sklearn.datasets import load_svmlight_file
from sklearn.externals.joblib import Memory
from sklearn.model_selection import train_test_split
from tensorflow.examples.tutorials.mnist import ... | {"hexsha": "9db094265f5ba5451831a77afd8d7ea7a17b444f", "size": 14757, "ext": "py", "lang": "Python", "max_stars_repo_path": "m2_feat_AUC.py", "max_stars_repo_name": "chengweitsai/AUC-opt-DNN", "max_stars_repo_head_hexsha": "89de46983a68a4dc634402241dfd80d4a71e8795", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
# Dependencies
import openweathermapy.core as owm
import datetime
import pandas as pd
import numpy as np
import requests
import json
def get_lon_lat(city,country_code,units):
"""
This function gets weather forecast, lon and lat.
Input: "(city, country and units as parameters)"
Output: (fore... | {"hexsha": "c04f900339d77cc41b7ce218ebc7de3c2f68ccff", "size": 2340, "ext": "py", "lang": "Python", "max_stars_repo_path": "APIstuff/lonLat.py", "max_stars_repo_name": "teomotun/Restaurant-Plug", "max_stars_repo_head_hexsha": "1ecaab7bb60706ec0eca96c2f3efb31276c536e7", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
import unittest
import os
import sys
from contextlib import contextmanager
import numpy as np
from scipy.constants import pi
import matplotlib.pyplot as plt
from echonn.sys import Animator
class ExampleAnimator(Animator):
def __init__(self, max_step=10):
super().__init__()
self.t = np.arange(0, m... | {"hexsha": "9d929f8106f6a1ee6b2c0a629e2e717e3ebcb742", "size": 1766, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/test/sys/test_animator.py", "max_stars_repo_name": "larkwt96/honors-thesis", "max_stars_repo_head_hexsha": "7e3a52c285c1fdaf4ae9659497154ba04e522f48", "max_stars_repo_licenses": ["MIT"], "max_... |
# Copyright 2019 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | {"hexsha": "dbb4f1701c8d6e56b79444d193ee8a5b5676f904", "size": 12661, "ext": "py", "lang": "Python", "max_stars_repo_path": "perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py", "max_stars_repo_name": "inflatador/PerfKitBenchmarker", "max_stars_repo_head_hexsha": "9a12f44aa0c3fe6873e57a7920b1d13c006073e3", "max... |
# This file is a part of BAT.jl, licensed under the MIT License (MIT).
include("bat_sample.jl")
include("mcmc/mcmc.jl")
include("sampled_density.jl")
include("importance/importance_sampler.jl")
include("nested_sampling/nested_sampling.jl")
include("partitioned_sampling/partitioned_sampling.jl")
| {"hexsha": "6832c185862d2a3c53ae4e55d305aedf651c596d", "size": 297, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/samplers/samplers.jl", "max_stars_repo_name": "celaue/BAT.jl", "max_stars_repo_head_hexsha": "521366e992fb764877615af0926f1acaa7f2aea1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 13... |
[STATEMENT]
lemma CondInv:
assumes wp: "P \<subseteq> Q"
assumes inv: "Q \<subseteq> {s. (s\<in>b \<longrightarrow> s\<in>P\<^sub>1) \<and> (s\<notin>b \<longrightarrow> s\<in>P\<^sub>2)}"
assumes deriv_c1: "\<Gamma>,\<Theta>\<turnstile>\<^sub>t\<^bsub>/F\<^esub> P\<^sub>1 c\<^sub>1 Q,A"
assumes deriv_c2: "\<Ga... | {"llama_tokens": 1036, "file": "Simpl_HoareTotal", "length": 8} |
#ifndef GSL_WRAPPERS_H
#define GSL_WRAPPERS_H
// #include <gsl/gsl_check_range.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_permutation.h>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_eigen.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_multimin.h>
#include ... | {"hexsha": "02956b0c5ea2da80c20b865be7b6e33c136ac6ba", "size": 2806, "ext": "h", "lang": "C", "max_stars_repo_path": "scripts/lib/DTM/dtm/gsl-wrappers.h", "max_stars_repo_name": "iwangjian/dtm-lab", "max_stars_repo_head_hexsha": "07c936c07d268208dcc2f19e07fb8d2a18e39ba8", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
"""This is a exmaple of random walke simultion using the WExplore
resampler.
"""
import sys
import os
import os.path as osp
import numpy as np
from wepy.resampling.resamplers.wexplore import WExploreResampler
from wepy.resampling.distances.randomwalk import RandomWalkDistance
from wepy.runners.randomwalk import Rando... | {"hexsha": "69705beeff028018ce849bfc4c8d3801e8e4290d", "size": 2813, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/RandomWalk/rw_wexplore.py", "max_stars_repo_name": "edeustua/wepy", "max_stars_repo_head_hexsha": "f1a2ef5c8cc368d5602c9d683983b3af69a48ce2", "max_stars_repo_licenses": ["MIT"], "max_star... |
import Data.Nat
import Data.Vect
{-
Exercise 1
Using plusZeroRightNeutral and plusSuccRightSucc, write your own version of plusCommutes:
myPlusCommutes : (n : Nat) -> (m : Nat) -> n + m = m + n
Hint: Write this by case splitting on n. In the case of S k,
you can rewrite with a recursive call to myPlusCommutes k m,... | {"hexsha": "c042d3b49ce8174ff51fcd470755806818565b02", "size": 1414, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "src/ch8/ex_8_2.idr", "max_stars_repo_name": "trevarj/tdd_idris_examples", "max_stars_repo_head_hexsha": "63a7128a797b64cb0ba54562778cdf9712b4d9f5", "max_stars_repo_licenses": ["Unlicense"], "max_s... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... | {"hexsha": "b9d35b7faf09a48e842e8ac2107e1072c1e1ee2e", "size": 37765, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/kudu/master/sentry_privileges_fetcher.cc", "max_stars_repo_name": "toddlipcon/kudu", "max_stars_repo_head_hexsha": "e5ee5e08c68c9c661ce676ad629b4ad3abf57def", "max_stars_repo_licenses": ["Apache... |
###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... | {"hexsha": "600b7147e49b817ff4e51e080847cbbf43710ef8", "size": 4984, "ext": "py", "lang": "Python", "max_stars_repo_path": "watertap/examples/flowsheets/case_studies/wastewater_resource_recovery/metab/tests/test_metab.py", "max_stars_repo_name": "k1nshuk/watertap", "max_stars_repo_head_hexsha": "b565687409e400183148622... |
# # Heat Equation
#
# This example demonstrates how to combine `OrdinaryDiffEq` with `DiffEqOperators` to solve a time dependent PDE.
# We consider the heat equation on the unit interval, with dirichlet boundary conditions:
# ∂ₜu = Δu
# u(x=0,t) = a
# u(x=1,t) = b
# u(x, t=0) = u₀(x)
#
# For `a = b = 0` and `u₀(x) = ... | {"hexsha": "16bd41ffbc1eee3ee81a4dce64cb6f34b4742de4", "size": 891, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/heat_equation.jl", "max_stars_repo_name": "FuZhiyu/DiffEqOperators.jl", "max_stars_repo_head_hexsha": "a55b696ec6f4fe8b0307a2dcfec06665a382a7d2", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
from guesswhat.statistics.abstract_plotter import *
import seaborn as sns
import matplotlib.pyplot as plt
import collections
class QuestionVsObject(AbstractPlotter):
def __init__(self, path, games, logger, suffix):
super(QuestionVsObject, self).__init__(path, self.__class__.__name__, ... | {"hexsha": "525e2fe07b4bc3ad353c325593113d834f61c2ce", "size": 1893, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/guesswhat/statistics/question_object.py", "max_stars_repo_name": "devineproject/guesswhat", "max_stars_repo_head_hexsha": "512e136c868ceccf047cdba243cf46037d4037fe", "max_stars_repo_licenses":... |
!
! CalculiX - A 3-dimensional finite element program
! Copyright (C) 1998-2015 Guido Dhondt
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation(version 2);
!
!
! ... | {"hexsha": "2affb842a8b84cb990f32f114330f90265cefed1", "size": 10630, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ccx_prool/CalculiX/ccx_2.9/src/fillknotmpc.f", "max_stars_repo_name": "alleindrach/calculix-desktop", "max_stars_repo_head_hexsha": "2cb2c434b536eb668ff88bdf82538d22f4f0f711", "max_stars_repo_lic... |
[STATEMENT]
lemma db\<^sub>s\<^sub>s\<^sub>t_in_cases:
assumes "(t,s) \<in> set (db'\<^sub>s\<^sub>s\<^sub>t A I D)"
shows "(t,s) \<in> set D \<or> (\<exists>t' s'. insert\<langle>t',s'\<rangle> \<in> set A \<and> t = t' \<cdot> I \<and> s = s' \<cdot> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (t, s) \<... | {"llama_tokens": 1602, "file": "Stateful_Protocol_Composition_and_Typing_Stateful_Strands", "length": 6} |
from path import Path
from utils.formater import mc2pose6dof,kitti2pose6dof
from utils.formater import eular2rotcoord,vec_length
import numpy as np
import matplotlib.pyplot as plt
def norm(arr):
max = arr.max()
min = arr.min()
arr = (arr-min)/(max-min)
return arr
def drawer():
PLOT2=True
# ... | {"hexsha": "750fd216af19ca9922cd2c8e3cd93888d8938251", "size": 2387, "ext": "py", "lang": "Python", "max_stars_repo_path": "viz/lambda_draw.py", "max_stars_repo_name": "xdr940/trajectory", "max_stars_repo_head_hexsha": "d4bf9e0cc9584cffd78dc469d15fb70a9e19f8d7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
sfftk.unittests.test_readers
This testing module should have no side-effects because it only reads.
"""
from __future__ import division, print_function
import glob
import os
import struct
import sys
import unittest
import numpy
import random_words
import __init__ a... | {"hexsha": "8e07779be64b5247716c3c8bb7b9dc225c5ec93a", "size": 17595, "ext": "py", "lang": "Python", "max_stars_repo_path": "sfftk/unittests/test_readers.py", "max_stars_repo_name": "ssabrii/sfftk", "max_stars_repo_head_hexsha": "5cab37f1c9ecb9c2507672fd3232b1b9b5405511", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
import os
import numpy as np
def process_file(filename):
"""Want to return tuple of the form:
(reaction, acqusition function, batch size, experiment budget, mean final yield, standard deviation)"""
final_yields = list()
with open(filename) as f:
for line in f.readlines()[1:]:
final_... | {"hexsha": "82e795c617df6192fbce4fff16edd9ca36f22c0c", "size": 1220, "ext": "py", "lang": "Python", "max_stars_repo_path": "Shields paper/test_bo_aryl_amination/data/summary_stats.py", "max_stars_repo_name": "Pseudonium/edbo", "max_stars_repo_head_hexsha": "fe7fb332ea1a90342950124160c590adab2f4e59", "max_stars_repo_lic... |
#include <boost/rational.hpp> /// For calculations related to sampling coefficients.
#include <optional>
#include <Common/FieldVisitors.h>
#include <Storages/MergeTree/MergeTreeDataSelectExecutor.h>
#include <Storages/MergeTree/MergeTreeBlockInputStream.h>
#include <Storages/MergeTree/MergeTreeReadPool.h>
#include <... | {"hexsha": "333f9c7cc6026c062023e1c8883cd18127a663ed", "size": 38608, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp", "max_stars_repo_name": "ywandy/ClickHouse", "max_stars_repo_head_hexsha": "a4093f2b1aba01eca7aa901bd0543f17c178b796", "max_stars_repo_l... |
import numpy as np
class Module:
def forward(self, X):
raise NotImplementedError
def __call__(self, X):
return self.forward(X)
def backward(self, X, grad):
raise NotImplementedError
class Sigmoid(Module):
def forward(self, X):
return 1/(1 + np.exp(-X))
... | {"hexsha": "bbd58534cddd65465e1b7270ec4f8fd44c4185d4", "size": 2224, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/modules.py", "max_stars_repo_name": "s-omranpour/MLP-Numpy", "max_stars_repo_head_hexsha": "7bb05e2c0b680fcd7b5a2c3449281a718b6ecb68", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,... |
import os, sys
import random
import numpy as np
data_dir = 'xsum'
train_path_src = os.path.join(data_dir, 'train.source')
train_path_tgt = os.path.join(data_dir, 'train.target')
dev_path_src = os.path.join(data_dir, 'val.source')
dev_path_tgt = os.path.join(data_dir, 'val.target')
test_path_src = os.path.join(data_di... | {"hexsha": "34b669cbaee7188b30716a2f1289709fec9acb66", "size": 2041, "ext": "py", "lang": "Python", "max_stars_repo_path": "transformers/examples/seq2seq/lowdata_gen.py", "max_stars_repo_name": "jordiclive/ControlPrefixes", "max_stars_repo_head_hexsha": "b647f68bf0c7e771f847c4a51e5f22af2ac95699", "max_stars_repo_licens... |
c
c ---------------------------------------------------------------
c
subroutine tirrfil(irr,nrow,ncol,xl,xr,yb,yt,level,lstnew)
c
c set the portion of the irregular array at the given level
c bounded by the given coordinates
c
implicit double precision (a-h,o-z)
logical graf
paramet... | {"hexsha": "af8477a3e0c13f8b8be26eca82638e3308f0ff8f", "size": 2684, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/2d/ag_ho/tirrfil.f", "max_stars_repo_name": "mjberger/ho_amrclaw_amrcart", "max_stars_repo_head_hexsha": "0e0d37dda52b8c813f7fc4bd7e61c5fdb33b0ada", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
"""
Author: Taiwo O. Adetiloye
Date: Dec 27, 2019
"""
"""Routes for logged-in application."""
from bokeh.plotting import figure
from bokeh.embed import components
from math import pi
import pandas as pd
from bokeh.palettes import Category20c
from bokeh.transform import cumsum
from flask import Blueprint, render_temp... | {"hexsha": "1280156e39a55ccf4892c81bb292b7b77afd1ff7", "size": 8076, "ext": "py", "lang": "Python", "max_stars_repo_path": "application/routes.py", "max_stars_repo_name": "taiwotman/flasklogin_neo4j", "max_stars_repo_head_hexsha": "11bbadc2c453ad222c468734d0feb82ca6f17c74", "max_stars_repo_licenses": ["MIT"], "max_star... |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 9 12:03:43 2018
Updated on Thu Dec 13 15:35:00 2018
@author: zhanglt
Python module for standard scorecard modeling
"""
from sklearn.linear_model import LogisticRegression
import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin... | {"hexsha": "e670da363012a29a9bafee72641f457e0120c243", "size": 16423, "ext": "py", "lang": "Python", "max_stars_repo_path": "scorecardbundle/model_training/LogisticRegressionScoreCard.py", "max_stars_repo_name": "zixuedanxin/Scorecard-Bundle", "max_stars_repo_head_hexsha": "1f87aed875123b6d3b8f4c0f41f5195975a0de66", "m... |
from __future__ import absolute_import
import os
import gym
import time
import math
import numpy as np
import urllib, hashlib
from collections import deque
from gym import error, spaces, utils
from gym.utils import seeding
from .four_keys_actions import FourKeysActions
from .four_keys_board_items import FourKeysBoard... | {"hexsha": "b170bd66fc39cbfbbdcfcbef1593877399463540", "size": 19629, "ext": "py", "lang": "Python", "max_stars_repo_path": "skypond/games/four_keys/four_keys_environment.py", "max_stars_repo_name": "upkoi/skypond", "max_stars_repo_head_hexsha": "5e366a18f2c5c85ce7b092d69b28c8f8aaad8718", "max_stars_repo_licenses": ["M... |
program main
integer :: ii, jj
logical :: ll
ii = 13 + 33
jj = ii
jj = 2021
ii = jj - jj
ii = (3 + 4)*5
ll = .false.
end program
| {"hexsha": "c4e9bf7bf21609f908fd3359ee2fe70d9decb33b", "size": 145, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/nonsmoke/functional/CompileTests/experimental_fortran_tests/expressions.f90", "max_stars_repo_name": "ouankou/rose", "max_stars_repo_head_hexsha": "76f2a004bd6d8036bc24be2c566a14e33ba4f825"... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
A module for walking through the query response of VO data access layer
(DAL) queries and general VOTable-based datasets.
Most data queries in the VO return a table as a result, usually
formatted as a VOTable. Each row of the table describes a single... | {"hexsha": "0ce777d97a5fce588d1b5a4c4325d1ebbd0613e5", "size": 32946, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyvo/dal/query.py", "max_stars_repo_name": "tomdonaldson/pyvo", "max_stars_repo_head_hexsha": "229820bd04b243a092b13e25362a7e1b258519f5", "max_stars_repo_licenses": ["BSD-3-Clause-No-Nuclear-Lice... |
//----------------------------------------------------------------------------
/** @file SgPointSetTest.cpp
Unit tests for SgSet.
*/
//----------------------------------------------------------------------------
#include "SgSystem.h"
#include <sstream>
#include <boost/test/auto_unit_test.hpp>
#include "SgPointSet... | {"hexsha": "70c0c40fd45689ec708d49faae2167dd405ab9c7", "size": 14267, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "fuego-0.4/smartgame/test/SgPointSetTest.cpp", "max_stars_repo_name": "MisterTea/HyperNEAT", "max_stars_repo_head_hexsha": "516fef725621991ee709eb9b4afe40e0ce82640d", "max_stars_repo_licenses": ["BS... |
@mlj_model mutable struct APIx0 <: Model
f0::Int
end
@mlj_model mutable struct APIx0b <: Model
f0::Int
end
mutable struct APIx1 <: Model end
@testset "selectrows(model, data...)" begin
X = (x1 = [2, 4, 6],)
y = [10.0, 20.0, 30.0]
@test selectrows(APIx0(), 2:3, X, y) == ((x1 = [4, 6],), [20.0, 30.0... | {"hexsha": "e42ebf5082557e7d5ec94fdd7bfff435a266bd1f", "size": 2254, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/model_api.jl", "max_stars_repo_name": "davnn/MLJModelInterface.jl", "max_stars_repo_head_hexsha": "b86722bbaa82b1550918eb796d3a674ac692d51d", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
function polys = readPolygonSet(filename)
%READPOLYGONSET Read a set of simple polygons stored in a file.
%
% POLY = readPolygonSet(FILENAME);
% Returns the polygon stored in the file FILENAME.
% Polygons are assumed to be stored in text files, without headers, with
% x and y coordinates packed in two separa... | {"author": "mattools", "repo": "matGeom", "sha": "1fd2c937064be1ee1f4fd09fbfdf96145ebe5271", "save_path": "github-repos/MATLAB/mattools-matGeom", "path": "github-repos/MATLAB/mattools-matGeom/matGeom-1fd2c937064be1ee1f4fd09fbfdf96145ebe5271/matGeom/polygons2d/readPolygonSet.m"} |
| pc = 0xc00e | a = 0x00 | x = 0x00 | y = 0x00 | sp = 0x01fb | p[NV-BDIZC] = 00110100 |
| {"hexsha": "a22caf5e63f72dbc36c5ff506cb2d0ab818546ca", "size": 88, "ext": "r", "lang": "R", "max_stars_repo_path": "res/jsr_wo_rts.r", "max_stars_repo_name": "JSpuri/EmuParadise", "max_stars_repo_head_hexsha": "b8f6cf8823f8553f28dab5c6b44df20978ad6ba0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
import numpy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
def updateIndexName(df, dictionary):
allIndex = df.index.values
for i in range(len(allIndex)):
if allIndex[i] in dictionary:
... | {"hexsha": "072b0cae283f96ee23b0adc8f51d5c8ee9a84ac4", "size": 5009, "ext": "py", "lang": "Python", "max_stars_repo_path": "TF activities Ligand Screen/convertToASNFormat.py", "max_stars_repo_name": "Lauffenburger-Lab/Artificial-Signaling-Network", "max_stars_repo_head_hexsha": "707e79c7e2ad341d68a719443b9e17fe9e7bb7c1... |
[STATEMENT]
lemma nat_explode'_digit: \<open>hd (nat_explode' n ) < 10\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. hd (nat_explode' n) < 10
[PROOF STEP]
proof(induct \<open>n\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. hd (nat_explode' 0) < 10
2. \<And>n. hd (nat_explode' n) < 10 \<Longr... | {"llama_tokens": 1618, "file": "Solidity_ReadShow", "length": 21} |
import numpy as np
from math import log10
from PyRadioLoc.Enums import LeeAreaType
from PyRadioLoc.Enums import AreaKind
from PyRadioLoc.Enums import CityKind
from PyRadioLoc.Enums import TerrainKind
__all__ = ['FreeSpaceModel',
'OkumuraHataModel',
'LeeModel',
'EricssonModel']
class FreeS... | {"hexsha": "73b2b5151ff793e4236b54f8a825473edbc54c70", "size": 8259, "ext": "py", "lang": "Python", "max_stars_repo_path": "PyRadioLoc/Pathloss/Models.py", "max_stars_repo_name": "mbs8/CMoveis", "max_stars_repo_head_hexsha": "52bec29194345caf669049e63878e39818900058", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import make_env_
# from gym.spaces
import prng
import numpy as np
import random
import pprint
import matplotlib.pyplot as plt
import pandas as pd
# plt.style.use('seaborn')
# creates an multiagent environment which has reset, render, step
env = make_env_.make_env('traffic',benchmark=True) # ! 2vs1 Swarm environment
... | {"hexsha": "b6bbc42100301a545323963acba25dbebb584df7", "size": 2843, "ext": "py", "lang": "Python", "max_stars_repo_path": "deneme.py", "max_stars_repo_name": "kazimsanlav/RL_Traffic", "max_stars_repo_head_hexsha": "afac032af989fe8e08746b47dcb69732fab73e83", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
# -*- coding: utf-8 -*-
import sys, os
# path = os.path.dirname(os.path.dirname(__file__))
path = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, os.path.join(path,'System'))
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
# from System.Network_3ph_pf import ... | {"hexsha": "efaf928be9776f4f5c8e4a15239fc2aeadb14405", "size": 17268, "ext": "py", "lang": "Python", "max_stars_repo_path": "Test_Scripts/zbus_3ph_pf_test_MD.py", "max_stars_repo_name": "LF2L/OPEN", "max_stars_repo_head_hexsha": "4ed3f79be0b128ce623e48758d48eae30c4e7686", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
function i4vec_write ( output_filename, n, x )
%*****************************************************************************80
%
%% I4VEC_WRITE writes an I4VEC file.
%
% Discussion:
%
% An I4VEC is a vector of I4's.
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% ... | {"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/cc_io/i4vec_write.m"} |
[STATEMENT]
lemma singleton_times_right_hmset[simp]: "N * \<omega>^M = HMSet (image_mset ((+) M) (hmsetmset N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. N * \<omega>^ M = HMSet (image_mset ((+) M) (hmsetmset N))
[PROOF STEP]
by (metis mult.commute singleton_times_left_hmset) | {"llama_tokens": 123, "file": "Nested_Multisets_Ordinals_Syntactic_Ordinal", "length": 1} |
!################################################################
!################################################################
!################################################################
!################################################################
subroutine make_boundary_force(ilevel)
use amr_commons... | {"hexsha": "df8306e82e9c0d6da8ba91196afb901272837a79", "size": 11480, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/amuse/community/ramses/src/poisson/boundary_potential.f90", "max_stars_repo_name": "rknop/amuse", "max_stars_repo_head_hexsha": "85d5bdcc29cfc87dc69d91c264101fafd6658aec", "max_stars_repo_l... |
\documentclass[leqno,labelfig,psfigt]{svmono}
%\usepackage{showkeys}
%\openup8pt
%\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
\makeatletter
\providecommand*{\input@path}{}
\edef\input@path{{./}{../}\input@path}% prepend
%\makeatother
\input{../Xmacros}
%\renewcommand{\mgnote}[1]{}
\usepackage{geometry}
\geomet... | {"hexsha": "eb0c1f403fba5663575c3e44825d85026985d71f", "size": 4723, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "6DL/FEM-DNN.tex", "max_stars_repo_name": "liuzhengqi1996/math452", "max_stars_repo_head_hexsha": "635b6ce53cb792e316abf4f47396f2e4f0686815", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import tkinter as tk
import tkinter.filedialog as fd
import tkinter.messagebox as mb
import numpy as np
import pyknotid
import pyknotid.spacecurves as pkidsc
from pyknotid.spacecurves import Knot
import sympy
import csv
import os
# set initial values
gc_str = ""
fileopen = False
t = sympy.Symbol("t") # for use in dis... | {"hexsha": "1664d20f3cee1e0ef0ad89348963716c33e587bd", "size": 35459, "ext": "py", "lang": "Python", "max_stars_repo_path": "whyknot-big-boys.py", "max_stars_repo_name": "luccapaldi/whyknot", "max_stars_repo_head_hexsha": "bb6a1f768b0cd7d39cc966c2a512240b9c8ca9f3", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
"""
TESTS::
sage: R.<x,y> = QQbar[]
sage: from sage.rings.polynomial.multi_polynomial_ring_generic import MPolynomialRing_generic
doctest:...: DeprecationWarning: the module sage.rings.polynomial.multi_polynomial_ring_generic is deprecated, use sage.rings.polynomial.multi_polynomial_ring_base instead.
... | {"hexsha": "da84dba6c9553f63c05bb3f3b318c24bee4d3dfa", "size": 751, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sage/rings/polynomial/multi_polynomial_ring_generic.py", "max_stars_repo_name": "bopopescu/sage", "max_stars_repo_head_hexsha": "2d495be78e0bdc7a0a635454290b27bb4f5f70f0", "max_stars_repo_licen... |
c full copy and timings tests
program test73
integer n, i, j, time, ntime
parameter (n=1024)
parameter (ntime=10)
real a(n,n), b(n,n)
cfcd$ setbool('HPFC_LAZY_MESSAGES',0)
cfcd$ setbool('HPFC_USE_BUFFERS', 1)
chpf$ dynamic a, b
chpf$ template tc(n,n), tb(n,n)
chpf$ processors p(2,2)
chpf$ ... | {"hexsha": "558f46e59b806c13b9353543468276aa2a6cff9e", "size": 1454, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/PIPS/validation/Hpfc/hpftest73c.f", "max_stars_repo_name": "DVSR1966/par4all", "max_stars_repo_head_hexsha": "86b33ca9da736e832b568c5637a2381f360f1996", "max_stars_repo_licenses": ["MIT"]... |
import sys
sys.path.append('..')
import torch
from torch_geometric.datasets import Planetoid
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch_geometric.nn import GCNConv
from bijou.data import PyGDataWrapper, DataBunch
from bijou.learner import Learner
from bijou.metrics imp... | {"hexsha": "72129cba1949fa540802a2c0901e198b6124ae77", "size": 2302, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/gnn-04-node_interprete.py", "max_stars_repo_name": "Tomas1861/bijou", "max_stars_repo_head_hexsha": "8db9a42a138c7480385c752c8106e35dd067a493", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma interchange:
assumes "seq \<nu> \<mu>" and "seq \<tau> \<sigma>"
shows "(\<nu> \<cdot> \<mu>) \<star> (\<tau> \<cdot> \<sigma>) = (\<nu> \<star> \<tau>) \<cdot> (\<mu> \<star> \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<nu> \<cdot> \<mu> \<star> \<tau> \<cdot> \<sigma> = (\<... | {"llama_tokens": 340, "file": "Bicategory_Prebicategory", "length": 2} |
# coding: utf8
import string
import numpy as np
from collections import Counter
from examples.commons.vocabulary import Vocabulary
from examples.commons.sequence_vocabulary import SequenceVocabulary
class NewsVectorizer(object):
def __init__(self, title_vocab, category_vocab):
self.title_vocab = title_v... | {"hexsha": "76ddb56242583666efc2e63fb555b903c903cc41", "size": 2042, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/doc_classification_with_pretrained_embeddings/news_vectorizer.py", "max_stars_repo_name": "Jochen-M/pytorch_nlp", "max_stars_repo_head_hexsha": "75ffbe60d1a9c383981396f346c6dcbabbb9e5d7",... |
from __future__ import annotations
import typing
import sympy
from polygon import Polygon
from sector import Sector
if typing.TYPE_CHECKING:
from circle import Circle
from point import Point
class Segment:
def __init__(self, circle: Circle, point_1: Point, point_2: Point) -> None:
self.circle =... | {"hexsha": "4a16c28859465e18f6edc7a3e5586d1acbc0267c", "size": 863, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_structures/math/geometry/2D/segment.py", "max_stars_repo_name": "Pysics/Algorithm", "max_stars_repo_head_hexsha": "223f618e3e6d96e15091783b81b90ee00c771e8f", "max_stars_repo_licenses": ["MIT"]... |
#ifndef NETWORKS_HPP
#define NETWORKS_HPP
// For External Library
#include <torch/torch.h>
#include <boost/program_options.hpp>
// Define Namespace
namespace nn = torch::nn;
namespace po = boost::program_options;
// Function Prototype
void weights_init(nn::Module &m);
void LinearLayer(nn::Sequential &sq, const size_... | {"hexsha": "c713c54fc72798d53a37a71ab1faa7500f99015d", "size": 769, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "Dimensionality_Reduction/AE1d/src/networks.hpp", "max_stars_repo_name": "o8r/pytorch_cpp", "max_stars_repo_head_hexsha": "70ba1e64270da6d870847c074ce33afb154f1ef8", "max_stars_repo_licenses": ["MIT"]... |
# -*- coding: utf-8 -*-
from collections import OrderedDict
import datetime
from django.db import connection
import numpy
import time
def relativedelta2seconds(r):
u"""Conversion d'un relative delta en floatant."""
if r is None:
return 0
return (
r.days * 24 * 60 * 60 +
r.hours * ... | {"hexsha": "de91ac22608d9e2cd42f38225eb04282cad39f70", "size": 2237, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/temps_integration3.py", "max_stars_repo_name": "court-jus/dotfiles", "max_stars_repo_head_hexsha": "f8294dba47cc9e7f0f8b5c645dde13ff34e45124", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma ir_While_backwards_both:
"(\<And>n. ir_hoare (\<lambda> s s'. P n s s' \<and> bval b s \<and> bval b' s') c c' (P (Suc n))) \<Longrightarrow>
ir_hoare (P 0) (WHILE b DO c) (WHILE b' DO c') (\<lambda>s s'. \<exists>n. P n s s' \<and> \<not> bval b s \<and> \<not> bval b' s')"
[... | {"llama_tokens": 735, "file": "Relational-Incorrectness-Logic_RelationalIncorrectness", "length": 3} |
import cv2
import numpy as np
def resize_tensor(tensor, new_shape):
"""
Resize a numeric input 3D tensor with opencv. Each channel is resized independently from the others.
Parameters
----------
tensor: ndarray
Numeric 3D tensor of shape (channels, h, w)
new_shape: tuple
T... | {"hexsha": "0aeed160500e092c1bbb4f07d6f14cb592def41a", "size": 1152, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensor_manipulation.py", "max_stars_repo_name": "ndrplz/computer_vision_utils", "max_stars_repo_head_hexsha": "869ca8d5dcd6a95392d67127aa2a43042b33993c", "max_stars_repo_licenses": ["MIT"], "max_s... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
A helper script to generate N permutations for M patches. The permutations are
selected based on hamming distance.
"""
import argparse
impo... | {"hexsha": "36cee39811bde694ce6c392fcaa190093558a184", "size": 3876, "ext": "py", "lang": "Python", "max_stars_repo_path": "extra_scripts/generate_jigsaw_permutations.py", "max_stars_repo_name": "blazejdolicki/vissl", "max_stars_repo_head_hexsha": "9c10748a19fb1c637f32687142c8cd685f2410ff", "max_stars_repo_licenses": [... |
*
* Definition:
* ===========
*
* SUBROUTINE CGELQ( M, N, A, LDA, WORK1, LWORK1, WORK2, LWORK2,
* INFO)
*
* .. Scalar Arguments ..
* INTEGER INFO, LDA, M, N, LWORK1, LWORK2
* ..
* .. Array Arguments ..
* COMPLEX*16 A( LDA, * ), WORK1( * ... | {"hexsha": "2e188df9c9026053951ae040197b97f50097fe2e", "size": 7925, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "SRC/zgelq.f", "max_stars_repo_name": "sydha/Lapack", "max_stars_repo_head_hexsha": "1290e6b39b73b2431976e0a9b7fb7d78aeab3ba7", "max_stars_repo_licenses": ["BSD-3-Clause-Open-MPI"], "max_stars_coun... |
import os, stat
import warnings
from nustar_gen.utils import energy_to_chan, validate_det1_region
from astropy import units as u
def make_spectra(infile, mod, src_reg,
mode='01', bgd_reg='None', outpath='None', runmkarf='yes', extended='no'):
'''
Generate a script to run nuproducts to extract a source (an... | {"hexsha": "f7eb24935af516bf0c1e47e2fa0006ba5f75b447", "size": 30666, "ext": "py", "lang": "Python", "max_stars_repo_path": "nustar_gen/wrappers.py", "max_stars_repo_name": "rmludlam/nustar-gen-utils", "max_stars_repo_head_hexsha": "96e76f7bf4c16fb0bb7d1d99fdfdaa0f6010b320", "max_stars_repo_licenses": ["MIT"], "max_sta... |
export Tile, render
@doc """
A `Tile` is the basic currency in Canvas.
Most of the functions in the Canvas API take `Tile`s
among other things as arguments, and return a `Tile` as the result.
Tiles are immutable: once created there is no way to mutate them.
""" ->
abstract Tile
render{T <: Tile}(x::T) =
error("$... | {"hexsha": "95956211958f77813bf479aaa00198f68795366f", "size": 2476, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/basics/tile.jl", "max_stars_repo_name": "aviks/Canvas.jl", "max_stars_repo_head_hexsha": "6b1b6d8b2ae539c6eae9049cc210395ae80c4f46", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m... |
import .ops
open subtype nnf
@[simp] def force {states : Type} (k : kripke states) : states → nnf → Prop
| s (var n) := k.val n s
| s (neg n) := ¬ k.val n s
| s (and φ ψ) := force s φ ∧ force s ψ
| s (or φ ψ) := force s φ ∨ force s ψ
| s (box φ) := ∀ s', k.rel s s' → force s' φ
| s (dia φ) := ∃ s', k.re... | {"author": "minchaowu", "repo": "ModalTab", "sha": "9bb0bf17faf0554d907ef7bdd639648742889178", "save_path": "github-repos/lean/minchaowu-ModalTab", "path": "github-repos/lean/minchaowu-ModalTab/ModalTab-9bb0bf17faf0554d907ef7bdd639648742889178/src/K/semantics.lean"} |
from functools import lru_cache
from dunders import dunders, maths
from numbers import Number
import numpy as np
class BaseNumber(Number):
def copy(self):
return self.__class__(self)
def inverse(self):
return self.conjugate() / self.square()
def square(self):
return (self.conjugate() * self).real
def... | {"hexsha": "b19a19636fefd7c6437edd86e125469927b49cfe", "size": 14743, "ext": "py", "lang": "Python", "max_stars_repo_path": "hypercomplex.py", "max_stars_repo_name": "tallenglish/cayleydickenson", "max_stars_repo_head_hexsha": "6bf9e016968801183adf697e872c405a0073239a", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
# File to specify the project exports
# It is not a module as it is just included by the JavaCall module
# to facilitate the exports
export
# Init Options
defaultopts, fromcurrentvm, forjavahome, setfromcurrentvm!, unsetfromcurrentvm!,
setjavahome!, unsetjavahome!, pushclasspath!, pushoptions!,
# JNI
# Ty... | {"hexsha": "77b4f524035e36a6b02d587b171bc8fc8c08265f", "size": 750, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/exports.jl", "max_stars_repo_name": "DuarteMRAlves/JavaCall.jl", "max_stars_repo_head_hexsha": "75255fde4693836d3653e0fd177c69780259d21d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
function [u,x]=SFrontTrack(u0,x0,T,u_flux,f_flux);
% Doing front tracking on the initial fronts defined by (u0,x0) in the
% time interval [0 T]. The piecewise linear flux function is in (u_flux,
% f_flux). u0 must take values in the set {u_flux}.
% This version plots the fronts as the Riemann problmes are solved.
[u... | {"author": "wme7", "repo": "Aero-matlab", "sha": "9430008f2e3b84f28633775a44dff534e780fbac", "save_path": "github-repos/MATLAB/wme7-Aero-matlab", "path": "github-repos/MATLAB/wme7-Aero-matlab/Aero-matlab-9430008f2e3b84f28633775a44dff534e780fbac/OperatorSplitting/AppendixA/Scalar_Fronttracking/SFrontTrack.m"} |
function rs = spec(s)
%tstoolbox/@signal/spec
% Syntax:
% * rs = spec(s)
%
% compute power spectrum for real valued scalar signals. Multivariate
% signals are accepted but may produce unwanted results as only the
% spectrum of the first column is returned.
%
% Copyright 1997-2001 DPI Goettingen, License ht... | {"author": "benfulcher", "repo": "hctsa", "sha": "919f2aed7cc8e1a3a03304c1ade573fa664c73f8", "save_path": "github-repos/MATLAB/benfulcher-hctsa", "path": "github-repos/MATLAB/benfulcher-hctsa/hctsa-919f2aed7cc8e1a3a03304c1ade573fa664c73f8/Toolboxes/OpenTSTOOL/tstoolbox/@signal/spec.m"} |
import tempfile
import numpy as np
import pysinsy
import soundfile as sf
import streamlit as st
from nnmnkwii.io import hts
from nnsvs.pretrained import create_svs_engine
st.title("NNSVS Demo")
st.markdown("Upload your .xml music file with text as input to make it sing.")
models = {
"kiritan": "r9y9/20220321_kir... | {"hexsha": "2c0600fb4e10879b809647330c166c9d5cdbce18", "size": 1284, "ext": "py", "lang": "Python", "max_stars_repo_path": "streamlit_demo/app.py", "max_stars_repo_name": "r9y9/dnnsvs", "max_stars_repo_head_hexsha": "b028f76fd4f081859ec99a2034e0e0dc8ce1a409", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 72, "... |
""" philoseismos: with passion for the seismic method.
This file defines a BinaryFileHeader object that represents
a Binary File Header from a SEG-Y file.
@author: Ivan Dubrovin
e-mail: dubrovin.io@icloud.com """
from philoseismos.segy.tools.constants import BFH_columns, BFH_format_string
from philoseismos.segy impo... | {"hexsha": "eeedfbf10952f616ab8804e2cc08d240cbdf75e0", "size": 4198, "ext": "py", "lang": "Python", "max_stars_repo_path": "philoseismos/segy/components/BinaryFileHeader.py", "max_stars_repo_name": "sir-dio/old-philoseismos", "max_stars_repo_head_hexsha": "4c830971641313abd95693b24965ede261c6824b", "max_stars_repo_lice... |
#!/usr/bin/env python
# encoding: utf-8
"""
@author: Shanda Lau 刘祥德
@license: (C) Copyright 2019-now, Node Supply Chain Manager Corporation Limited.
@contact: shandalaulv@gmail.com
@software:
@file: read_img.py
@time: 5/18/20 5:47 PM
@version 1.0
@desc:
"""
import cv2
import numpy as np
import os
from pathlib import P... | {"hexsha": "667ff8bd17604dc973050688e5e634c881b1ee5b", "size": 931, "ext": "py", "lang": "Python", "max_stars_repo_path": "cast/read_img.py", "max_stars_repo_name": "JinShiyin/sast_backend", "max_stars_repo_head_hexsha": "b2e282d393497da1d300d83c1a045c9f78f854ea", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import unittest
from vigeneretranslator import *
from .. import utils
import numpy
class TestVigenereTranslator(unittest.TestCase):
def setUp(self):
self.T = VigenereTranslator("ABC")
def test_translate(self):
self.assertEqual(self.T.translate("AAABBB"), "BCDCDE")
def test_encode(self):
... | {"hexsha": "bd752ebb58a2d4de5ded177b5c57e3e1543d8465", "size": 420, "ext": "py", "lang": "Python", "max_stars_repo_path": "pycrypt/translators/test_vigeneretranslator.py", "max_stars_repo_name": "mathead/pycrypt", "max_stars_repo_head_hexsha": "4534c965dcf7202e41a6c93da05d55cad83fea3c", "max_stars_repo_licenses": ["BSD... |
(** * Macros for the definition of HILECOP Place and Transition designs. *)
Require Import NArith.
Require Import AbstractSyntax.
Require Import GlobalTypes.
Require Import HVhdlTypes.
(** /!\ We must ensure that the identifiers generated by the SITPN to
VHDL transformation does override the set of reserved
i... | {"author": "viampietro", "repo": "ver-hilecop", "sha": "cb539e9bf4e73f70d8e039fd56ddcfccd1e660d4", "save_path": "github-repos/coq/viampietro-ver-hilecop", "path": "github-repos/coq/viampietro-ver-hilecop/ver-hilecop-cb539e9bf4e73f70d8e039fd56ddcfccd1e660d4/hvhdl/Petri.v"} |
import math
import numpy as np
from PIL import Image
from skimage import color, io
def load(image_path):
"""Loads an image from a file path.
HINT: Look up `skimage.io.imread()` function.
Args:
image_path: file path to the image.
Returns:
out: numpy array of shape(image_height, image... | {"hexsha": "2a53fd0b9780f12eb59242f1d0d55df500351b6c", "size": 5769, "ext": "py", "lang": "Python", "max_stars_repo_path": "hw0_release/imageManip.py", "max_stars_repo_name": "YuanSun-au/CS131", "max_stars_repo_head_hexsha": "2f0e4896beb80926636bdf2fb57a119ae77ff45a", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#!/usr/bin/env python
# import required libraries
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
import sys
import numpy as np
from pyrf.devices.thinkrf import WSA
from pyrf.util import read_data_and_context
from pyrf.numpy_util import compute_fft
from pyrf.connectors.twisted_async import TwistedConnect... | {"hexsha": "c34758e3b3d945cd172393af390058d419db1684", "size": 2151, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/twisted_pyqtgraph_plot.py", "max_stars_repo_name": "thelaly/pyrf", "max_stars_repo_head_hexsha": "52d7e8059dcd5e9dedd6a2a689124372836aae1c", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
import numpy as np
from typing import Dict, List
RatingType = Dict[str, float]
class GetStudents3Q():
def __init__(self, rating: RatingType) -> None:
self.rating: RatingType = rating
self.studetsq3: RatingType = {}
def get(self) -> RatingType:
rating_list = list(self.rating.values()... | {"hexsha": "eac411db4c7a615d9410b83255c79c8400f7a16f", "size": 610, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/GetStudents3Q.py", "max_stars_repo_name": "VsevolodOn/PTLab1", "max_stars_repo_head_hexsha": "d1407a863af661660fc637b2ef20c6ff23cb94ff", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
function blkStruct = slblocks
%SLBLOCKS Define the Simulink library block representation.
%
% Define the Simulink library block representation for the Testing
% CP 10-11-05
% Copyright 2005-2006, Fraunhofer FOKUS
% $Revision: 1.0.0.0 $ $Date: 2005/11/10 20:11:50 $
% $Revision: 1.0.0.0 $ $Date: 2006/0... | {"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/30826-model-in-the-loop-for-embedded-system-... |
import os
from os.path import join
import re
import numpy as np
import time as time
from scipy.io import FortranFile
import ctypes as c
import struct
class ReadHaloMergerTree:
#low precision Treebricks (mostly HAGN)
def __init__(self,file_path=None):
"""
Make a treebricks dictionar... | {"hexsha": "a9f107ec7fb9edccaea79dc2210b10b9f0537f95", "size": 13125, "ext": "py", "lang": "Python", "max_stars_repo_path": "tree_reader/__init__.py", "max_stars_repo_name": "janvimadhani/satellite_planes", "max_stars_repo_head_hexsha": "cb80d3c3a840e681ff26c78f40218ddbbec985b0", "max_stars_repo_licenses": ["MIT"], "ma... |
#!/usr/bin/env python
import sys
# 2 inputs and 2 outputs
class MIMO22:
def __init__(self, T=1e3, **kwargs):
a = 1
b = 0.1
c = 0.1
d = 1
self.A = np.array([[-a, -b],
[-c, -d]], dtype=np.float)
self.B = np.array([[a, b],
... | {"hexsha": "2eee913355ca85a3faa3fc9a77a0e95ba618d3e9", "size": 6710, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/toy_mimo.py", "max_stars_repo_name": "rgmaidana/predictiveControl", "max_stars_repo_head_hexsha": "8a9ba62fee4e19ce8bc55ef28847b2d1ae87f9d4", "max_stars_repo_licenses": ["MIT"], "max_star... |
program use_ext
use constants, only: get_pi
implicit none (type, external)
print *,'using submodule, pi=',get_pi()
end program | {"hexsha": "4ec0645b36b56f9b079492329d7b55cb88fa845b", "size": 130, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "submodule/use_ext.f90", "max_stars_repo_name": "supershushu/fortran2018-examples", "max_stars_repo_head_hexsha": "f0dc03b80326bc7c06fa31945b6e7406a60c1fa8", "max_stars_repo_licenses": ["MIT"], "m... |
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
struct PrivateEndpointConnectionsApi <: SwaggerApi
client::Swagger.Client
end
"""
Deletes the specified private endpoint connection associated with the storage account.
Para... | {"hexsha": "8f0297f87910298b2117d302ed1e1905f00d244e", "size": 12343, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Storage/StorageManagementClient/api_PrivateEndpointConnectionsApi.jl", "max_stars_repo_name": "JuliaComputing/Azure.jl", "max_stars_repo_head_hexsha": "0e2b55e7602352d86bdf3579e547a74a9b5f44f8... |
[STATEMENT]
lemma lq_prod: "u \<le>p v\<cdot>u \<Longrightarrow> u \<le>p w \<Longrightarrow> u\<inverse>\<^sup>>(v\<cdot>u)\<cdot>u\<inverse>\<^sup>>w = u\<inverse>\<^sup>>(v\<cdot>w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>u \<le>p v \<cdot> u; u \<le>p w\<rbrakk> \<Longrightarrow> u\<inverse>\<^... | {"llama_tokens": 476, "file": "Combinatorics_Words_CoWBasic", "length": 2} |
"""
Constructing and loading dictionaries
"""
import cPickle as pkl
import numpy
from collections import OrderedDict
from scipy.io import loadmat
import os
import nltk
from nltk.tokenize import TweetTokenizer
DATA_DIR = '/home/shunan/Code/Data'
def build_dictionary(text):
"""
Build a dictionary
text: list... | {"hexsha": "b3359eae0b7b48a494ead386c14950780cd98870", "size": 5273, "ext": "py", "lang": "Python", "max_stars_repo_path": "training/vocab.py", "max_stars_repo_name": "zashuna/skip-thoughts", "max_stars_repo_head_hexsha": "dec2c97f47d2ad139f5ae8602faca40c81ac096b", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
function xn=linEqSolveFirstnRows(A,b,n)
%%LINEQSOLVEFIRSTNROWS This function solves the problem A*x=b for the first
% n rows of x. The matrix A CAN be singular as long as
% a unique solution exists for the first n rows of x.
% This function is useful for fi... | {"author": "USNavalResearchLaboratory", "repo": "TrackerComponentLibrary", "sha": "9f6e329de5be06a371757c4b853200beb6def2d0", "save_path": "github-repos/MATLAB/USNavalResearchLaboratory-TrackerComponentLibrary", "path": "github-repos/MATLAB/USNavalResearchLaboratory-TrackerComponentLibrary/TrackerComponentLibrary-9f6e3... |
import glob
import imp
import os
import pkgutil
import re
import sys
import tarfile
import pytest
from . import reset_setup_helpers, reset_distutils_log, fix_hide_setuptools # noqa
from . import run_cmd, run_setup, cleanup_import
PY3 = sys.version_info[0] == 3
if PY3:
_text_type = str
else:
_text_type = u... | {"hexsha": "5d1c3f8e557a023e294b7bedd1cfe2642454697d", "size": 7458, "ext": "py", "lang": "Python", "max_stars_repo_path": "astropy_helpers/astropy_helpers/tests/test_git_helpers.py", "max_stars_repo_name": "brechmos-stsci/deleteme", "max_stars_repo_head_hexsha": "02590bbe715750c908b6d8013b3ec935eeaf4040", "max_stars_r... |
#!/usr/bin/env python3
import numpy as np
import rospy
from duckietown_msgs.msg import Twist2DStamped, Pose2DStamped
from duckietown.dtros import DTROS, NodeType, TopicType
class VelocityToPoseNode(DTROS):
"""
VelocityToPoseNode integrates the velocity of the Duckiebot in order to continuously obtain a pos... | {"hexsha": "ef86ad83b83fabaa28e762b3be4980be7b46d95c", "size": 3903, "ext": "py", "lang": "Python", "max_stars_repo_path": "solution/exercise_ws/src/dagu_car/src/velocity_to_pose_node.py", "max_stars_repo_name": "rjean/duckie-segmentation", "max_stars_repo_head_hexsha": "5e720e1a96ef61c4560823030549ac1d5d16e2a4", "max_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 31 21:21:31 2019
@author: mostafamousavi
last update: 06-21-2020
- downsampling using the interpolation function can cause false segmentaiton error.
This depend on your data and its sampling rate. If you kept getting this error when
usi... | {"hexsha": "e090553429c5fde27ed1dc7daab9c85baa1e1bb0", "size": 19469, "ext": "py", "lang": "Python", "max_stars_repo_path": "EQTransformer/utils/hdf5_maker.py", "max_stars_repo_name": "iceseismic/EQTransformer", "max_stars_repo_head_hexsha": "195559f9728604906b9c4352a2f1f782541a0533", "max_stars_repo_licenses": ["MIT"]... |
classdef spaces
% Utility functions to work with vector spaces
methods(Static)
function result = insersection_space(A, B)
% Let A and B represent vector spaces
% The function returns basis for their intersection
if size(A, 1) ~= size(B, 1)
error('The am... | {"author": "indigits", "repo": "sparse-plex", "sha": "43cae2978f62938d001baaa03308a2a717ee6c9b", "save_path": "github-repos/MATLAB/indigits-sparse-plex", "path": "github-repos/MATLAB/indigits-sparse-plex/sparse-plex-43cae2978f62938d001baaa03308a2a717ee6c9b/library/+spx/+la/spaces.m"} |
"""
This module provides tools for stacking a model on top of other
models without information leakage from a target variable to
predictions made by base models.
@author: Nikolay Lysenko
"""
from typing import List, Dict, Tuple, Callable, Union, Optional, Any
from abc import ABC, abstractmethod
import numpy as np
... | {"hexsha": "2e83d9555ef88e2190c90e1655fcbe9de4dd1029", "size": 28172, "ext": "py", "lang": "Python", "max_stars_repo_path": "dsawl/stacking/stackers.py", "max_stars_repo_name": "Nikolay-Lysenko/dsawl", "max_stars_repo_head_hexsha": "1bc3cd219d1f9e91cf8e3bf849c94cdd6b58e6f7", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# from dcor import distance_correlation as dc
import numpy as np
import dcor
def distance_corr(X, Y):
"""
Computes the distance correlation between X and Y.
Taken from pypi package dcor based on the paper:
*Measuring and testing dependence by correlation of distances*
by Gábor et Al (2007)
Par... | {"hexsha": "c178ceec252e1896b0fed93ee33bd608a2e9eaf6", "size": 907, "ext": "py", "lang": "Python", "max_stars_repo_path": "knock_off/association_measures/distance_correlation.py", "max_stars_repo_name": "PeterJackNaylor/knockoff-MMD-HSIC", "max_stars_repo_head_hexsha": "76b78c3c4c7ecdc1e9ab9f27a427b1017e69dfeb", "max_s... |
using Test
test_case = "../data/pglib_opf_case5_pjm.m"
test_case_cost = 17551.891
result_keys_required = ["case", "variables", "constraints",
"feasible", "cost", "time_total", "time_data", "time_build", "time_solve"]
function check_result_keys(result::Dict)
for k in result_keys_required
if !haskey(re... | {"hexsha": "a245afb8fdccbc49ab532b4f1d3d4bcc37cbdbc4", "size": 1831, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "lanl-ansi/rosetta-opf", "max_stars_repo_head_hexsha": "09e76f505c04cc788256a4f3f479033ba6abe1f0", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
using Luxor, Test, Colors, Random
Random.seed!(42)
function noisetest(fname)
Drawing(800, 800, fname)
background("chartreuse4")
origin()
initnoise(rand(1:12))
@test 0.0 < noise(.5) <= 1.0
@test 0.0 < noise(0.1, 0.5) <= 1.0
@test 0.0 < noise(0.1, 0.1, -0.1) <= 1.0
@test 0.0 < noise(0.... | {"hexsha": "ce6358a4f35fd272e72f77f8ffcb3cf0747b5b08", "size": 1272, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/noise-test.jl", "max_stars_repo_name": "guo-yong-zhi/Luxor.jl", "max_stars_repo_head_hexsha": "3b4fe34fe1e05c17bfcc9cc5b074fa527e5d1ebf", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# epoch - 0 , train_acc - 0.134183333333 , test_acc - 0.1341
# epoch - 1 , train_acc - 0.953983333333 , test_acc - 0.9519
# epoch - 2 , train_acc - 0.96605 , test_acc - 0.9618
# epoch - 3 , train_acc - 0.97145 , test_acc - 0.965
# epoch - 4 , train_acc - 0.97645 , test_acc - 0.9697
# epoch - 5 , train_acc - 0.979716666... | {"hexsha": "50e54af45c57ebbf5c4fc14949a4b30fec79b734", "size": 2378, "ext": "py", "lang": "Python", "max_stars_repo_path": "Lectures/DeepLearningClass/chapter5/train_neuralnet_mnist_3_layer_adagrade.py", "max_stars_repo_name": "Tim232/Python-Things", "max_stars_repo_head_hexsha": "05f0f373a4cf298e70d9668c88a6e3a9d1cd81... |
#include <fmt/format.h>
#include <frozen/map.h>
#include <frozen/string.h>
#include <nextclade/nextclade.h>
#include <rapidcsv.h>
#include <array>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <string>
#include <common/safe_vector.h>
#include "../utils/at.h"
#includ... | {"hexsha": "4360d0bde59aa2c7daa44ab08b37792211746ec4", "size": 12333, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "packages/nextclade/src/io/CsvWriter.cpp", "max_stars_repo_name": "Centralize/nextclade", "max_stars_repo_head_hexsha": "22115d497a877369f1e8b765e80ddc68cbbca65f", "max_stars_repo_licenses": ["MIT"]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.