text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
#include <boost/graph/rmat_graph_generator.hpp>
| {"hexsha": "23179c2bf21f3775c677e63e2e5c6ea76602b69c", "size": 48, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_graph_rmat_graph_generator.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BS... |
'''
Module for holding all plotting code for MON-MON collection
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import cm
import matplotlib.ticker as mticker
from matplotlib.ticker import FormatStrFormatter
from matplotlib.ticker import ScalarFormatter
def aspect_ratio... | {"hexsha": "d92cbe96143504b1374bd44e9dace94d792ac26f", "size": 11606, "ext": "py", "lang": "Python", "max_stars_repo_path": "ipas/visualizations/part_I_plots.py", "max_stars_repo_name": "vprzybylo/IPAS", "max_stars_repo_head_hexsha": "9c9268097b9d7d02be1b14671b8fbfc1818e02c0", "max_stars_repo_licenses": ["MIT"], "max_s... |
// Copyright (c) 2019-2021 Xenios SEZC
// https://www.veriblock.org
// Distributed under the MIT software license, see the accompanying
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
#include <boost/test/unit_test.hpp>
#include <algorithm>
#include <chain.h>
#include <test/util/setup_common.h>... | {"hexsha": "6c2d5b0141df14d72e3a20b057052c27b2ce78db", "size": 1947, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/vbk/test/unit/vbk_merkle_tests.cpp", "max_stars_repo_name": "VeriBlock/b", "max_stars_repo_head_hexsha": "1c2dccb1f87251b72049b75cc4db630c4da1b5c9", "max_stars_repo_licenses": ["MIT"], "max_star... |
\section*{Introduction to Volume II}
\label{sec:introduction-2}
\addcontentsline{toc}{section}{\nameref{sec:introduction-2}}
\markboth{Introduction to Volume II}{Introduction to Volume II}
This report is submitted to the Attorney General pursuant to 28~C.F.R. \S~600.8(c), which states that, ``[a]t the conclusion of th... | {"hexsha": "26213f001e5024c61c70508eb0fb9d9223f53d0c", "size": 7416, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "src/volume-2/introduction.tex", "max_stars_repo_name": "ascherer/mueller-report", "max_stars_repo_head_hexsha": "3aa16a20104f48623ce8e12c8502ecb1867a40f8", "max_stars_repo_licenses": ["CC-BY-3.0"], ... |
using JSON
using BytePairEncoding
using BytePairEncoding: UnMap
using Transformers.Basic
abstract type GPT2 <: PretrainedTokenizer end
# wrapper for GPT2 Tokenizer with required functionalities
"""
struct GPT2Tokenizer <: GPT2
encoder::Vocabulary{String}
bpe_encode::GenericBPE
bpe_decode::UnMap
vocab:... | {"hexsha": "7d3c40beef169a1fc4eb33a7fdb74b02b240532e", "size": 5595, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/tokenizer.jl", "max_stars_repo_name": "AdarshKumar712/PPLM.jl", "max_stars_repo_head_hexsha": "0b8e2a202b05fad450a49cb8a114f78216f798f0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
[STATEMENT]
lemma minus_mat_limit:
fixes X :: "nat \<Rightarrow> complex mat" and A :: "complex mat" and m :: nat and B :: "complex mat"
assumes dimB: "B \<in> carrier_mat m m" and limX: "limit_mat X A m"
shows "limit_mat (mat_seq_minus X B) (A - B) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. limit_mat (... | {"llama_tokens": 6155, "file": "QHLProver_Matrix_Limit", "length": 54} |
import numpy as np
import numpy.testing as npt
import pandas as pd
from ioos_qartod.qc_tests import qc
# from ioos_qartod.qc_tests.qc import QCFlags
import quantities as pq
import unittest
class QartodQcTest(unittest.TestCase):
def test_lon_lat_bbox(self):
"""
Ensure that longitudes and latitudes ... | {"hexsha": "b1520b64f6070d1b43e453e3e3bc8d3cbcf593e3", "size": 10069, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_qartod_qc.py", "max_stars_repo_name": "ioos/qartod", "max_stars_repo_head_hexsha": "eb4f1962836eec6f9ec93e56b54f5832f9b47e4a", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
# Class for storing data for solving with Ising methods.
# 2015-04-30
from __future__ import division
import numpy as np
from misc_fcns import *
import workspace.utils as ws
from scipy.spatial.distance import squareform
import entropy.entropy as entropy
import fast
import itertools
class Data():
"""
Class for ... | {"hexsha": "484014711477ef756f532245d3b00f8b67f2f193", "size": 5579, "ext": "py", "lang": "Python", "max_stars_repo_path": "coniii/ising.py", "max_stars_repo_name": "bcdaniels/coniii", "max_stars_repo_head_hexsha": "50218dc571135dd08b441361da33fed64a8eebc4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 10, "m... |
import numpy as np
import tensorflow as tf
from loss import yolo3_loss
from anchors import compute_normalized_anchors
from layers import cnn_block, csp_block, scale_prediction
from tensorflow.keras.layers import Concatenate, MaxPool2D, UpSampling2D, Input, Lambda
from configs.train_config import NUM_CLASSES, MAX_NUM_... | {"hexsha": "27ca9c57fceaabee26f9a39d46bcb3a444c4542e", "size": 11283, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/yolo_v4.py", "max_stars_repo_name": "vairodp/AstroNet", "max_stars_repo_head_hexsha": "33602d8e954246f5e2571f11cf331168f82198f8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 7, "ma... |
(* Require Import Paco.paco. *)
(* ViNo - VerIfiable Nock *)
(* The aim of this project is to provide a Nock interpreter
with jets whose semantic equivalence can be verified w/r/t
the Gallina (eventually, OCaml) code that uses them *)
Require Import Common.
(* Require Import Applicative *)
(* Require Import Noc... | {"author": "mmalvarez", "repo": "vino", "sha": "7d2c9ed84fbe660f791ed70471a464da3ab8ce2d", "save_path": "github-repos/coq/mmalvarez-vino", "path": "github-repos/coq/mmalvarez-vino/vino-7d2c9ed84fbe660f791ed70471a464da3ab8ce2d/src/Nock.v"} |
import numpy as np
from bokeh.layouts import column, gridplot, row
from bokeh.plotting import figure, output_file, show
N = 1000
x = np.random.random(size=N) * 100
y = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 1.5
colors = ["#%02x%02x%02x" % (int(r), int(g), 150) for r, g in zip(50+2*x, 30+2*y... | {"hexsha": "866095c9628555ae38ef5da788ee28e6ccf95919", "size": 1197, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/models/file/toolbars2.py", "max_stars_repo_name": "g-parki/bokeh", "max_stars_repo_head_hexsha": "664ead5306bba64609e734d4105c8aa8cfb76d81", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
import io
import re
import sys
import numpy as np
_INPUT_ = """\
10
6 7 5 18 2
3 8 1 6 3
7 2 8 7 7
6 3 3 4 7
12 8 9 15 9
9 8 6 1 10
12 9 7 8 2
10 3 17 4 10
3 1 3 19 3
3 14 7 13 1
"""
#sys.stdin = io.StringIO(_INPUT_)
# copied from https://atcoder.jp/contests/zone2021/editorial/1197
# added some comments
# refered htt... | {"hexsha": "7882028f18db528687449055b6e0f70b5aab09ee", "size": 1110, "ext": "py", "lang": "Python", "max_stars_repo_path": "competitive/AtCoder/zone2021/C_shakyo.py", "max_stars_repo_name": "pn11/benkyokai", "max_stars_repo_head_hexsha": "9ebdc46b529e76b7196add26dbc1e62ad48e72b0", "max_stars_repo_licenses": ["MIT"], "m... |
// Copyright Joseph Dobson 2014
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include "modes.hpp"
#include <sstream>
#include <algorithm>
#include <boost/spirit/include/qi.hpp>
#includ... | {"hexsha": "0cfa052c4511ef80ff71c22aab7c5a446a3c2d49", "size": 3309, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/modes.cpp", "max_stars_repo_name": "libircpp/libircpp", "max_stars_repo_head_hexsha": "b7df7f3b20881c11c842b81224bc520bc742cdb1", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_count": 3.0, ... |
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interpr... | {"hexsha": "7deb400ab10de8a0f7caaa741d21fbfcb5ee566d", "size": 5772, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "boost/boost/interprocess/sync/named_mutex.hpp", "max_stars_repo_name": "randolphwong/mcsema", "max_stars_repo_head_hexsha": "eb5b376736e7f57ff0a61f7e4e5a436bbb874720", "max_stars_repo_licenses": ["B... |
from MeArmKinematics import MeArmKinematics
#from MeArm import MeArm
from DQ import *
import numpy as np
import time
import sys
if len(sys.argv) == 1:
print("Input the desired coordinates")
quit()
else:
position = np.array([float(sys.argv[1]), float(sys.argv[2]), float(sys.argv[3])])
kinematics = MeArmKin... | {"hexsha": "7a1083fa38e124aa25f40948c9c043c62b65ad4b", "size": 1026, "ext": "py", "lang": "Python", "max_stars_repo_path": "position_control.py", "max_stars_repo_name": "glauberrleite/mearm-experience", "max_stars_repo_head_hexsha": "cde04a32929c082f8aa93f8cb8cb2368c13661b0", "max_stars_repo_licenses": ["MIT"], "max_st... |
"""
Module to train a new models to create user's profiles
This is a quick & dirty script for testing. The proper wenet data will be used by using proper API
"""
import pickle
import re
from collections import defaultdict
from copy import deepcopy
from datetime import datetime, timedelta
from functools import partial... | {"hexsha": "acbed7c54fbf47e39c92424c8bfce09ca7474f9b", "size": 7206, "ext": "py", "lang": "Python", "max_stars_repo_path": "yn/yn_train.py", "max_stars_repo_name": "InternetOfUs/personal-context-builder", "max_stars_repo_head_hexsha": "89e7388d622bc0efbf708542566fdcdca667a4e5", "max_stars_repo_licenses": ["Apache-2.0"]... |
"""
CUB-200-2011 classification dataset.
"""
import os
import numpy as np
import pandas as pd
from PIL import Image
import torch.utils.data as data
from .imagenet1k_cls_dataset import ImageNet1KMetaInfo
class CUB200_2011(data.Dataset):
"""
CUB-200-2011 fine-grained classification dataset.
Parameters... | {"hexsha": "c7c96f8b4dd854375674df45ab3156d5e2c0ee1d", "size": 5319, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytorch/datasets/cub200_2011_cls_dataset.py", "max_stars_repo_name": "oliviaweng/imgclsmob", "max_stars_repo_head_hexsha": "80fffbb46f986614b162c725b21f3d208597ac77", "max_stars_repo_licenses": ["... |
import numpy as np
import matplotlib.pyplot as plt
from project_utilities import *
import time
init_mpl(150,mat_settings = True)
from IPython.display import clear_output
import pygame
from numba import prange
@numba.njit()
def set_bnd(N,b,x):
if b == 0:
for i in prange(N+2):
x[0,i] = x[1,i]
... | {"hexsha": "9a1cc80184dd1e4640c67902386cce44b3a677b1", "size": 3333, "ext": "py", "lang": "Python", "max_stars_repo_path": "methods.py", "max_stars_repo_name": "tobyvg/Jos-Stam-Fluid", "max_stars_repo_head_hexsha": "035f9d9525078dc99be6eec3adb5c621a6d18c19", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
open import FRP.JS.RSet using ( ⟦_⟧ )
open import FRP.JS.Behaviour using ( Beh )
open import FRP.JS.DOM using ( DOM )
module FRP.JS.Main where
postulate
Main : Set
reactimate : ⟦ Beh DOM ⟧ → Main
{-# COMPILED_JS reactimate require("agda.frp").reactimate #-}
| {"hexsha": "5e722121e2272374451f9aa4a4fb5a0076e9213c", "size": 265, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "src/agda/FRP/JS/Main.agda", "max_stars_repo_name": "agda/agda-frp-js", "max_stars_repo_head_hexsha": "c7ccaca624cb1fa1c982d8a8310c313fb9a7fa72", "max_stars_repo_licenses": ["MIT", "BSD-3-Clause"], ... |
import argparse
import sys
from pathlib import Path
import joblib
import numpy as np
from sklearn.preprocessing import StandardScaler
from tqdm import tqdm
def get_parser():
parser = argparse.ArgumentParser(description="Fit scalers")
parser.add_argument("utt_list", type=str, help="utternace list")
parser... | {"hexsha": "03dec7e3f766e18ff21b05bed65094b33cc6f1f9", "size": 990, "ext": "py", "lang": "Python", "max_stars_repo_path": "recipes/common/fit_scaler.py", "max_stars_repo_name": "kunosato-mado/ttslearn", "max_stars_repo_head_hexsha": "1230ce8d5256a7438c485a337968ce086620a88e", "max_stars_repo_licenses": ["MIT"], "max_st... |
\paragraph{print\_level:} Output verbosity level. $\;$ \\
Sets the default verbosity level for console
output. The larger this value the more detailed
is the output. The valid range for this integer option is
$0 \le {\tt print\_level } \le 11$
and its default value is $4$.
\paragraph{print\_user\_options:} Print al... | {"hexsha": "3596af91bee8f22220beeaa462be51d5a6a7e60a", "size": 41640, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Ipopt-3.2.1/Ipopt/doc/options.tex", "max_stars_repo_name": "FredericLiu/CarND-MPC-P5", "max_stars_repo_head_hexsha": "e4c68920edd0468ae73357864dde6d61bc1c4205", "max_stars_repo_licenses": ["MIT"], ... |
from microsetta_public_api.repo._alpha_repo import AlphaRepo
from unittest.mock import patch, PropertyMock
from microsetta_public_api.api.diversity.alpha import (
available_metrics_alpha, get_alpha, alpha_group, exists_single,
exists_group,
available_metrics_alpha_alt,
get_alpha_alt,
alpha_group_alt... | {"hexsha": "3a2597a6cf569e1173ceb5e6381af56eb2f006c5", "size": 27124, "ext": "py", "lang": "Python", "max_stars_repo_path": "microsetta_public_api/api/diversity/tests/test_alpha.py", "max_stars_repo_name": "gwarmstrong/microsetta-public-api", "max_stars_repo_head_hexsha": "53fe464aef6df13edb48a781bad6fe6f42f7251b", "ma... |
from tflite_runtime.interpreter import Interpreter
import pathlib
import os
import numpy as np
import count_insects_coral.init as init
from datetime import datetime
interpreter=None
height=None
width=None
input_details=None
output_details=None
def init_interpreter_tf(model_tflite_file_path):
global input_details
... | {"hexsha": "6377fcf79fa906d528474cc8bcb3940c02258cad", "size": 2145, "ext": "py", "lang": "Python", "max_stars_repo_path": "Coral_mini_dev/count_insects_coral/interpreter_tf.py", "max_stars_repo_name": "Gsarant/Edge-computing", "max_stars_repo_head_hexsha": "cc54da3e7cc35d7956cbef3dc8402e5331ec646e", "max_stars_repo_li... |
function tests = test_spm_dcm_fmri_check
% Unit Tests for spm_dcm_fmri_check
%__________________________________________________________________________
% Copyright (C) 2016 Wellcome Trust Centre for Neuroimaging
% $Id: test_spm_dcm_fmri_check.m 6790 2016-04-28 14:30:27Z guillaume $
tests = functiontests(localfunctio... | {"author": "spm", "repo": "spm12", "sha": "3085dac00ac804adb190a7e82c6ef11866c8af02", "save_path": "github-repos/MATLAB/spm-spm12", "path": "github-repos/MATLAB/spm-spm12/spm12-3085dac00ac804adb190a7e82c6ef11866c8af02/tests/test_spm_dcm_fmri_check.m"} |
"""Perform inference/compression on a pre-trained mean-scale hyperprior model.
Implement iterative inference with STE (A2 in Table 1 of paper), in
Yibo Yang, Robert Bamler, Stephan Mandt:
"Improving Inference for Neural Image Compression", NeurIPS 2020
https://arxiv.org/pdf/2006.04240.pdf
"""
import os
import numpy a... | {"hexsha": "92ed6287badd45c4574bbcb00b43283570c44a5c", "size": 11326, "ext": "py", "lang": "Python", "max_stars_repo_path": "ste.py", "max_stars_repo_name": "mdong151/improving-inference-for-neural-image-compression", "max_stars_repo_head_hexsha": "8b876ff84e1d075d8058cb23314e71166fc25074", "max_stars_repo_licenses": [... |
import numpy as np
from collections import defaultdict
from agents.policy.montage_workflow_policy_factory import MontageWorkflowPolicyFactory
import sys
class MonteCarlo:
@staticmethod
def mc_prediction(policy, env, num_episodes, discount_factor=1.0):
"""
Monte Carlo prediction algorithm. Calculates the value f... | {"hexsha": "16c318229ce2763982d5a4fb125b05c6b7611936", "size": 7920, "ext": "py", "lang": "Python", "max_stars_repo_path": "agents/strategy/monte_carlo.py", "max_stars_repo_name": "rayson1223/gym-workflow", "max_stars_repo_head_hexsha": "877b3f17951b9a85ef10b83e7d70a09edc07fd2e", "max_stars_repo_licenses": ["MIT"], "ma... |
% Default to the notebook output style
% Inherit from the specified cell style.
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
% Nicer default font (+ math font) than Computer Modern for most use cases
\usepackage{mathpazo}
% Basic figure setup, for now with no capt... | {"hexsha": "05b18c2f303af2d20edce196bf8fb7941c4607cf", "size": 42376, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "paper/Fractals & Rendering Techniques.tex", "max_stars_repo_name": "darkeclipz/fractals", "max_stars_repo_head_hexsha": "8647eea9b3c4a63bfeea30a98e9f2edf15bf9587", "max_stars_repo_licenses": ["MIT"... |
import numpy as np
def chol_params_to_lower_triangular_matrix(params):
dim = number_of_triangular_elements_to_dimension(len(params))
mat = np.zeros((dim, dim))
mat[np.tril_indices(dim)] = params
return mat
def cov_params_to_matrix(cov_params):
"""Build covariance matrix from 1d array with its l... | {"hexsha": "931dc61adcf2f07b5c05db01f88a0774d368b115", "size": 2741, "ext": "py", "lang": "Python", "max_stars_repo_path": "utilities.py", "max_stars_repo_name": "janosg/derivatives", "max_stars_repo_head_hexsha": "ee4640baa273093a04ef6bd7a482ba485b753bd2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from music21 import midi
import pypianoroll
from pypianoroll import Multitrack
from texttable import Texttable
import os
from pprint import pprint
def play_midi(input_midi):
'''Takes path ... | {"hexsha": "56e076cdb4c2f4ca2c73d1f9e7653861b9dd741d", "size": 1416, "ext": "py", "lang": "Python", "max_stars_repo_path": "transformer-xl/utils/midi_utils.py", "max_stars_repo_name": "froggie901/aws-deepcomposer-samples", "max_stars_repo_head_hexsha": "142b98b130efbb4ed91f22b54919d71877146c73", "max_stars_repo_license... |
% This files adds a coastline from an existing data set
global coastline faults mainfault main
report_this_filefun(mfilename('fullpath'));
%aa = a;
[file1,path1] = uigetfile( '*.mat',' Earthquake Datafile'); %disabled window position
loadpath = [path1 file1];
new_data = load(loadpath);
loaded=false;
if isfield(new_... | {"author": "CelsoReyes", "repo": "zmap7", "sha": "3895fcb3ca3073608abe22ca71960eb082fd0d9a", "save_path": "github-repos/MATLAB/CelsoReyes-zmap7", "path": "github-repos/MATLAB/CelsoReyes-zmap7/zmap7-3895fcb3ca3073608abe22ca71960eb082fd0d9a/zmap_deprecated/addcoast.m"} |
import numpy as np
import pandas as pa
import time
from sklearn.metrics import pairwise_distances
from scipy.sparse import csr_matrix
class Kmeans:
def __init__(self,data,k,geneNames,cellNames,cluster_label=None,seed=None):
self.data=data
self.k=k
self.geneNames=geneNames
self.cellN... | {"hexsha": "8ed0abcc201759c98415acc5106460c56828f45e", "size": 12154, "ext": "py", "lang": "Python", "max_stars_repo_path": "build/lib/MICTI/Kmeans.py", "max_stars_repo_name": "insilicolife/micti", "max_stars_repo_head_hexsha": "100055316014d86963ec191d30bf3d44310f1254", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
[STATEMENT]
lemma mod_exE: assumes "h\<Turnstile>(\<exists>\<^sub>Ax. P x)" obtains x where "h\<Turnstile>P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<And>x. h \<Turnstile> P x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h \<Turnstile>... | {"llama_tokens": 196, "file": "Van_Emde_Boas_Trees_Separation_Logic_Imperative_HOL_Assertions", "length": 2} |
#This code reads in the optimally extracted lightcurve and bins it into channels 5 pixels wide, following Berta '12
import numpy as np
#from numpy import *
#from pylab import *
from astropy.io import ascii
from scipy import signal
import os
import time as time_now
from astropy.table import QTable
from tqdm import tqdm
... | {"hexsha": "09c53bbe22458d6f2a305f9c93c3e0fe5e43c375", "size": 5894, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/pacman/s21_bin_spectroscopic_lc.py", "max_stars_repo_name": "sebastian-zieba/PACMAN", "max_stars_repo_head_hexsha": "2eb1e4b450c97dc28d5a05b3ebddd80706cfca79", "max_stars_repo_licenses": ["MIT... |
import os.path as path
import random
import copy
import numpy as np
from chainer import Variable, optimizers, serializers, Chain
import chainer.functions as F
import chainer.links as L
import chainer.computational_graph as c
import matplotlib.pyplot as plt
class Model(Chain):
def __init__(self):
super(Mode... | {"hexsha": "e0820b3b3296a72573891ea2f457d70b8398a32f", "size": 8935, "ext": "py", "lang": "Python", "max_stars_repo_path": "players/deep_q_learning.py", "max_stars_repo_name": "pikatyuu/deep-learning-othello", "max_stars_repo_head_hexsha": "d9f149b01f079f5d021ba9655445cd43a847a628", "max_stars_repo_licenses": ["MIT"], ... |
from typing import Tuple, Dict, Union
from .rnn import RNN
import numpy as np
import tensorflow as tf
class RoemmeleSentences(RNN):
CLASSES = 1
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
def _sentence_rnn(self, per_sentence_states: tf.Tensor) -> tf.Tensor:
... | {"hexsha": "89955811df716f015b3918b379ad95860e463287", "size": 7800, "ext": "py", "lang": "Python", "max_stars_repo_path": "project2/sct/model/roemmele_sentences.py", "max_stars_repo_name": "oskopek/nlu", "max_stars_repo_head_hexsha": "301611383fabf0d263a86dcb932fa51762b3f022", "max_stars_repo_licenses": ["MIT"], "max_... |
"""
Diffusion Imaging in Python
============================
For more information, please visit http://dipy.org
Subpackages
-----------
::
align -- Registration, streamline alignment, volume resampling
boots -- Bootstrapping algorithms
core -- Spheres, gradient tables
core.geometry -- Sp... | {"hexsha": "8aa00ce5c63aebce2dc37db878eddc29216e53e7", "size": 1405, "ext": "py", "lang": "Python", "max_stars_repo_path": "dipy/__init__.py", "max_stars_repo_name": "JohnGriffiths/dipy", "max_stars_repo_head_hexsha": "5fb38e9b77547cdaf5eb140730444535733ae01d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_co... |
from __future__ import division
from __future__ import print_function
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import numpy as np
import theano.tensor as T
from sklearn.datasets import make_moons, make_circles, make_classification
from simec.ann_models import SupervisedNNModel
def... | {"hexsha": "d549cd43b3e9a5517a5133b707007e730db38112", "size": 4564, "ext": "py", "lang": "Python", "max_stars_repo_path": "ann_test.py", "max_stars_repo_name": "cod3licious/simec-theano", "max_stars_repo_head_hexsha": "dd2bc0a4d954754fafb2d6d7d571aca3092569b6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
'''
Analysis of several FOI files against several GFs using Fisher's exact test. Best used for SNP set analysis, using whole SNP database as a spot background.
sys.argv[1] - text file with FOI file names. Include full, or relative path, if needed.
sys.argv[2] - text file with GF file names. Include full, or relative pa... | {"hexsha": "b368340f1ef79d8f2da9cf49734c198366e89f78", "size": 3175, "ext": "py", "lang": "Python", "max_stars_repo_path": "grsnp/hypergeom.py", "max_stars_repo_name": "mdozmorov/genome_runner", "max_stars_repo_head_hexsha": "1fd77dd8e0bb7333e2d8e0d299d020bc8a3e36a1", "max_stars_repo_licenses": ["AFL-3.0"], "max_stars_... |
import pandas as pd
import numpy as np
import math
import matplotlib.pyplot as plt
num_bins = 100
raw_data = pd.read_csv('./raw_data.csv', header = 0, index_col = 0)
sample_num = raw_data.shape[0]
print(sample_num)
label = raw_data.iloc[:,raw_data.shape[1]-1]
price = label.values
print('max price: ', max(price))
prin... | {"hexsha": "865e8135aab65f0a62f7864dac2a51d2ec48c6e7", "size": 455, "ext": "py", "lang": "Python", "max_stars_repo_path": "pattern_recognition/code/DataPre.py", "max_stars_repo_name": "geneti/courseworkproj", "max_stars_repo_head_hexsha": "5843cc14c2ce01172420befca5d2683f1123096a", "max_stars_repo_licenses": ["MIT"], "... |
"""
brief: Testing ground for 1D moment solver
Author: Steffen Schotthöfer
Date: 17.05.2021
"""
import sys
import csv
sys.path.append('../..')
import numpy as np
import scipy.optimize as opt
import matplotlib.pyplot as plt
from matplotlib import animation
import tensorflow as tf
import multiprocessing
import pandas as... | {"hexsha": "d8587148075078562220c9868404d48832d5c3a4", "size": 31811, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/solver/MNSolver1D.py", "max_stars_repo_name": "CSMMLab/neuralEntropyClosures", "max_stars_repo_head_hexsha": "5efc5961f2fac36921a749d35f3636c61d1cc873", "max_stars_repo_licenses": ["MIT"], "m... |
"""Tools for working with segmented systems."""
from collections import namedtuple
import numpy as truenp
from .geometry import regular_polygon
from .mathops import np
Hex = namedtuple('Hex', ['q', 'r', 's'])
def add_hex(h1, h2):
"""Add two hex coordinates together."""
q = h1.q + h2.q
r = h1.r + h2.r
... | {"hexsha": "e4df95cc2cdc1f1463a8b2b8946b91a69dbe5207", "size": 7391, "ext": "py", "lang": "Python", "max_stars_repo_path": "prysm/segmented.py", "max_stars_repo_name": "deisenroth/prysm", "max_stars_repo_head_hexsha": "53a400ef89697041f67192e879e61ad28c451318", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 110... |
from scipy import stats # apply statistical knowledge from scitific python lib
import numpy as np # matrix manipulation
import cv2 # image processing lib
import argparse # input and output file.
from time import sleep # time based library
from collections import defaultdict # DS
from tqdm import tqdm as tqdm # for prog... | {"hexsha": "e2a646cafe4dc519754324828d89427401baadfd", "size": 5954, "ext": "py", "lang": "Python", "max_stars_repo_path": "anime_effect.py", "max_stars_repo_name": "Aayush-hub/ArtCV", "max_stars_repo_head_hexsha": "d5f01d9dacb3bb1f976d38d14e2dd3ac85e4b94a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 48, "m... |
import torch
from torch import optim
import time
import os
from model.UNet_model import UNet
from loader.data_loader import SlicesDataset
from torch.utils.data import DataLoader
import numpy as np
from trainer.inference import UNetInferenceAgent
from utils.utils import Dice3d, Jaccard3d
class UNetExperime... | {"hexsha": "f910761159cda58613279f11cb6f69e44d233706", "size": 7632, "ext": "py", "lang": "Python", "max_stars_repo_path": "src-python/trainer/training.py", "max_stars_repo_name": "RAFAELLOPE/Hippocampus_project", "max_stars_repo_head_hexsha": "fb9c1ed4227a8a4c0e4f73ecd6ba2e9f3d315021", "max_stars_repo_licenses": ["Apa... |
HANSARD REVISE * NUMERO 108
Le lundi 25 mai 1998
PROGRAMME NATIONAL BON DEPART
Demande et report des votes
LOI D'EXECUTION DU BUDGET DE 1998
Projet de loi C-36-Motion d'attribution de temps
M. Jean-Guy Chretien
L'ECOLE SECONDAIRE ALGONQUIN DE NORTH BAY
M. Pat O'Brien
LA GENDARMERIE ROYALE DU CANADA
L'hon. Pie... | {"hexsha": "cfce15aff4658f6923652676640a155d0321c493", "size": 63276, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "data/Hansard/Training/hansard.36.1.house.debates.108.f", "max_stars_repo_name": "j1ai/Canadian_Hansards_Neural_Machine_Translation", "max_stars_repo_head_hexsha": "554666a89090fc1b1d1fb83601a2e9d... |
# Directions
const directions = [(-1, 0),(1, 0),(0, 1),(0, -1)]
# For readability
PICK_FOOD_1 = 5
PLACE_FOOD_1 = 6
# Perform a move action
function move(env::NatureEnv, player::Int, dir::Int)
new_pos = env.players[player].pos .+ directions[dir]
outofbounds(env, new_pos) && return
env.players[player].pos = n... | {"hexsha": "3f3bb2a3f8a9d452d4c8869730a2ee840aced87f", "size": 1597, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/act.jl", "max_stars_repo_name": "jarbus/Nature.jl", "max_stars_repo_head_hexsha": "22aa3b5afce41dc9f5ac5dcee9695ef4339824ff", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s... |
import numpy as np
import numpy.random as rd
from tools import int_plus
from tools import int_subtract
from tools import int_multiply
from tools import int_divide
import json
import datetime
import argparse
import random
parser = argparse.ArgumentParser()
parser.add_argument('-conf',default='conf.json')
conf = parser.... | {"hexsha": "efe9ca1a947d5fedd0eb9d627efe4b8e02992e10", "size": 1753, "ext": "py", "lang": "Python", "max_stars_repo_path": "problemset.py", "max_stars_repo_name": "LearnerYme/elementary_arithmetic_problemset", "max_stars_repo_head_hexsha": "7f890a30b55f62868825dbb9ae95da247970a80e", "max_stars_repo_licenses": ["MIT"], ... |
function ALclear(; verbose = true)
((length(replset.commands)==0) || (replset.commands[end]=="#Session Started")) &&
((verbose && println("Activeset Already Empty")); return)
newhistory = History()
newreplset = activelogicset(newhistory)
setactivehistory!(newhistory)
setreplset!(newreplset)... | {"hexsha": "15b83b86b94db190228ca07c04b46f64a85b8b57", "size": 558, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/repl/ALclear.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/AbstractLogic.jl-bd85187e-0531-4a3e-9fea-713204a818a2", "max_stars_repo_head_hexsha": "1b8adac10854471ec7ce83b9039cdeb1e4... |
(*
File: Generalized_Primality_Test.thy
Authors: Daniel Stüwe, Manuel Eberl
Generic probabilistic primality test
*)
section \<open>A Generic View on Probabilistic Prime Tests\<close>
theory Generalized_Primality_Test
imports
"HOL-Probability.Probability"
Algebraic_Auxiliaries
begin
definition primali... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/SeLFiE/Example/afp-2020-05-16/thys/Probabilistic_Prime_Tests/Generalized_Primality_Test.thy"} |
import logging
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from functools import reduce
from operator import mul
import lab as B
import numpy as np
import wbml.out
from plum import Dispatcher, Self, Referentiable
from .util import Packer, match, lazy_tf as tf, lazy_torch as torch, lazy... | {"hexsha": "c38271b6e5c5db56403b8e0848f4048ad9217006", "size": 21838, "ext": "py", "lang": "Python", "max_stars_repo_path": "varz/vars.py", "max_stars_repo_name": "willtebbutt/varz", "max_stars_repo_head_hexsha": "519e14d202cafb32a0bdf2799bcbde0b5baa1d6f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
[STATEMENT]
lemma has_field_mono:
"\<lbrakk> P \<turnstile> C has F:T (fm) in D; P \<turnstile> C' \<preceq>\<^sup>* C \<rbrakk> \<Longrightarrow> P \<turnstile> C' has F:T (fm) in D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>P \<turnstile> C has F:T (fm) in D; P \<turnstile> C' \<preceq>\<^sup>* C\<... | {"llama_tokens": 204, "file": "JinjaThreads_Common_TypeRel", "length": 1} |
import numpy as np
import pandas as pd
# import xarray as xr
# import xskillscore
from tensorflow import keras
from tensorflow.keras import layers
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.losses import Loss
from sklearn import preproc... | {"hexsha": "6faff5fff467b3a31c6cb6c8a4f44c51df6fe600", "size": 11848, "ext": "py", "lang": "Python", "max_stars_repo_path": "igep326_temperature_100tests.py", "max_stars_repo_name": "jieyu97/mvpp", "max_stars_repo_head_hexsha": "838c2553825b2061f51008b5cbed19526424c2f5", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
using MINLPTests, JuMP, Ipopt, Juniper, Test
const OPTIMIZER = MINLPTests.JuMP.with_optimizer(
Juniper.Optimizer, nl_solver=with_optimizer(Ipopt.Optimizer, print_level=0), atol=1e-7
)
@testset "MINLPTests" begin
###
### src/nlp-mi tests.
###
MINLPTests.test_nlp_mi(OPTIMIZER)
end | {"hexsha": "afa9c235d7ec0fd57532135f03100ae516aad5bd", "size": 306, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/MINLPTests/run_minlptests.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/Juniper.jl-2ddba703-00a4-53a7-87a5-e8b9971dde84", "max_stars_repo_head_hexsha": "75a848d7a281dba768583bbc55... |
# Copyright 1999-2020 Alibaba Group Holding 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 a... | {"hexsha": "074335f86646cef5cb11c8c7e5da5bd71008d2a3", "size": 14860, "ext": "py", "lang": "Python", "max_stars_repo_path": "mars/learn/utils/multiclass.py", "max_stars_repo_name": "humaohai/mars", "max_stars_repo_head_hexsha": "11373f64c3039d424f9276e610ae5ad108ea0eb1", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
from datashape import dshape
import pandas as pd
import numpy as np
import pytest
from datashader.glyphs import (Point, _build_draw_line, _build_map_onto_pixel,
_build_extend_line, _build_draw_triangle,
_build_extend_triangles)
from datashader.utils import ... | {"hexsha": "65b1bc0dbec9567da07df79ad6f2143a14771b94", "size": 11040, "ext": "py", "lang": "Python", "max_stars_repo_path": "datashader/tests/test_glyphs.py", "max_stars_repo_name": "philippjfr/datashader", "max_stars_repo_head_hexsha": "eb9218cb810297aea2ae1030349cef6a6f3ab3cb", "max_stars_repo_licenses": ["BSD-3-Clau... |
import random
import torch
import numpy as np
import math
from torchvision import transforms as T
from torchvision.transforms import functional as F
from PIL import Image, ImageFilter
"""
Pair transforms are MODs of regular transforms so that it takes in multiple images
and apply exact transforms on all images. This i... | {"hexsha": "290ca21373e9165dfd95687e193dafdcd9c5fcb5", "size": 4970, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset/augmentation.py", "max_stars_repo_name": "kasperschnack/BackgroundMattingV2", "max_stars_repo_head_hexsha": "65e8b0e0cae8c833b093390939a5210ccd1e7aa4", "max_stars_repo_licenses": ["MIT"], ... |
C Copyright restrictions apply - see stsdas$copyright.stsdas
C
SUBROUTINE YCLNEWCOL(ISTAT)
*
* Module number:
*
* Module name: YCLNEWCOL
*
* Keyphrase:
* ----------
* calculate a new column based on the coef's; write to output
*
* Description:
* ------------
* This routine opens the input f... | {"hexsha": "fce876805c07225495ea1dbf956ba7c6760e8d5c", "size": 13496, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "stsdas/pkg/hst_calib/stpoa/poa_fos/fos_dispfit/yclnewcol.f", "max_stars_repo_name": "iraf-community/stsdas", "max_stars_repo_head_hexsha": "043c173fd5497c18c2b1bfe8bcff65180bca3996", "max_stars_r... |
import numpy as np
import matplotlib.pyplot as plt
from eulerspiral import eulerspiral
hdg = 0 * np.pi / 180
x0 = 0
y0 = 0
fig, axs = plt.subplots(1, 2)
for ax, length in zip(axs, [5, 10]):
s = np.linspace(0, length, 20)
for curvStart in [-0.5, -0.1, 0.0, 0.1, 0.5]:
for curvEnd in [-0.5, -0.1, 0.... | {"hexsha": "8e7e827e024627428155d81b12503eb41da3bde6", "size": 758, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "stefan-urban/pyeulerspiral", "max_stars_repo_head_hexsha": "f7485b3575274a246872c46131846ae9882db7ce", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14, "... |
(* Copyright 2021 Joshua M. Cohen
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software d... | {"author": "verified-network-toolchain", "repo": "Verified-FEC", "sha": "b96e4b3442d0f0611bbcace57c6fff2b229ed4e2", "save_path": "github-repos/coq/verified-network-toolchain-Verified-FEC", "path": "github-repos/coq/verified-network-toolchain-Verified-FEC/Verified-FEC-b96e4b3442d0f0611bbcace57c6fff2b229ed4e2/proofs/Poly... |
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
import pandas as pd
from dtoolkit.util import multi_if_else
if TYPE_CHECKING:
from typing import Iterable
from dtoolkit._typing import OneDimArray
from dtoolkit._typing import SeriesOrFrame
from dtoolkit._typing ... | {"hexsha": "9a856e97238dce313458d7adc27a2d5d02d6d275", "size": 2034, "ext": "py", "lang": "Python", "max_stars_repo_path": "dtoolkit/accessor/_util.py", "max_stars_repo_name": "Zeroto521/my-data-toolkit", "max_stars_repo_head_hexsha": "bde37f625aa81e65b97648798535f6d931864888", "max_stars_repo_licenses": ["MIT"], "max_... |
#!/usr/bin/env python
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | {"hexsha": "0c283e71e54d9f598410ad2679e4d0842146e9f7", "size": 8834, "ext": "py", "lang": "Python", "max_stars_repo_path": "model.py", "max_stars_repo_name": "OhadRubin/laughing-carnival", "max_stars_repo_head_hexsha": "172bfd3b009254cc6e55ec24ca99ec7b45593bfa", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
##
# \file landmark_visualizer.py
# \brief Class to create image mask from landmark coordinates. Landmarks
# can also be embedded in image.
#
# \author Michael Ebner (michael.ebner.14@ucl.ac.uk)
# \date June 2018
#
import os
import numpy as np
import scipy.ndimage
import SimpleITK as sitk
im... | {"hexsha": "abd538429da31cfddce3aef4a534599f0ac93382", "size": 4939, "ext": "py", "lang": "Python", "max_stars_repo_path": "simplereg/landmark_visualizer.py", "max_stars_repo_name": "gift-surg/SimpleReg", "max_stars_repo_head_hexsha": "9d9a774f5b7823c2256844c9d0260395604fb396", "max_stars_repo_licenses": ["BSD-3-Clause... |
from PIL import Image
import os
import numpy as np
from gym_pcgrl.envs.probs.problem import Problem
from gym_pcgrl.envs.helper import get_range_reward, get_tile_locations, calc_certain_tile, get_floor_dist, get_type_grouping, get_changes
from gym_pcgrl.envs.probs.loderunner.engine import get_score
from pdb import set_t... | {"hexsha": "3ecd4f1652e285ca9fc84a6d15ab66eee6910a3a", "size": 5757, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym_pcgrl/gym_pcgrl/envs/probs/loderunner_prob.py", "max_stars_repo_name": "JiangZehua/control-pcgrl3D", "max_stars_repo_head_hexsha": "f9b04e65e1cbf70b7306f4df251450d83c6fb2be", "max_stars_repo_l... |
#!/usr/bin/env python3
import numpy as np
from pathlib import Path
from astropy.time import Time
import multiprocessing
from bin import sjd, influx_fetch
from sdssobstools import sdss_paths
try:
import tpmdata
except ImportError:
tpmdata = None
__version__ = "3.0.0"
def get_tpm_packet(out_dict):
tpmdat... | {"hexsha": "61730d37eb1e2b3f9f6746a2d072ddf0e7d97ac1", "size": 5309, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/telescope_status.py", "max_stars_repo_name": "StarkillerX42/ObserverTools", "max_stars_repo_head_hexsha": "a3bc48179a1ed445e7f4232426dce8c1c28bb8e4", "max_stars_repo_licenses": ["BSD-3-Clause"... |
from sklearn.ensemble import IsolationForest
class IsolationModel:
"""
Simple Isolation Model based on contamination
"""
def __init__(self, data):
self.normalized_data = (data - data.mean()) / data.std()
self.iso = IsolationForest(contamination=.001, behaviour='new')
self.is... | {"hexsha": "46e2ee302ce3bcbfb4d0ae20e434c27fbd450f5e", "size": 7128, "ext": "py", "lang": "Python", "max_stars_repo_path": "Machine_Learning/sklearn_trading_bot.py", "max_stars_repo_name": "vhn0912/Finance", "max_stars_repo_head_hexsha": "39cf49d4d778d322537531cee4ce3981cc9951f9", "max_stars_repo_licenses": ["MIT"], "m... |
import json
from os.path import dirname, join
import numpy as np
import pandas as pd
import pytest
from bambi.models import Model
from bambi.priors import Family, Prior, PriorFactory
from statsmodels.tools.sm_exceptions import PerfectSeparationError
@pytest.fixture(scope="module")
def diabetes_data():
data_dir... | {"hexsha": "ff420858a3f3e43c781d9d5c01d1718ec46046cd", "size": 6915, "ext": "py", "lang": "Python", "max_stars_repo_path": "bambi/tests/test_priors.py", "max_stars_repo_name": "Maruff/bambi", "max_stars_repo_head_hexsha": "f38fafb04af7e1eabbcd3d6779aa6c7560c775e2", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
[STATEMENT]
lemma (in field) feval_eq0:
assumes "in_carrier xs"
and "fnorm e = (n, d, c)"
and "nonzero xs c"
and "peval xs n = \<zero>"
shows "feval xs e = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. feval xs e = \<zero>
[PROOF STEP]
using assms fnorm_correct [of xs e]
[PROOF STATE]
proof... | {"llama_tokens": 301, "file": null, "length": 2} |
import cv2 as cv
import numpy as np
from ch7.pose_estimation_2d2d import find_feature_matches, pose_estimation_2d2d, pixel2cam
K = np.array([[520.9, 0, 325.1],
[0, 521.0, 249.7],
[0, 0, 1]])
def triangulation(kp_1, kp_2, ms, r_mat, t_vec):
T1 = np.array([[1, 0, 0, 0],
... | {"hexsha": "f79b81cbe513736552a389416400ad3b65c2731a", "size": 1840, "ext": "py", "lang": "Python", "max_stars_repo_path": "ch7/triangulation.py", "max_stars_repo_name": "hujianhang2996/slambook_python", "max_stars_repo_head_hexsha": "26eabfe5a8d6f3e534452f6ccf5b43af838ffc8f", "max_stars_repo_licenses": ["MIT"], "max_s... |
[STATEMENT]
lemma possible_steps_0:
"length i = 1 \<Longrightarrow>
possible_steps drinks 0 r (STR ''select'') i = {|(1, select)|}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. length i = 1 \<Longrightarrow> possible_steps drinks 0 r STR ''select'' i = {|(1, select)|}
[PROOF STEP]
apply (simp add: possible_st... | {"llama_tokens": 783, "file": "Extended_Finite_State_Machines_examples_Drinks_Machine", "length": 3} |
[STATEMENT]
lemma realrel_in_real [simp]: "realrel``{(x,y)} \<in> Real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Dedekind_Real.realrel `` {(x, y)} \<in> Real
[PROOF STEP]
by (simp add: Real_def realrel_def quotient_def, blast) | {"llama_tokens": 102, "file": "Dedekind_Real_Dedekind_Real", "length": 1} |
# Import packages
import numpy as np
import pandas as pd
import os ##for directory
import sys
import pprint
# set the directory
os.chdir('/Users/luho/PycharmProjects/model/model_correction/code')
sys.path.append(r"/Users/luho/PycharmProjects/model/cobrapy/code")
pprint.pprint(sys.path)
# import self function
from ma... | {"hexsha": "86fe87738869cc83a957f99966cc021029530351", "size": 5910, "ext": "py", "lang": "Python", "max_stars_repo_path": "model_correction/code/compartment_collection from uniprot and sgd.py", "max_stars_repo_name": "hongzhonglu/yeast-model-update", "max_stars_repo_head_hexsha": "0268d72320caa61a84c4e11634700cb51ffa9... |
# -*- coding: utf-8 -*-
"""
@author: ibackus
"""
# External packages
from matplotlib.colors import LogNorm
from matplotlib.cm import get_cmap
import numpy as np
import pynbody as pb
SimArray = pb.array.SimArray
import os
# Internal modules
import cubehelix
import ffmpeg_writer
import pbmov_utils
# setup colormaps
ch... | {"hexsha": "51dd0b0affbff99c8b74b100ca9bd038f56b944a", "size": 5245, "ext": "py", "lang": "Python", "max_stars_repo_path": "pbmov.py", "max_stars_repo_name": "ibackus/pbmov", "max_stars_repo_head_hexsha": "2903ebfd9b9755e1549e0e58a314fc1a09d173d3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars... |
import datetime as dt
import logging
import os
from random import uniform, randint, sample
from time import perf_counter
import importlib.util
import time
import numpy as np
import pandas as pd
from mesa import Model
from mesa.datacollection import DataCollector
import pickle
from elecsim.plants.fuel.capacity_factor.... | {"hexsha": "32d3887a3f5f4924217131da1c3c8acbd1090779", "size": 31708, "ext": "py", "lang": "Python", "max_stars_repo_path": "elecsim/model/world.py", "max_stars_repo_name": "alexanderkell/elecsim", "max_stars_repo_head_hexsha": "35e400809759a8e9a9baa3776344e383b13d8c54", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
function [f,g]=idgtreal(coef,g,a,M,varargin)
%IDGTREAL Inverse discrete Gabor transform for real-valued signals
% Usage: f=idgtreal(c,g,a,M);
% f=idgtreal(c,g,a,M,Ls);
%
% Input parameters:
% c : Array of coefficients.
% g : Window function.
% a : Length of time shift... | {"author": "ltfat", "repo": "ltfat", "sha": "4496a06ad8dddb85cd2e007216b765dc996ef327", "save_path": "github-repos/MATLAB/ltfat-ltfat", "path": "github-repos/MATLAB/ltfat-ltfat/ltfat-4496a06ad8dddb85cd2e007216b765dc996ef327/gabor/idgtreal.m"} |
"""
This module handles data and provides convenient and efficient access to it.
"""
from __future__ import annotations
import os
import pickle
import sys
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
from scipy import sparse
import util.t... | {"hexsha": "e942c38ee0116a469e8d1a68b27657ee3b47f2bf", "size": 20506, "ext": "py", "lang": "Python", "max_stars_repo_path": "util/datahandler.py", "max_stars_repo_name": "arbeitsgruppe-digitale-altnordistik/Sammlung-Toole", "max_stars_repo_head_hexsha": "502d6128e55622b760c245b03d973574f0adab4c", "max_stars_repo_licens... |
\documentclass{beamer}
%
% Choose how your presentation looks.
%
% For more themes, color themes and font themes, see:
% http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme.html
%
\mode<presentation>
{
\usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
\usecolortheme{default} % or try albatross, ... | {"hexsha": "d763a68ffd2c92a9ac8cee3062ca182297f67050", "size": 14165, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "materials/context_free_languages.tex", "max_stars_repo_name": "jonhue/teaching-theo", "max_stars_repo_head_hexsha": "d7dd92d81f05db0a82b36f1532fa76e356dffc23", "max_stars_repo_licenses": ["MIT"], "... |
import numpy as np
from random import random
def crop_square(image, coordinates, ratio=1, keep_area_threshold=0.5):
"""random crop a image into a square image and change the
original coordinates to new coordinates. Some coordinates will be last
if it is at outside of the cropped area.
Args:
im... | {"hexsha": "c31fedd79a1cb449f865121dcfe30583a5caba6a", "size": 2960, "ext": "py", "lang": "Python", "max_stars_repo_path": "imageaug.py", "max_stars_repo_name": "87ZGitHub/sfd.pytorch", "max_stars_repo_head_hexsha": "66108ab35d8b1c1601c326b151141d9115a1409e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 124, ... |
import argparse
import glob
import pickle
import random
import time
import sys
import torch.optim as optim
import torch.nn as nn
import torch
import numpy as np
from transformers import *
from tqdm import tqdm
from sklearn.metrics import precision_recall_fscore_support
from models import BERT_NN, BERT_NN_SEP
from loss_... | {"hexsha": "c6e62745fad7f42592fb10ed1da87dda7e93af7c", "size": 19207, "ext": "py", "lang": "Python", "max_stars_repo_path": "BERT_model_span/train.py", "max_stars_repo_name": "tencent-ailab/EMNLP21_SemEq", "max_stars_repo_head_hexsha": "8a0a863e20193f5a7ae1ace0fa6624f3cc35aa3a", "max_stars_repo_licenses": ["MIT"], "max... |
include("header.jl")
struct M370; layer; end;
@testset "serialize" begin
M1 = RNN(2,3)
M2 = M1 |> cpucopy
@test typeof(M2.w.value) <: Array
@test M2.w.value == M1.w.value
if gpu() >= 0
M3 = M2 |> gpucopy
@test typeof(M3.w.value) <: KnetArray
@test M3.w.value == M2.w.value
... | {"hexsha": "af8cd84bbe9264055489d3ba9bfae1bb9b1ee069", "size": 564, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/serialize.jl", "max_stars_repo_name": "petershintech/Knet.jl", "max_stars_repo_head_hexsha": "9ed953d568f2ce94265bcc9663a671ac8364d8b8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
[STATEMENT]
lemma fps_inverse_mult: "inverse (f * g :: 'a::field fps) = inverse f * inverse g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. inverse (f * g) = inverse f * inverse g
[PROOF STEP]
by (simp add: fps_inverse_mult_divring) | {"llama_tokens": 97, "file": null, "length": 1} |
--{-# LANGUAGE BangPatterns #-}
module NeuralNetworks where
import Util
import Data.List
import System.Random
import Numeric.LinearAlgebra
import Numeric.LinearAlgebra.Util
import Numeric.GSL.Minimization
import Control.Parallel (par,pseq)
import Debug.Trace
import System.IO
import System.Directory
readThetaList :: [I... | {"hexsha": "81b8e4850a093d9356831e035c402f227941e210", "size": 10969, "ext": "hs", "lang": "Haskell", "max_stars_repo_path": "src/NeuralNetworks.hs", "max_stars_repo_name": "thade/haskellml", "max_stars_repo_head_hexsha": "4d24f70323d8fbe1044732e3f4f99ac2c1cb6db8", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
#include "baldr/graphreader.h"
#include "baldr/rapidjson_utils.h"
#include "filesystem.h"
#include <boost/program_options.hpp>
#include <boost/property_tree/ptree.hpp>
#include <string>
#include "config.h"
namespace bpo = boost::program_options;
namespace bpt = boost::property_tree;
int main(int argc, char** argv) ... | {"hexsha": "b1d4691e6fccf3167d2f122d15acfc5f54a472c9", "size": 4008, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/valhalla_expand_bounding_box.cc", "max_stars_repo_name": "CesarHerreraG/valhalla", "max_stars_repo_head_hexsha": "0f481c6e751f0b3f7320d6ac41f32949dd2c5152", "max_stars_repo_licenses": ["MIT"], "m... |
# coding: utf-8
# # Separating Flowers
# This notebook explores a classic Machine Learning Dataset: the Iris flower dataset
#
# ## Tutorial goals
# 1. Explore the dataset
# 2. Build a simple predictive modeling
# 3. Iterate and improve your score
#
# How to follow along:
#
# git clone https://github.com/dataw... | {"hexsha": "579e087a9f93daf1bc57dfcf53b9779b0d051431", "size": 5598, "ext": "py", "lang": "Python", "max_stars_repo_path": "Iris Flowers Workshop.py", "max_stars_repo_name": "Dataweekends/pyladies_intro_to_data_science", "max_stars_repo_head_hexsha": "6c3d503d15b361d7f71f26adc451c1bb886429f5", "max_stars_repo_licenses"... |
# import modules
import numpy as np
import wave
def readWave(filename):
wr = wave.open(filename, 'r')
params = wr.getparams() # wr = wave_read, Get Parameters
nchannels = params[0] # Number of Channels
sampwidth = params[1] # Quantization Bit Number (Byte Number)
rate = params[2] # Sam... | {"hexsha": "503248e38b1bd2705221726c43eba2a8a9bdcc8d", "size": 3639, "ext": "py", "lang": "Python", "max_stars_repo_path": "iowave.py", "max_stars_repo_name": "animolopez/module", "max_stars_repo_head_hexsha": "588b8de7211bef29b85282a33c9313f90a505f71", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
# -*- coding: utf-8 -*-
"""
A collection of functions that use oTherm APIs to retrieve data from an oTherm instance. The typical application
is to first retrieve the *site* data. Then, using the *site* dataclass object, retrieve information about the:
- *weather_station*,
- *thermal_load*,
- *monitoring... | {"hexsha": "92a951ffc91ed587ef4f218d46366660abc60f75", "size": 19717, "ext": "py", "lang": "Python", "max_stars_repo_path": "db_tools/otherm_db_reader.py", "max_stars_repo_name": "otherm/gshp-analysis", "max_stars_repo_head_hexsha": "746070b10a05985c31f06acd5e052ac3a7bf4924", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
import scipy.sparse as sp
from fdfdpy.constants import ETA_0, EPSILON_0, DEFAULT_MATRIX_FORMAT
def sig_w(l, dw, m=4, lnR=-12):
# helper for S()
sig_max = -(m+1)*lnR/(2*ETA_0*dw)
return sig_max*(l/dw)**m
def S(l, dw, omega, L0):
# helper for create_sfactor()
return 1 - 1j*si... | {"hexsha": "a8f3563287a6ccad894613f90c52609d7c433af3", "size": 2901, "ext": "py", "lang": "Python", "max_stars_repo_path": "fdfdpy/pml.py", "max_stars_repo_name": "fancompute/python-fdfd", "max_stars_repo_head_hexsha": "49d3682a9cface0e2ce32932f4dbfc36adff9fef", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 34... |
#=
# 420: Discontinuous Quantities
([source code](SOURCE_URL))
Test jumping species and quantity handling
=#
module Example420_DiscontinuousQuantities
using Printf
using VoronoiFVM
using SparseArrays
using ExtendableGrids
using GridVisualize
using LinearAlgebra
function main(;N=5, Plotter=nothing,unknown_storage... | {"hexsha": "1e1012034564759390a43f66a2d8b1aa4cbecd99", "size": 3442, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/Example420_DiscontinuousQuantities.jl", "max_stars_repo_name": "PatricioFarrell/VoronoiFVM.jl", "max_stars_repo_head_hexsha": "690943ff455c91f16d114ad52cc83f2e8fa84e58", "max_stars_repo_li... |
import asyncio
import json
import time
from dataclasses import dataclass
from typing import Any, Callable, Dict, Generator, List, Optional, Sequence, Tuple
import numpy as np
from scanpointgenerator import CompoundGenerator
from bluefly import detector, motor, pmac
from bluefly.core import ConfigDict, Device, Remaini... | {"hexsha": "4d9d2f4bf1f51a8453be30564a2dccf1c24416d8", "size": 8813, "ext": "py", "lang": "Python", "max_stars_repo_path": "bluefly/fly.py", "max_stars_repo_name": "dls-controls/bluefly", "max_stars_repo_head_hexsha": "5f461998a3f629a5f07e8733ab937a0302fa92f6", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
[STATEMENT]
lemma \<L>_proj_2_reg_collapse:
"\<L> (proj_2_reg \<A>) = the ` (gcollapse ` map_gterm snd ` (\<L> \<A>) - {None})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<L> (proj_2_reg \<A>) = the ` (gcollapse ` map_gterm snd ` \<L> \<A> - {None})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 sub... | {"llama_tokens": 805, "file": "Regular_Tree_Relations_RRn_Automata", "length": 7} |
#!/usr/bin/python3
'''Advent of Code 2018 Day 10 solution'''
from typing import List, Tuple
import numpy
Grid = List[List[int]]
def cellpower(x: int, y: int, serial: int) -> int:
'''Calculate the "power" of a cell'''
if not x or not y:
return 0
rack = x + 10
return (int(((rack * y + serial) * r... | {"hexsha": "18f1b20ead8c5a280009099aad02a1af54cad581", "size": 2472, "ext": "py", "lang": "Python", "max_stars_repo_path": "aoc2018/day11.py", "max_stars_repo_name": "zoeimogen/AoC2018", "max_stars_repo_head_hexsha": "d50e1c483e58067f0f73e04318997410d53fcf15", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "... |
C include 'VICMAIN_FOR'
C
Subroutine ABLE86(IND,UNIT,BUF)
INTEGER*4 UNIT !Input unit number of image
INTEGER*4 BUF(*) !Array of label items returned
INTEGER IND
Real*4 XYZ
Character*20 CXYZ
Integer*4 SIZE,OFF,IJK
INTEGER*4 INSTANCE(30)
CHARACTER*9 TASKS(... | {"hexsha": "55279839649101a43f279f0567e88d85c5b1f0ca", "size": 16706, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "vos/p2/sub/able86/able86.f", "max_stars_repo_name": "NASA-AMMOS/VICAR", "max_stars_repo_head_hexsha": "4504c1f558855d9c6eaef89f4460217aa4909f8e", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
import numpy as np
from pcdet.utils.common_utils import create_logger
from pathlib import Path
from pcdet.datasets.nuscenes.nuscenes_dataset import NuScenesDataset
from pcdet.config import cfg, cfg_from_yaml_file
from pcdet.ops.roiaware_pool3d import points_in_boxes_cpu
from pcdet.utils import visualize_utils as V
fro... | {"hexsha": "e05ebdd23bd8a05761b37066a0e4812f31a932df", "size": 1638, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_datasets/nuscenes/test_nuscenes_dataset.py", "max_stars_repo_name": "StarsMyDestination/OpenPCDet", "max_stars_repo_head_hexsha": "a9bfdffb2c23f6fe7d4c19085b47ec35728d5884", "max_stars_... |
module testMoments
using Base.Test
using DataFrames
using Datetime
using TimeData
include(string(Pkg.dir("AssetMgmt"), "/src/AssetMgmt.jl"))
println("\n Running moments tests\n")
#########################
## test portfolio mean ##
#########################
pf = AssetMgmt.Portfolio(ones(4, 8)/8)
mus = DataFrame(rand... | {"hexsha": "f7493440494b61fd019c9a9db0cb5d0f4eb7c736", "size": 911, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/ttmoments.jl", "max_stars_repo_name": "cgroll/AssetMgmt.jl", "max_stars_repo_head_hexsha": "bbb87c1aab5f3b114807d7d5edb4db113260aa42", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
from typing import Tuple, Union, List, Any
import torch
import numpy as np
class Augmentation(object):
"""
Super class for all augmentations.
"""
def __init__(self) -> None:
"""
Constructor method
"""
pass
def __call__(self, *args: Any, **kwargs: Any) -> None:
... | {"hexsha": "b9e999fb5f2032290816c4819f79ca1417862ac1", "size": 5275, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/augmentation.py", "max_stars_repo_name": "ChristophReich1996/OSS-Net", "max_stars_repo_head_hexsha": "38ffae60286b53e72f2d17f510dbbfffb7036caa", "max_stars_repo_licenses": ["MIT"], "max_stars... |
from normal_form.games.zero_sum import ZeroSumGame
import numpy as np
class UniqueEquilibrium(ZeroSumGame):
def __init__(self, N, M, config):
G = np.zeros((N, M))
row = np.random.choice(N)
column = np.random.choice(M)
G[row, column] = 0.5
for i in range(M):
i... | {"hexsha": "d0ba79acb93f1402041c8a8ede9052d80cbe5828", "size": 635, "ext": "py", "lang": "Python", "max_stars_repo_path": "finite_games/normal_form/games/unique_equilibrium.py", "max_stars_repo_name": "rtloftin/strategically_efficient_rl", "max_stars_repo_head_hexsha": "85a702b9361211d345a58cc60696e4e851d48ec4", "max_s... |
import numpy as np
import os
# plotting settings
import plot_settings
import matplotlib.pyplot as plt
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "..",))
from frius import time2distance, das_beamform, image_bf_data
"""
User parameters
"""
min_depth = 0.01575
max_depth = 0.075
"""
Probe + raw... | {"hexsha": "7b5f444fccb66fa908fd254537685e256cfdfad2", "size": 1594, "ext": "py", "lang": "Python", "max_stars_repo_path": "report_results/fig4p4_visualize_nde.py", "max_stars_repo_name": "ebezzam/frius", "max_stars_repo_head_hexsha": "c3acc98288c949085b7dea08ef3708581f86ce25", "max_stars_repo_licenses": ["MIT"], "max_... |
import os
from pathlib import Path
from typing import List, Optional, Union
import numpy as np
import tensorflow as tf
# TODO(arl): allow depth for volumetric data
DIMENSIONS = ["height", "width", "channels"]
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
def ... | {"hexsha": "d904265a92d743b7f1db25a11a6d9edda143febc", "size": 4731, "ext": "py", "lang": "Python", "max_stars_repo_path": "cellx/tools/dataset.py", "max_stars_repo_name": "nthndy/cellx", "max_stars_repo_head_hexsha": "56a22099beeba59401d6882b6d6b0010718c0376", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
using HTTP
using JSON3
using SQLite
using ZulipSnippetBot
include("configuration.jl")
setupbot!(token = TOKEN, host = HOST, port = PORT)
const db = SQLite.DB(DB)
ZulipSnippetBot.run(db)
| {"hexsha": "99e978898f8507492fb95c19ba0599942bd778f5", "size": 188, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "snippetserver.jl", "max_stars_repo_name": "Arkoniak/ZulipSnippetBot", "max_stars_repo_head_hexsha": "c1789a29bb8c010859784ddc19c009e9e6eecdcc", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 10 10:16:49 2018
@author: paul
"""
import numpy as np
from scipy.stats import expon
import matplotlib.pyplot as plt
experiments = 100
winningprice = expon(-3, 5)
def buy(price):
win = winningprice.rvs()
return price < win
def purchase... | {"hexsha": "a005636b62961bb6e3e036dc2a6ec0120df43d7a", "size": 1538, "ext": "py", "lang": "Python", "max_stars_repo_path": "data.py", "max_stars_repo_name": "paulpach/pricingengine", "max_stars_repo_head_hexsha": "0feaa3819142370af9b85965f3da32dbff9f59ae", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
import os
import pickle
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as transforms
from tensorboardX import SummaryWriter
from models import basenet
from models import dataloader
from models.cifar_core import CifarModel
import utils
class CifarGrad... | {"hexsha": "2078085c4d7572b4955ddaa6be4082f7ac592a9b", "size": 11407, "ext": "py", "lang": "Python", "max_stars_repo_path": "dlfairness/original_code/DomainBiasMitigation/models/cifar_gradproj_adv.py", "max_stars_repo_name": "lin-tan/fairness-variance", "max_stars_repo_head_hexsha": "7f6aee23160707ffe78f429e5d960022ea1... |
import copy
from gym.wrappers import TransformReward
import numpy as np
from ray.rllib.env.atari_wrappers import FrameStack
from ray.tune import registry
from envs.frame_diff import FrameDiff
from envs.frame_stack_phase_correlation import FrameStackPhaseCorrelation
from envs.grayscale import Grayscale
from envs.mixed... | {"hexsha": "cf93e1e5e9d1fd074e2210bf85124cd40da0000f", "size": 2403, "ext": "py", "lang": "Python", "max_stars_repo_path": "envs/custom_procgen_env_wrapper.py", "max_stars_repo_name": "wulfebw/neurips2020-procgen", "max_stars_repo_head_hexsha": "e131684cfa15188473873144933fc73bd54a2e60", "max_stars_repo_licenses": ["Ap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.