text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
def check_1a(answer):
import sympy
return answer == sympy.Rational(1,3)
def check_2a(answer):
import sympy
return answer == sympy.Symbol('y')
def check_2b(answer):
import sympy
return answer == sympy.Symbol('chi')
def check_2c(answer):
import sympy
... | {"hexsha": "2b05499903b1966c2bcba46542fd89e6376b3b99", "size": 1674, "ext": "py", "lang": "Python", "max_stars_repo_path": "verify_1.py", "max_stars_repo_name": "bolverk/cyborg_math", "max_stars_repo_head_hexsha": "298224dadd4218ebcc266b0a135e15595a359343", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14, "ma... |
[STATEMENT]
lemma simple_integral_null_set:
assumes "simple_function M u" "\<And>x. 0 \<le> u x" and "N \<in> null_sets M"
shows "(\<integral>\<^sup>Sx. u x * indicator N x \<partial>M) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<integral>\<^sup>S x. u x * indicator N x \<partial>M = 0
[PROOF STEP]
pro... | {"llama_tokens": 1264, "file": null, "length": 13} |
[STATEMENT]
lemma VLambda_eq_D2: "\<lbrakk>VLambda A f = VLambda A g; x \<in> elts A\<rbrakk> \<Longrightarrow> f x = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>VLambda A f = VLambda A g; x \<in> elts A\<rbrakk> \<Longrightarrow> f x = g x
[PROOF STEP]
by (metis beta) | {"llama_tokens": 124, "file": "ZFC_in_HOL_ZFC_Cardinals", "length": 1} |
using JuMP, EAGO
m = Model()
EAGO.register_eago_operators!(m)
@variable(m, -1 <= x[i=1:4] <= 1)
@variable(m, -23.072345451695163 <= q <= 18.38163265505858)
add_NL_constraint(m, :(sigmoid(-0.6895881478464707 + 0... | {"hexsha": "ebec44cf9f464edb1a2ebce2f96078b2ba0b54b7", "size": 3242, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "solver_benchmarking/MINLPLib.jl/instances/ANN_Env/41_sigmoid_4_2_4.jl", "max_stars_repo_name": "PSORLab/RSActivationFunctions", "max_stars_repo_head_hexsha": "0bf8b4500b21144c076ea958ce93dbdd19a533... |
"""Usage:
evaluate --gold=GOLD_FILE (--pred=PRED_FILE | --allfactual) --default=DEFAULT_VALUE
Prints the Mean Squared Error between a predicated and gold factuality file, using a specified default value.
Assumes that both gold and predicated agree on the events to annotate. """
from docopt import docopt
from operat... | {"hexsha": "97a386a4aea10cba7daadfa0377f2aca1e23ece3", "size": 8431, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/evaluate.py", "max_stars_repo_name": "gabrielStanovsky/unified-factuality", "max_stars_repo_head_hexsha": "869fd23ec8fe71ab2b9f30389018615932d27cde", "max_stars_repo_licenses": ["MIT"], "max_s... |
import pyredner
import numpy as np
import torch
import redner
# Optimize vertices of 2D meshes
# Use GPU if available
pyredner.set_use_gpu(torch.cuda.is_available())
# Setup camera: We place the camera at (0, 0, -1), with look vector
# (0, 0, 1). We also use an orthographic camera just to
# ... | {"hexsha": "c3e858167bcec2029fe643c5f992f303ddbf6e25", "size": 6468, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/two_d_mesh.py", "max_stars_repo_name": "aferrall/redner", "max_stars_repo_head_hexsha": "be52e4105140f575f153d640ba889eb6e6015616", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
C FILE: LAYERS.F
SUBROUTINE LAYERS_LOCATE(xx,Nlayers,m,x,k)
INTEGER Nlayers
REAL*4 xx(Nlayers)
REAL*4 x
INTEGER m
INTEGER kl, km, ku,k
Cf2py intent(in) xx,Nlayers,m
Cf2py intent(in) x
Cf2py intent(out) k
C bisection, following Press et al., Numerical Recipes in For... | {"hexsha": "18572c45df21dfa50107dc367f34997e137c8bba", "size": 2627, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "layers.f", "max_stars_repo_name": "roxyboy/xlayers", "max_stars_repo_head_hexsha": "2e2d97d6f792dd71417919849a66c66f998407e0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 11, "max_stars... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
import itertools, operator, random, math
from scipy.sparse.linalg import spsolve_triangular
from sklearn import linear_model
import pandas as pd
def random_sampling(data, porpotion):
sampled_data = np.empty(data.shape)
sampled_data[... | {"hexsha": "085cd47852ba0d305de67b4cbf38da2fe585ae38", "size": 6474, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "onionpork/sparsemyxo", "max_stars_repo_head_hexsha": "ee08764c05733419a92246f5fcf47a76dc409228", "max_stars_repo_licenses": ["BSD-Source-Code"], "max_stars_count... |
struct S a::T end
struct T end
| {"hexsha": "5628100340d000d6bcbce4169b5f7566d45ebaae", "size": 32, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "tests/typing/bad/testfile-unbound-3.jl", "max_stars_repo_name": "gabriel-doriath-dohler/pjulia", "max_stars_repo_head_hexsha": "14325f282b711c979091ec259aefb0f1e89ec1be", "max_stars_repo_licenses": [... |
[STATEMENT]
lemma nnvs_finite: "n_nearest_verts w u n U \<Longrightarrow> finite U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. n_nearest_verts w u n U \<Longrightarrow> finite U
[PROOF STEP]
by (induction rule: n_nearest_verts.induct) auto | {"llama_tokens": 97, "file": "Query_Optimization_Graph_Definitions", "length": 1} |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from nltk.util import ngrams
import numpy as np
def format_line( line, padding = 1 ):
line = line.strip()
line = "<s> " * padding + line + " </s>" * padding
line = line.split( " " )
return line
def init_vocab():
vocab = {
"unk": 0,
"<s>": 1,
"</s>"... | {"hexsha": "7ea90e207883f1e6945a38591abf70499c340edd", "size": 3299, "ext": "py", "lang": "Python", "max_stars_repo_path": "misc/prepare_data_bi.py", "max_stars_repo_name": "raphaelrubino/nid", "max_stars_repo_head_hexsha": "343a225fe0a078fa4b4d43b08ed53e9731b0471b", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
from typing import Iterable
from scipy.sparse import csr_matrix
from maru.feature.vocabulary import FeatureVocabulary
from maru.types import FeatureVector
class SparseFeatureVectorizer:
def __init__(self, vocabulary: FeatureVocabulary):
self._vocabulary = vocabulary
def transform(self, features: It... | {"hexsha": "c877aaa7b50322aef182a9dc3daeffa03a7a7275", "size": 839, "ext": "py", "lang": "Python", "max_stars_repo_path": "maru/vectorizer/sparse/feature.py", "max_stars_repo_name": "chomechome/maru", "max_stars_repo_head_hexsha": "dae41e250a64a8b6f6ab9647fd60221d5ede8ab6", "max_stars_repo_licenses": ["MIT"], "max_star... |
************************************************************************
* UPDATE_EST - Updates the estimated yield of magic beans given
* some additional amount of rainfall
************************************************************************
*
* VARIABLES
*
* INPUT RAIN = Additional ra... | {"hexsha": "f7f39f7709da826067a7576fe3a9cdfebbddfad3", "size": 2960, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "delphi/translators/for2py/tests/test_data/legacy_tests/crop_yield_function.f", "max_stars_repo_name": "cthoyt/delphi", "max_stars_repo_head_hexsha": "3df2de639905453f5d28d7a7b3b9f7e5a7a1fb0d", "ma... |
from pathlib import Path
import unittest
import numpy as np
from onnxruntime_extensions.eager_op import EagerOp, BlingFireSentenceBreaker
def _get_test_data_file(*sub_dirs):
test_dir = Path(__file__).parent
return str(test_dir.joinpath(*sub_dirs))
def _run_blingfire_sentencebreaker(input, output, model_path):... | {"hexsha": "fe97bddfa8da018690e7ccc26e18649c8a64b8f9", "size": 1406, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_blingfire_sentencebreaker.py", "max_stars_repo_name": "xadupre/onnxruntime-extensions", "max_stars_repo_head_hexsha": "3e82549bcb53bc93d04c25d64f16a52d495725c1", "max_stars_repo_licenses... |
#!/usr/bin/env julia
open("test.txt","w") do fout
write(fout,"Hello World!\n")
end | {"hexsha": "67c15b58dc123bf15d069bb522aa951bb1640b90", "size": 85, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "julia/io/simple.jl", "max_stars_repo_name": "jdurbin/sandbox", "max_stars_repo_head_hexsha": "ee982f7386ae02c5937dbaee867710b5cd2cc71b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
from basic_utils.options import *
import numpy as np
from models.net_builder import MLPs_pol, MLPs_v
from models.optimizers import *
from models.policies import StochPolicy
from models.baselines import *
from basic_utils.replay_memory import *
from models.data_processor import *
# ====================================... | {"hexsha": "e6d5bbd4375c58420de02a99e5d5816b2c2c46cd", "size": 17183, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/agents.py", "max_stars_repo_name": "hzxsnczpku/banrinochoujou", "max_stars_repo_head_hexsha": "9e04bc5c561ab674fd10e4991aa4b5ae86364f6c", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2014 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | {"hexsha": "b901896228e9521c827a73bf23d5a6b84a2619e8", "size": 15251, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyannote/core/segment.py", "max_stars_repo_name": "gw17/pyannote-core", "max_stars_repo_head_hexsha": "ccbb3c07d1c1c577391d05a296858287cd9e0dfb", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
\section{Introduction and Related Work} \label{SIP:sec:intro}
Imagine an event organizer trying to convene an event -- for example,
a fundraiser. We assume that the time and venue for the event are fixed,
and that the only remaining decision for the organizer to make is whom
to invite among a set of agents.
An \emph{i... | {"hexsha": "7b4b7abb4b3a8c4b1ce5630aed1cdd3e359f22d3", "size": 35580, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "prior to 2016-09-18/50SIP.tex", "max_stars_repo_name": "ltdtl/thesis", "max_stars_repo_head_hexsha": "b1585aa3e57e06b4368fb51540bbbf1c64c491df", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import pytest
from pathlib import Path
import numpy as np
import scanpy as sc
import scipy
import scipy.sparse
from scTenifoldXct.core import scTenifoldXct
@pytest.fixture(scope="session")
def ada_skin():
data_path = Path(__file__).parent.parent / "./data/LS.h5ad"
ada = sc.read_h5ad(data_path)
data = sc... | {"hexsha": "19f3504b28f29a1c465b904d667d325f0b630d1c", "size": 1446, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/conftest.py", "max_stars_repo_name": "cailab-tamu/scTenifoldXct", "max_stars_repo_head_hexsha": "d25ded8dfb7f2951217a30ab71eccd6b060178f6", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import math
from functools import reduce
from matplotlib import cm
from matplotlib.colors import Normalize
import numpy as np
L = 1.000001
OVERFLOW = 10**20
quadabs = lambda z: z.real * z.real + z.imag * z.imag
def differentiate(p):
n = len(p) - 1
return [(n - i) * an for (i, an) in enumerate(p[:-1])]
def h... | {"hexsha": "78ad27ccaf87d71f8c7ca785901598bd1d976e41", "size": 7043, "ext": "py", "lang": "Python", "max_stars_repo_path": "fractal.py", "max_stars_repo_name": "kuco23/fractal", "max_stars_repo_head_hexsha": "bed6461bd19ebbd1c6cd07e679d83037df9adcf7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars... |
import sklearn
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.model_selection import learning_curv... | {"hexsha": "4175a16b7fe24d22a2fbedbfcb127dcec2b13d45", "size": 9555, "ext": "py", "lang": "Python", "max_stars_repo_path": "output/UNaIAModel.py", "max_stars_repo_name": "baguevaram/UNa-IA", "max_stars_repo_head_hexsha": "e946a74dae97c44fe7d3eba1adf8e849a3e0a4bb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
#!/usr/bin/python
#Student name: Iva Bubalo
#Email: i.bubalo1@nuigalway.ie
#Student ID: 20235871
#GitHub: https://github.com/ivabu/ARC/upload/master/src
import os, sys
import json
import numpy as np
import re
### YOUR CODE HERE: write at least three functions which solve
### specific tasks by transforming the input... | {"hexsha": "519532d95c5c22f19895e00bf8d6a734f004c781", "size": 5986, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/manual_solve.py", "max_stars_repo_name": "ivabu/ARC", "max_stars_repo_head_hexsha": "842c351b0e2aea6033e075f9584aa56cbd8e277f", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": nu... |
# Interpretable cnn for big five personality traits using audio data #
# Get 20 max predictions of each traits #
import scipy.io
import numpy as np
import pandas as pd
import tensorflow as tf
import heapq
# Load files.
model_preds = np.load('.../path/to/load/model_pred.npy')
model_conv_features = np.load('.../path/to... | {"hexsha": "ea48c9a4c6a9fcc3db8dae878e024840e6a5400c", "size": 4195, "ext": "py", "lang": "Python", "max_stars_repo_path": "cam_generation_rawwav/get_20_max_pred.py", "max_stars_repo_name": "HassanHayat08/Interpretable-CNN-for-Big-Five-Personality-Traits-using-Audio-Data", "max_stars_repo_head_hexsha": "7149e78736611f0... |
########################################################
############Ray Tracing scripts#########################
########################################################
from __future__ import division,with_statement
import sys,os
import time
import gc
from operator import add
from functools import reduce
from lens... | {"hexsha": "882c16bc46f1c7af1e7db7776ab175fe2a8ce743", "size": 41473, "ext": "py", "lang": "Python", "max_stars_repo_path": "lenstools/scripts/raytracing.py", "max_stars_repo_name": "asabyr/LensTools", "max_stars_repo_head_hexsha": "e155d6d39361e550906cec00dbbc57686a4bca5c", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""Functions for infection rates"""
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import dtype_util
import numpy as np
from covid.rdata import load_mobility_matrix, load_population, load_age_mixing
from covid.pydata import load_commute_volume
from covid.impl.c... | {"hexsha": "2dce1ef10cea366723d3db3aa366cc9504aca511", "size": 11426, "ext": "py", "lang": "Python", "max_stars_repo_path": "covid/model.py", "max_stars_repo_name": "FrankD/covid19uk", "max_stars_repo_head_hexsha": "dcc463bd5a2432c58935891728cbb4a5d9fb94ff", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import hashlib
from warnings import warn
import six
import numpy as np
import pandas as pd
import matplotlib.collections as mcoll
import matplotlib.text as mtext
import matplotlib.transforms as mtransforms
from... | {"hexsha": "7854d7400d1405d2aead2be4eb4bdfb46ca5b438", "size": 13278, "ext": "py", "lang": "Python", "max_stars_repo_path": "venv/lib/python2.7/site-packages/plotnine/guides/guide_colorbar.py", "max_stars_repo_name": "nuriale207/preprocesspack", "max_stars_repo_head_hexsha": "cc06a9cb79c5e3b392371fcd8d1ccf7185e71821", ... |
"""Rudimentary reimplementation of gradient based smoothing from LAYNII
Reference
---------
https://github.com/layerfMRI/LAYNII/blob/master/LN_GRADSMOOTH.cpp
"""
import os
import numpy as np
import nibabel as nb
from scipy.ndimage import gaussian_filter
from numpy.linalg import eigh
# ===============================... | {"hexsha": "d4f2321e62e69ae3b3ad43af86ac3f1a6520ff5f", "size": 1636, "ext": "py", "lang": "Python", "max_stars_repo_path": "old/wip/LN_GRADSMOOTH.py", "max_stars_repo_name": "ofgulban/PyLAYNII", "max_stars_repo_head_hexsha": "38e607edbd6601b5893e519af3f791059fbe190d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
from matplotlib import rc
from matplotlib import rcParams
__author__ = 'ernesto'
# if use latex or mathtext
rc('text', usetex=True)
rcParams['text.latex.preamble']=[r"\usepackage{amsmath}"]
col1 = 'b'
col2 = 'k'
col3 = 'r'
####### Parámet... | {"hexsha": "6eb7ff87c830d0995672cfa7702571e680b582b9", "size": 4717, "ext": "py", "lang": "Python", "max_stars_repo_path": "figuras/PycharmKayStatisticalReport/problem_13_11.py", "max_stars_repo_name": "bor9/estudiando_el_kay", "max_stars_repo_head_hexsha": "6e07908b8b0b5a5166dadce30001e6100e8304c3", "max_stars_repo_li... |
import cv2
import numpy as np
import pandas as pd
from keras.preprocessing.image import img_to_array
import calendar;
import time;
from keras.models import load_model
from keras.models import model_from_json
import os
import cv2
import numpy as np
import pandas as pd
from keras.preprocessing.image import img_to_array... | {"hexsha": "c3baed2b5873cc258fc35029fc74e9035ad5d3d8", "size": 14159, "ext": "py", "lang": "Python", "max_stars_repo_path": "scannable_paper.py", "max_stars_repo_name": "dhavalocked/alchemy-backend", "max_stars_repo_head_hexsha": "c908e0c8066c3b8a327d92da0ff34f13522f470d", "max_stars_repo_licenses": ["MIT"], "max_stars... |
from amuse.community import *
from amuse.units import units
from amuse.units import constants
from amuse.units.quantities import Quantity
from amuse.community.interface import common
from amuse.datamodel import Particles
from amuse.datamodel import ParticlesSubset
import numpy
class BSEInterface(CodeInterface, commo... | {"hexsha": "b4492cd3446360dc308d9146d05ab0da2649fa95", "size": 27751, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/amuse/community/bse/interface.py", "max_stars_repo_name": "GFTwrt/amuse", "max_stars_repo_head_hexsha": "ff9e1ff6904e191f6b5a2e6f84c078062f553293", "max_stars_repo_licenses": ["Apache-2.0"], ... |
import numpy as np
def query_integral_image( integral_image, size_x, size_y):
x = integral_image.shape[0]
y = integral_image.shape[1]
area, i, j=0,0,0
hits = 0
# count how many possible locations
for i in xrange(x - size_x):
for j in xrange(y - size_y):
area... | {"hexsha": "ac22ed645e8ce2e7838b232446884badcd2191a2", "size": 1050, "ext": "py", "lang": "Python", "max_stars_repo_path": "vizs/astrotrend.tmp/query_integral_image.py", "max_stars_repo_name": "fedhere/fedhere.github.io", "max_stars_repo_head_hexsha": "8c38da0305b3a9294ee4da86b7da69b50e5205d8", "max_stars_repo_licenses... |
import heterocl as hcl
import os, sys
import numpy as np
def test_stream():
A = hcl.placeholder((32, 32), "A")
def kernel_two(A):
B = hcl.compute(A.shape, lambda i, j : A[i, j] + 1, "B")
C = hcl.compute(A.shape, lambda i, j : B[ii, jj] + 1, "C")
return C
target = hcl.Platform.xi... | {"hexsha": "8a0199ed9e0bfcb9f89b9937d0b2bb20612bf18b", "size": 740, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/mlir/hcl-mlir/test_stream.py", "max_stars_repo_name": "chhzh123/heterocl", "max_stars_repo_head_hexsha": "856e9b8ad877d11280a7e457e91ca89803c05570", "max_stars_repo_licenses": ["Apache-2.0"],... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.sparse as Spar
import scipy.sparse.linalg as SparLinalg
np.set_printoptions(linewidth = 500)
def NN_Arr(coor):
N = coor.shape[0]
NN = -1*np.ones((N,4), dtype = 'int')
xmax = max(coor[:,0])
ymax = max(coor[:,1])
Lx = xmax + 1
Ly = ... | {"hexsha": "64b7d5a955c83e34a17060db0999482cbe8b1308", "size": 2954, "ext": "py", "lang": "Python", "max_stars_repo_path": "junk/practice/sparse_toy.py", "max_stars_repo_name": "tbcole/majoranaJJ", "max_stars_repo_head_hexsha": "dcf31f7786fa0a4874a940b7d8dcdd55f3921a46", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import json
import os
import time
import numpy as np
import pyUSRP as u
from flask_socketio import emit
from flask_login import current_user
from app import socketio, check_connection, measure_manager
@socketio.on('vna_param')
def handle_vna_param(msg, methods=['GET', 'POST']):
f_min = 1e6*float(msg['start_F']... | {"hexsha": "89fa2d72c90c35947f6750f3192e2ee827260d39", "size": 2150, "ext": "py", "lang": "Python", "max_stars_repo_path": "handlers/VNA_handlers.py", "max_stars_repo_name": "LorenzoMinutolo/GPU_SDR_WEBGUI", "max_stars_repo_head_hexsha": "3b04b10c140acdf793fcca60e07c6efb348b27f4", "max_stars_repo_licenses": ["MIT"], "m... |
function solution()
sum, curr, next = 0, 1, 2
while curr < 4000000
if curr % 2 == 0
sum += curr
end
temp = next
next += curr
curr = temp
end
sum
end
if length(ARGS) == 1 && ARGS[1] == "-a"
println(solution())
exit(0)
end
for line in eachline(STDIN)
iters = int(line)
start... | {"hexsha": "0b60e8eeb3b8ca3ac72fdcab5de00790e70534f2", "size": 421, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "problems/002/002.jl", "max_stars_repo_name": "jsdelivrbot/euler_criterion.rs", "max_stars_repo_head_hexsha": "7eee1353560d2a784209ca8735632806388e14e1", "max_stars_repo_licenses": ["Apache-2.0", "MI... |
[STATEMENT]
lemma del_Leaf[simp]: "del x Leaf = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. del x \<langle>\<rangle> = None
[PROOF STEP]
using val_cong[OF del_tm.simps(1)]
[PROOF STATE]
proof (prove)
using this:
Time_Monad.val (del_tm ?x1 \<langle>\<rangle>) = Time_Monad.val (return None \<bind> tick)
goal... | {"llama_tokens": 172, "file": "Root_Balanced_Tree_Root_Balanced_Tree", "length": 2} |
# -*- coding: utf-8 -*-
"""
Setting up data recovery for relative displacements
"""
import numpy as np
import scipy.linalg as la
from pyyeti.nastran import n2p
# FIXME: We need the str/repr formatting used in Numpy < 1.14.
try:
np.set_printoptions(legacy="1.13")
except TypeError:
pass
def relative_displacem... | {"hexsha": "9e332bd26597a571e99c292edb28d79f1b063f48", "size": 7083, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyyeti/cla/rel_disp_dtm.py", "max_stars_repo_name": "twmacro/pyye", "max_stars_repo_head_hexsha": "c4febd44be836bd87368da13c1fb0cf82838b687", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
#!/usr/bin/env python
"""
This script transforms duckietown images into costmaps.
A costmap is a greyscale image that specifies which areas of the map are driveable.
The white sections are able to driven on by the duckiebot, and the black sections are not.
Practically, the costmap will be used in A* to weight certai... | {"hexsha": "d755474123405a3596a64af5b33ea694a1349b95", "size": 4745, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym-duckietown/duckie_astar_hw7/render_costmap.py", "max_stars_repo_name": "williamlooo/self-driving-decal", "max_stars_repo_head_hexsha": "0d083619c44d13eecde09ad0a7660459d8861c0d", "max_stars_re... |
import copy
import cv2
import numpy as np
import onnxruntime
class YolopONNX(object):
def __init__(
self,
model_path='yolop-640-640.onnx',
input_shape=(640, 640),
score_th=0.3,
nms_th=0.45,
providers=['CPUExecutionProvider'],
):
# 入力サイズ
self.inp... | {"hexsha": "4572157da34475255cdd6a0b974396ce2bfa6151", "size": 8950, "ext": "py", "lang": "Python", "max_stars_repo_path": "yolop_onnx.py", "max_stars_repo_name": "Kazuhito00/YOLOP-ONNX-Video-Inference-Sample", "max_stars_repo_head_hexsha": "ecc10c2c80cf7ef50b247541ef89eedc8cfc080e", "max_stars_repo_licenses": ["MIT"],... |
"""
Example file
"""
import os
import sys
sys.path = [os.path.abspath("..")] + sys.path
import matplotlib.pyplot as plt
import numpy as np
from mpl_chord_diagram import chord_diagram
# flux matrix
flux = np.array([
[11975, 5871, 8916, 2868],
[ 1951, 10048, 2060, 6171],
[ 8010, 16145, 81090, 8045],
... | {"hexsha": "3409b986029c23954b993d3ff4ad30d45a2d6f1a", "size": 2267, "ext": "py", "lang": "Python", "max_stars_repo_path": "example.py", "max_stars_repo_name": "Silmathoron/matplotlib-chord-diagram", "max_stars_repo_head_hexsha": "0e3d2fd15539bf2544b1bc368cd62e3c57df9dfe", "max_stars_repo_licenses": ["MIT"], "max_stars... |
// SPDX-License-Identifier: MIT
// The MIT License (MIT)
//
// Copyright (c) 2014-2018, Institute for Software & Systems Engineering
// Copyright (c) 2018-2019, Johannes Leupolz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the... | {"hexsha": "f3af5af517751760124b35f66a03fd7f0e4800d8", "size": 3785, "ext": "h", "lang": "C", "max_stars_repo_path": "pemc/lmc/lmc.h", "max_stars_repo_name": "joleuger/pemc", "max_stars_repo_head_hexsha": "14deb5b97d4219ba3c92d3834ab71332997e9b13", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars... |
# This script actually solves the CoeurdacierReyWinant model with a risk-adjusted linearization
# and times the methods, if desired
using BenchmarkTools, RiskAdjustedLinearizations, Test, JLD2
include("crw.jl")
# Settings
diagnostics = true
# Set up
m_crw = CoeurdacierReyWinant()
m = crw(m_crw)
z0 = copy(m.z)
y0 = co... | {"hexsha": "8af029de4c482516ff9c91c1c415f618917849c5", "size": 1577, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/crw/example_crw.jl", "max_stars_repo_name": "chenwilliam77/RiskAdjustedLinearizations", "max_stars_repo_head_hexsha": "24d95b555882bc5336fe9fb456e9364c6f8f0f3f", "max_stars_repo_licenses":... |
import torch
import numpy as np
import matplotlib.pyplot as plt
import pickle
import advOpt
from poisson_example import Poisson_FIM
##############
##VECTOR FIELD
##############
fim = Poisson_FIM(omega=(2., 1.))
logit_design_grid, eta11_grid = np.meshgrid(np.linspace(-0.65, 0.65, 10),
... | {"hexsha": "0b673bd22a4c67da42effdbe94f3a8ab5423fe4e", "size": 2516, "ext": "py", "lang": "Python", "max_stars_repo_path": "poisson_plots.py", "max_stars_repo_name": "dennisprangle/AdversarialDesignCode", "max_stars_repo_head_hexsha": "ddf0c7ee667e20e236dfc804394835a9bee11d84", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma sub_args: "s \<in> set (args t) \<Longrightarrow> sub s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. s \<in> set (args t) \<Longrightarrow> sub s t
[PROOF STEP]
by (induct t) (auto intro: sub.intros) | {"llama_tokens": 90, "file": "Lambda_Free_RPOs_Lambda_Free_Term", "length": 1} |
import numpy as np
from keras.models import load_model
import sys
import json
import os
import cv2
imagePath = os.getcwd() + "/uploads/dog.jpg"
img = cv2.imread(imagePath)
img = cv2.resize(img, (50, 50))
img = img / 255.0
img = img.reshape(1, 50, 50, 3)
filePath = os.getcwd() + "/pyScript/model.h5"
print(filePath)
mo... | {"hexsha": "10c6feecfd95fd256a00471e2abb21a646db41fa", "size": 461, "ext": "py", "lang": "Python", "max_stars_repo_path": "node-server/pyScript/app.py", "max_stars_repo_name": "bhanuraghav/Agri-Learning", "max_stars_repo_head_hexsha": "db78894bc0a0ae24c972c7e8fed78ca6fe584f9a", "max_stars_repo_licenses": ["Apache-2.0"]... |
import copy
import glob
import os
import time
import types
from collections import deque
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import tensorflow as tf
import pickle
import algo
from arguments import get_args
from envs import make_vec... | {"hexsha": "2a5d2a10b45d7daef2f60788d75b1878f0eb777b", "size": 11767, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytorch-a2c-ppo-acktr/main_agent.py", "max_stars_repo_name": "leobix/gym-miniworld", "max_stars_repo_head_hexsha": "8b84c0370c665eb349512d779cc47b1f1b06a41a", "max_stars_repo_licenses": ["MIT"], ... |
#!/usr/bin/env python3
from cv2_demo.cv2Node import cv2Node
import numpy as np
RGB_TOPIC = "/rgb"
CAMERA_INFO_TOPIC = "/camera_info"
def main():
cv2_node = cv2Node(
CAMERA_INFO_TOPIC,
RGB_TOPIC
)
cv2_node.run()
if __name__ == '__main__':
main() | {"hexsha": "0abea16164ac5b83fab6538cf7c4b2a08f60b6dc", "size": 279, "ext": "py", "lang": "Python", "max_stars_repo_path": "vision_demo/scripts/vision_main.py", "max_stars_repo_name": "bchandaka/Intro-to-ROS-Workshop", "max_stars_repo_head_hexsha": "5062558cce7b34ee3cdfca00f8cb5b3db92cde6b", "max_stars_repo_licenses": [... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
import numpy as np
import pytest
from pydefect.input_maker.supercell import (
Supercell, Supercells, TetragonalSupercells, RhombohedralSupercells)
from pydefect.util.error_classes import SupercellError
from pymatgen impor... | {"hexsha": "c1809cce3775ce097cdf76b7b5e25601f54594c4", "size": 3566, "ext": "py", "lang": "Python", "max_stars_repo_path": "pydefect/tests/input_maker/test_supercell.py", "max_stars_repo_name": "KazMorita/pydefect", "max_stars_repo_head_hexsha": "681e4bfe92c53edfe8b50cb72768114b28daabc9", "max_stars_repo_licenses": ["M... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""Script for generating a dataset for neural renderer training"""
import os
import sys
import argparse
import numpy as np
import confignet
def parse_args(argv):
parser = argparse.ArgumentParser(description="Script for generating ... | {"hexsha": "9fc529d6d176940659a5e2fcc2bbeca77ebecae8", "size": 2633, "ext": "py", "lang": "Python", "max_stars_repo_path": "generate_dataset.py", "max_stars_repo_name": "microsoft/ConfigNet", "max_stars_repo_head_hexsha": "f16b9b52698b1fe588322fdc5d921746f68d0e9e", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
"""
Functions to read atomic data.
"""
"""
get_atomic_stage(element::String, stage; source="NIST")
Returns the level structure for a given atomic stage for `element`
and ionisation stage `stage`. Uses data from the given `source`,
returns an `AtomicStage` struct. Currently, the only supported source
is `"NIST"`, ... | {"hexsha": "f40fe38e2866bb656d29003a359086f58b1c5214", "size": 2879, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/read_utils.jl", "max_stars_repo_name": "tiagopereira/AtomicData.jl", "max_stars_repo_head_hexsha": "0984efc50c4507841c6bc266308bb16f430f6790", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
# 4. faza: Analiza podatkov
# zemljevid za 3 grupe
tmp_data<-filter(Neudelezevanje_15,Neudelezevanje_15$QUANTILE=="Celotna populacija",Neudelezevanje_15$ACL00=="Športni dogodki")
tmp_data$ACL00= NULL
tmp_data$QUANTILE=NULL
k<-list()
for (i in 1:6){
k[[i]]<-kmeans(tmp_data$Value,i)
}
betweenss_totss<-list()
for (i in... | {"hexsha": "fbecf9e94744e307789c9b1fecd5f7a7ca40006b", "size": 2889, "ext": "r", "lang": "R", "max_stars_repo_path": "analiza/analiza.r", "max_stars_repo_name": "kuskus-star/APPR-2019-20", "max_stars_repo_head_hexsha": "5b644721b9418a181a0af4033f71779aeeb2c5af", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
[STATEMENT]
lemma distinguishes_sym :
assumes "distinguishes M q1 q2 io"
shows "distinguishes M q2 q1 io"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. distinguishes M q2 q1 io
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinguishes M q1 q2 io
goal (1 subgoal):
1. distinguishes M q2 q1... | {"llama_tokens": 263, "file": "FSM_Tests_FSM", "length": 3} |
-- Copyright 2022-2023 VMware, Inc.
-- SPDX-License-Identifier: BSD-2-Clause
import .linear
variables {a: Type} [ordered_add_comm_group a].
def positive (s: stream a) := 0 <= s.
def stream_monotone (s: stream a) := ∀ t, s t ≤ s (t+1).
def is_positive {b: Type} [ordered_add_comm_group b]
(f: stream a → stream b) :=... | {"author": "tchajed", "repo": "database-stream-processing-theory", "sha": "c4c3b7ced9f964f3ea17db77958df78f2d761509", "save_path": "github-repos/lean/tchajed-database-stream-processing-theory", "path": "github-repos/lean/tchajed-database-stream-processing-theory/database-stream-processing-theory-c4c3b7ced9f964f3ea17db7... |
from __future__ import print_function
import warnings
import matplotlib.pyplot as plt
warnings.filterwarnings("ignore")
import numpy as np
from models.deeplabv3p import Deeplabv3
import os
import multiprocessing
workers = multiprocessing.cpu_count()//2
import keras
import keras.backend as K
from keras.utils.data_utils ... | {"hexsha": "aecb8ebbcfe2ed9cd86737bc533b014d71630487", "size": 17977, "ext": "py", "lang": "Python", "max_stars_repo_path": "code_cm17/models/utils.py", "max_stars_repo_name": "micimize/DigitalHistoPath", "max_stars_repo_head_hexsha": "f2a4dd03761e321c35b1b2e17de3aa4b3ba49511", "max_stars_repo_licenses": ["MIT"], "max_... |
"""Console script for standard_linearity."""
import json
from pathlib import Path
import click
import statsmodels.api as sm
from patsy import dmatrices
from standard_linearity import export_data, import_data
DEFAULT_PLOT_CONFIG = {
"calibration_attrs": None,
"residual_attrs": None,
"errors_attrs": None,... | {"hexsha": "c0372067a1e820c7ff1a564bda61e8cf78dc158f", "size": 3683, "ext": "py", "lang": "Python", "max_stars_repo_path": "standard_linearity/cli.py", "max_stars_repo_name": "hainesm6/standard-linearity", "max_stars_repo_head_hexsha": "a222878857332bf46bb5e13c1ed579a1b82e4174", "max_stars_repo_licenses": ["BSD-3-Claus... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from . import utils
from . import sfh
from . import corner
from . import sed
from ..io.write_results import chain_to_struct, dict_to_struct
from .figuremaker import FigureMaker, colorcycle
__all__ = ["FigureMaker", "utils", "sfh", "corner", "sed",
... | {"hexsha": "094a1634aec2b0f6e36ac3d71ed2d729e35f0cb4", "size": 1445, "ext": "py", "lang": "Python", "max_stars_repo_path": "prospect/plotting/__init__.py", "max_stars_repo_name": "wrensuess/prospector", "max_stars_repo_head_hexsha": "08173f84ddfc2b031c78822344fc821778d35bae", "max_stars_repo_licenses": ["MIT"], "max_st... |
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ *********... | {"author": "Priyanka-Mondal", "repo": "Coq", "sha": "220c3eccfa5643b1ca2398d4940e29917da786d9", "save_path": "github-repos/coq/Priyanka-Mondal-Coq", "path": "github-repos/coq/Priyanka-Mondal-Coq/Coq-220c3eccfa5643b1ca2398d4940e29917da786d9/lib/theories/Logic/Description.v"} |
#%% Plot Best objective vs population
import sys,os
sys.path.insert(0,'../../../')
from glennopt.base import Parameter
from glennopt.helpers import mutation_parameters, de_mutation_type
from glennopt.helpers import get_best,get_pop_best
from glennopt.optimizers import NSGA3
# Generate the DOE
current_dir = os.getcwd(... | {"hexsha": "21e79aa63aad9182836ac9423f76ed6d498a22a7", "size": 3302, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/kur/serial/optimization_plot.py", "max_stars_repo_name": "kant/GlennOPT", "max_stars_repo_head_hexsha": "ca816c3708a2db5b98f8f1a7885305a8e18e179e", "max_stars_repo_licenses": ["NASA-1.3"], "m... |
#from .utils import try_gpu
import numpy as np
from itertools import combinations
import seaborn as sns
from scipy.spatial import distance as spdist
import tqdm
from torch_geometric.data import Data, Batch
import torch
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from rdkit.Che... | {"hexsha": "100615e6f0f0f6910a92f5a673230bb8d8e17dc6", "size": 13905, "ext": "py", "lang": "Python", "max_stars_repo_path": "magma/chemspace.py", "max_stars_repo_name": "manuflores/magma", "max_stars_repo_head_hexsha": "352e1c15bbbbb8e9b46337de5d91a142fd7c757d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 20 14:56:07 2020
@author: jenzyy
"""
import imageio
import matplotlib.pyplot as plt
import numpy as np
'''
# set wd
import os
os. chdir('./Documents/GitHub/Randomized-SVD/jennifer/watermark')
'''
# read in image
im = imageio.imread("rose.jpg")
#... | {"hexsha": "d9af2b30117303241b13ac1db64bb6ccd43b6008", "size": 1936, "ext": "py", "lang": "Python", "max_stars_repo_path": "jennifer/watermark.py", "max_stars_repo_name": "S-I-SVD/Randomized-SVD", "max_stars_repo_head_hexsha": "82108238a53c70938af87417f98aadc7f74b2a87", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import pandas as pd
import numpy as np
import tensorflow as tf
import dask
import scipy
import time
from functools import partial
from abc import ABCMeta, abstractmethod
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale
import FunctionalApproach
import plottingTools
c... | {"hexsha": "85d1220a76fb6b308513b625603e720c3cbb88e9", "size": 13327, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/FunctionalFwdApproach.py", "max_stars_repo_name": "mChataign/smileCompletion", "max_stars_repo_head_hexsha": "1bde2dd9fada2194c79cb3599bc9e9139cde6ee5", "max_stars_repo_licenses": ["BSD-3-Cl... |
import cv2 as cv
import const
import numpy as np
from graph_based import Graph
from matplotlib import pyplot as plt
def merge(a, b):
shape = a.shape
height = shape[0]
width = shape[1]
res = np.ones(shape)
for y in range(height):
for x in range(width):
if a[y, x] == 0 and b[y, ... | {"hexsha": "6e40f96e6afee4c4f969bb710d957acb06d19033", "size": 6860, "ext": "py", "lang": "Python", "max_stars_repo_path": "dummy.py", "max_stars_repo_name": "mecobalamine/crispy-octo-palm-tree", "max_stars_repo_head_hexsha": "dfcca865ccb1235083c9a4ab997e8a9334a21235", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
include("5.5.1 u (a+b arcsec(c x))^n.jl")
include("5.5.2 Miscellaneous inverse secant.jl")
| {"hexsha": "7496e500d5e27b705e609eb6aa9851be9a9f18c8", "size": 91, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/rules/5 Inverse trig functions/5.5 Inverse secant/.jl", "max_stars_repo_name": "gronniger/RubiSymbolics.jl", "max_stars_repo_head_hexsha": "dd117985dea699be7ddf14c3e6bdf4f407bb8da6", "max_stars_r... |
using LazySets
function spikingNeuron_specification()
# initial set in mode 1
X0_m1 = Hyperrectangle(low=[-65.0, -0.2], high=[-60.0, 0.2])
X0 = [(1, X0_m1)]
# time horizon: 100 time units
time_horizon = 100.0
# specification
O = Dict{Symbol, Any}(:T => time_horizon)
return X0, O
end
| {"hexsha": "cbf4113c97446501ccd4ef3060f75374f67f804a", "size": 320, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "models/SpikingNeuron/spikingNeuron_specifications.jl", "max_stars_repo_name": "JuliaReach/ReachabilityBenchmarks", "max_stars_repo_head_hexsha": "a7398cd9eb61f089caa5e9dbaf0914ba3da6bb02", "max_star... |
c
c Copyright (c) 2018, Lawrence Livermore National Security, LLC.
c Produced at the Lawrence Livermore National Laboratory
c
c Written by Jeffrey Banks banksj3@rpi.edu (Rensselaer Polytechnic Institute,
c Amos Eaton 301, 110 8th St., Troy, NY 12180); Jeffrey Hittinger
c hittinger1@llnl.gov, William Arrighi arrighi2@ll... | {"hexsha": "7d1f4991a9306e642ddd68879188988323148ad4", "size": 13248, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "MaxwellF.f", "max_stars_repo_name": "LLNL/LOKI", "max_stars_repo_head_hexsha": "5e3b875bc690e094fa0aaaec117fc523b11b7518", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_rep... |
########################################################################
### Kernel abstract class (with Normalization option)
########################################################################
from imports import *
from scipy.sparse.linalg import norm
from abc import abstractmethod, ABC
class Kernel(ABC):
... | {"hexsha": "921a8be9847c5b9ffd02cb30929197978ae3430c", "size": 1965, "ext": "py", "lang": "Python", "max_stars_repo_path": "kernels/kernel.py", "max_stars_repo_name": "AmineKheldouni/Kernel-in-Machine-Learning", "max_stars_repo_head_hexsha": "6d299cb8b1aab9f653b51baad1222cac8a2d28c5", "max_stars_repo_licenses": ["MIT"]... |
import torch.nn as nn
import torch
import numpy as np
from torch.autograd import Variable
import torch.nn.functional as F
class DCDHLoss(nn.Module):
def __init__(self, gamma, code_length, num_train):
super(DCDHLoss, self).__init__()
self.gamma = gamma
self.code_length = code_length
... | {"hexsha": "726e3aa9b93bc15e248d6db8c30835744d3c3d46", "size": 5061, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/dcdh_loss.py", "max_stars_repo_name": "DarrenZZhang/DCDH", "max_stars_repo_head_hexsha": "db526d50b8f8ba7d51fce6155e3ea1e6dda66283", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4,... |
import networkx as nx
from history import History
from transaction import Transaction
from data_operation import DataOperation
from history_query_builder import HistoryQueryBuilder
def serializable_or_not(hist):
conflicting_transactions = set()
operations = hist.schedule
for i in range(len(operations)... | {"hexsha": "e96319894b1d25a266b59e534f6a7bfa632c6c27", "size": 2126, "ext": "py", "lang": "Python", "max_stars_repo_path": "serializable_or_not.py", "max_stars_repo_name": "jpg013/CS5570-project", "max_stars_repo_head_hexsha": "e1817e3c1c77ec35a5605db23cd1f9e3ede8307a", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
subroutine sig_vals(s1,t1,p1,s2,t2,p2,sig1,sig2)
ccc
ccc
ccc
ccc DESCRIPTION : Computes the sigma values of two neighbouring
ccc bottles w.r.t. the mid pressure
ccc
ccc PRECISION : Double
ccc
ccc INPUT : s1,s2 bottle salinities
ccc t1,t... | {"hexsha": "d0f9b2f652e436fd27d5ca519ecd072ac6833fa3", "size": 1063, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "notebooks/FromBieito/pygamma-2172748e338d/src/sig-vals.f", "max_stars_repo_name": "ClaraCDouglas/net_community_production", "max_stars_repo_head_hexsha": "0b1370f00abc99cb4c08c9f84abe12faf781643d"... |
module precision_mod
implicit none
integer, parameter :: dp = selected_real_kind(15,100)
integer, parameter :: sp = selected_real_kind(6,30)
! --------------------------------
! use wp = sp for single precision
! use wp = dp for double precision
! -------------------------------... | {"hexsha": "94e04cd212d97bbd1fbccc1fbfa2da4925c7155b", "size": 5885, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "test/smoke/flang-325322/flang-325322.f90", "max_stars_repo_name": "raramakr/aomp", "max_stars_repo_head_hexsha": "9a224fe01ca8eff4209b8b79aa1fa15a18da65db", "max_stars_repo_licenses": ["Apache-2... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# @time : 2020/5/8 21:38
# @author : Mo
# @function: class of model predict of sequence-labeling
# 适配linux
import sys
import os
path_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path.append(path_root)
## cpu-gpu与tf.keras
# os.environ["CUDA... | {"hexsha": "ac436a6fb278c65f188130a0ac980840b4c77ce5", "size": 9899, "ext": "py", "lang": "Python", "max_stars_repo_path": "macadam/sl/s00_predict.py", "max_stars_repo_name": "ASJ161220001/Macadam", "max_stars_repo_head_hexsha": "5237381459db5909f392737e33618a16c1e0452a", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma component_antisym: "[| F \<le> G; G \<le> F |] ==> F = (G :: 'a program)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>F \<le> G; G \<le> F\<rbrakk> \<Longrightarrow> F = G
[PROOF STEP]
apply (simp (no_asm_use) add: component_eq_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \... | {"llama_tokens": 278, "file": null, "length": 3} |
[STATEMENT]
lemma intro_Let_refine[refine2]:
assumes "f x \<le> \<Down>R M'"
shows "Let x f \<le> \<Down>R M'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Let x f \<le> \<Down> R M'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f x \<le> \<Down> R M'
goal (1 subgoal):
1. Let x f \<le> \<D... | {"llama_tokens": 160, "file": "Refine_Monadic_Refine_Basic", "length": 2} |
# Table of Contents
<p><div class="lev1 toc-item"><a data-toc-modified-id="Exponentiality-of-the-lifetimes-distributions-1" href="#Exponentiality-of-the-lifetimes-distributions"><span class="toc-item-num">1 </span>Exponentiality of the lifetimes distributions</a></div><div class="lev2 toc-item"><a data-toc-... | {"hexsha": "1695fb3c825a8731ba1d122d97cebbc78b7e730b", "size": 100861, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "ala2-lag-time/from-syn-trj/tau_var/.ipynb_checkpoints/ala_expon-checkpoint.ipynb", "max_stars_repo_name": "lukas-stelzl/kinetics-remd", "max_stars_repo_head_hexsha": "b915729f7bc069... |
#include "config/ServerConfig.hpp" // IWYU pragma: associated
#include "log/Logger.hpp"
#include "storage/path.hpp"
#include <boost/asio.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/websocket.hpp>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <streambuf>
#include... | {"hexsha": "0c007cc9ed0a84ea706d8a62a38d9e489661cfa3", "size": 1250, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/config/ServerConfig.cpp", "max_stars_repo_name": "derofim/boost_server_example", "max_stars_repo_head_hexsha": "b524adbf842faa75fd5f5d46486dff605b96bfde", "max_stars_repo_licenses": ["BSD-2-Clau... |
"""
''Author'': Atsushi Yamagishi
''File Name'': ellison_sim.py
''License'': MIT license
I thank Daisuke Oyama for his guidance and helpful advice.
This program can simulate the stochastic evolution model raised
by G, Ellison(1993). The class of games this can handle
is a symmetric game with n strategies.
"""
from _... | {"hexsha": "25a5ec8eca28b952af85228b853983aec9fd3f72", "size": 8730, "ext": "py", "lang": "Python", "max_stars_repo_path": "ellison_sim.py", "max_stars_repo_name": "haru110jp/StochEvolution", "max_stars_repo_head_hexsha": "4207aa97cca2d7249b0be115f32202dbfaa9679c", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
from audioop import minmax
from math import prod
from mss.preprocessing.preprocesssing import MinMaxNormalizer
import numpy as np
import matplotlib.pyplot as plt
# from auto_encoder_vanilla import VariationalAutoEncoder
from mss.models.auto_encoder import AutoEncoder
from mss.models.atrain import load_fsdd
import libr... | {"hexsha": "06f4bca3b4a5cd857d196d310440e620c5bad4d0", "size": 1025, "ext": "py", "lang": "Python", "max_stars_repo_path": "mss/postprocessing/postprocessing.py", "max_stars_repo_name": "DiegoLigtenberg/Workspace-MasterThesis-MSS", "max_stars_repo_head_hexsha": "e8183031b6223051049f48e0da2bc2824e60239e", "max_stars_rep... |
import gym
import numpy as np
from gym import spaces
from gym.utils import seeding
class NavigationVel2DEnv(gym.Env):
"""2D navigation problems, as described in [1]. The code is adapted from
https://github.com/cbfinn/maml_rl/blob/9c8e2ebd741cb0c7b8bf2d040c4caeeb8e06cc95/maml_examples/point_env_randgoal.py
... | {"hexsha": "b602453eeeb7479291cccc392934a30be39b96ab", "size": 2509, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl/envs/navigation_vel.py", "max_stars_repo_name": "dkkim93/cavia", "max_stars_repo_head_hexsha": "d83f44b8443f4d202396b827e13eced2cfb40b11", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
function region = p00_region ( problem )
%*****************************************************************************80
%
%% P00_REGION returns the name of the integration region for any problem.
%
% Discussion:
%
% I thought I was going to use this idea a lot, but most of my test
% regions are boxes.
%
% ... | {"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/quadrature_test/p00_region.m"} |
module QRupdate
using LinearAlgebra
export qraddcol, qraddrow, qrdelcol, csne
"""
Add a column to a QR factorization without using Q.
`R = qraddcol(A,R,v)` adds the m-vector `v` to the QR factorization of the
m-by-n matrix `A` without using `Q`. On entry, `R` is a dense n-by-n upper
triangular matrix such that `R'... | {"hexsha": "ad162181fddc28d95cd017a7039a56edbd751066", "size": 4902, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/QRupdate.jl", "max_stars_repo_name": "mpf/QRupdate.jl", "max_stars_repo_head_hexsha": "a506e38b096788bfd028c4e61409719ddc05c22b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 8, "max_... |
from __future__ import print_function, division
import os
import cv2
import csv
import torch
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchv... | {"hexsha": "ed7a1ff1f015903d3c25b9ef34de129c80fe36fc", "size": 10989, "ext": "py", "lang": "Python", "max_stars_repo_path": "bateauxPosTf.py", "max_stars_repo_name": "Sup3Legacy/TIPE", "max_stars_repo_head_hexsha": "7e01cef869183c4d609c45d5fcf0bb371a9579f5", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count... |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2012 Desire Nuentsa Wakam <desire.nuentsa_wakam@inria.fr>
// Copyright (C) 2014 Gael Guennebaud <gael.guennebaud@inria.fr>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. ... | {"hexsha": "e1d01c4474bb161ad9e2b3e93b14a4a898e2aa5f", "size": 3098, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "A4-paper-sheet-detection-and-cropping/Header_files/eigen/test/sparseqr.cpp", "max_stars_repo_name": "satvik007/Scanner_OP", "max_stars_repo_head_hexsha": "c146f67e3851cd537d62989842abfee7d34de2c0", ... |
import numpy as np
from .sound_generator import SoundGenerator
class WaveTable(SoundGenerator):
def __init__(self, frame_rate, wave_table):
super().__init__(frame_rate)
self.wave_table = reshape_wave_table(wave_table)
def __iter__(self):
channels, frames = self.wave_table.shape
... | {"hexsha": "3895c61b31e6cd2b24dd7a80a393f15ee27da438", "size": 1117, "ext": "py", "lang": "Python", "max_stars_repo_path": "ratchet/generator/wave_table.py", "max_stars_repo_name": "bracket/ratchet", "max_stars_repo_head_hexsha": "48c139ca040fe8318a39b61889a2ae6772bd5200", "max_stars_repo_licenses": ["MIT"], "max_stars... |
module Core.FC
import Text.PrettyPrint.Prettyprinter
%default total
public export
FilePos : Type
FilePos = (Int, Int)
showPos : FilePos -> String
showPos (l, c) = show (l + 1) ++ ":" ++ show (c + 1)
public export
FileName : Type
FileName = String
||| A file context is a filename together with starting and ending ... | {"hexsha": "46d831e925afc6d25c9298c32fee5ee201121671", "size": 1781, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "idris2/src/Core/FC.idr", "max_stars_repo_name": "Qqwy/Idris2-Erlang", "max_stars_repo_head_hexsha": "945f9c12d315d73bfda2d441bc5f9f20696b5066", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
function is_orthogonal(S, tol=1e-6)
n = LinearAlgebra.checksquare(S)
for i in 1:n
for j in 1:n
if i != j
s = LinearAlgebra.dot(S[:, i], S[:, j])
if abs(s) > tol
return false
end
end
end
end
return... | {"hexsha": "1c3fe52d7172f397efd6825b6268888d4625273f", "size": 1496, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Certificate/Symmetry/utils.jl", "max_stars_repo_name": "jump-dev/SumOfSquares.jl", "max_stars_repo_head_hexsha": "c1350a7e7c910f542d4442c0869df502a555cfda", "max_stars_repo_licenses": ["MIT"], ... |
function [x, mx, sx] = standardise(x, dim, lim)
% STANDARDISE computes the zscore of a matrix along dimension dim
% has similar functionality as the stats-toolbox's zscore function
%
% Use as
% x = standardise(x, dim)
%
% See also ZSCORE
% Copyright (C) 2009, Jan-Mathijs Schoffelen
%
% This file is part of FieldTri... | {"author": "spm", "repo": "spm12", "sha": "3085dac00ac804adb190a7e82c6ef11866c8af02", "save_path": "github-repos/MATLAB/spm-spm12", "path": "github-repos/MATLAB/spm-spm12/spm12-3085dac00ac804adb190a7e82c6ef11866c8af02/external/fieldtrip/connectivity/private/standardise.m"} |
#!/usr/bin/env python3
import click
import os
import numpy as np
from collections import defaultdict
from itertools import chain
from scipy.spatial.distance import cosine
from scipy.stats import spearmanr
from tqdm import trange
from wikipedia2vec import Wikipedia2Vec
KORE_CATEGORIES = {
'it_companies': ['Apple I... | {"hexsha": "c0a539e0048e2e02268b47c9bd49e6e832b0e1ac", "size": 8324, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/intrinsic_eval.py", "max_stars_repo_name": "mattolson93/wikipedia2vec", "max_stars_repo_head_hexsha": "89d14e89d21bca05d4f81d2733a672aee3f0abce", "max_stars_repo_licenses": ["Apache-2.0"],... |
#!python
import yaml, argparse
import numpy as NP
from astropy.io import ascii, fits
from astropy.coordinates import SkyCoord
from astropy import units as U
from astroutils import geometry as GEOM
from astroutils import nonmathops as NMO
import astroutils
astroutils_path = astroutils.__path__[0]+'/'
if __name__ == '... | {"hexsha": "71180bf4f20f1129854187719146cc6f1e48b2e7", "size": 8863, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/match_catalogs.py", "max_stars_repo_name": "nithyanandan/AstroUtils", "max_stars_repo_head_hexsha": "97473f52d4247bb9c8507598899215d0662e8d6f", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# Copyright 2020 Jaime Tierney, Adam Luchies, and Brett Byram
# 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... | {"hexsha": "1cf3a9b7ef8149bb20568e70ab23d5e2e4232a7e", "size": 5928, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/trainer.py", "max_stars_repo_name": "VU-BEAM-Lab/DNNBeamforming", "max_stars_repo_head_hexsha": "e8ee8c1e57188a795816b119279ac2e60e5c5236", "max_stars_repo_licenses": ["Apache-2.0"], "max_star... |
% EEGTHRESH - reject trials with out-of-bounds channel values within a
% specified epoch time range.
%
% Usage:
% >> [Iin, Iout, newsignal, elec] = eegthresh( signal, frames, ...
% elecs, negthresh, posthresh, timerange, starttime,endtime);
%
% Required inputs:
% signal - 2-D data... | {"author": "sccn", "repo": "eeglab", "sha": "36d3982a63cde83fb279ab465b7a026ec2807c0a", "save_path": "github-repos/MATLAB/sccn-eeglab", "path": "github-repos/MATLAB/sccn-eeglab/eeglab-36d3982a63cde83fb279ab465b7a026ec2807c0a/functions/sigprocfunc/eegthresh.m"} |
#include <boost/hana/fwd/repeat.hpp>
| {"hexsha": "02623d16682218b74dfeb1c85af254ce4a71db2d", "size": 37, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_hana_fwd_repeat.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0"], "m... |
'''
Doe (c) University of Manchester 2015
Doe is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: Pablo Carbonell
@description: SYNBIOCHEM design of experiments
'''
from os import path, mkdir, system, unlink
import shutil, glob
import sys, re
impo... | {"hexsha": "74acd7b6f11ba2887a48bf3807fd957602547f5e", "size": 32266, "ext": "py", "lang": "Python", "max_stars_repo_path": "doe.py", "max_stars_repo_name": "pablocarb/sbc-doe", "max_stars_repo_head_hexsha": "3467a42765bae03aedfd24924e4c18213753d27a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
function fwd_prop(X::Array{Float64,1},
nodes::Int64,
hidden_layer::Int64,
z,
layer,
layer_p1)
# number of used weights
j = 0
# number of covariates
D = length(X)
# build first hidden layer
for node in 1:n... | {"hexsha": "40f74da609a38ca4e9b06079b5587d6a8b6d52bf", "size": 868, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/propagate.jl", "max_stars_repo_name": "jacobcvt12/BayesNN", "max_stars_repo_head_hexsha": "267a62d56b403deb586d630a8289f076f54e9064", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
import os
import json
import pandas as pd
import numpy as np
import tensorflow as tf
from utils.progress import WorkSplitter
from utils.optimizers import Optimizer
from utils.modelnames import models
from utils.functions import get_attention_example_items, write_latex, read_template
from plots.rec_plots import multi_mo... | {"hexsha": "17aa5813b3d204725aa63ff78a9aa61db2f31911", "size": 5212, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiment/attention.py", "max_stars_repo_name": "wuga214/MultiModesPreferenceEstimation", "max_stars_repo_head_hexsha": "f80c2feb196cb498a8b417f2037aadad151cceb3", "max_stars_repo_licenses": ["MI... |
# Copyright 2021 IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.0
# 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 ... | {"hexsha": "6a84a10b6da79e33b278916ac6e95f4ae34757d8", "size": 6125, "ext": "py", "lang": "Python", "max_stars_repo_path": "generate_figure_4ab.py", "max_stars_repo_name": "ewoutvandenberg/Quantum-phase-estimation", "max_stars_repo_head_hexsha": "035a55a00ba24ae82e2d892cedbdffc36b52aa06", "max_stars_repo_licenses": ["A... |
# Copyright (c) 2020 PaddlePaddle 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": "3d4b2dc10c2b6fbec804a5982a356a0f9c0064d8", "size": 3180, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/paddle/fluid/tests/unittests/ir/inference/test_trt_inspector.py", "max_stars_repo_name": "ZibinGuo/Paddle", "max_stars_repo_head_hexsha": "6e0892312de5e4ba76d980ff0e4322ac55ca0d07", "max_st... |
import networkx as nx
inputs = open('input.txt').read().split()
inputs = list(map(lambda _: _.split(')'), inputs))
orbits = nx.DiGraph()
orbits.add_edges_from(inputs)
print(sum(nx.shortest_path_length(orbits, source='COM', target=node) for node in orbits.nodes))
#########################
start = set(nx.shortest_pat... | {"hexsha": "72c04fcf75746ffedd19e19eb5718f7abbaf2919", "size": 497, "ext": "py", "lang": "Python", "max_stars_repo_path": "6-Universal_Orbit_Map.py", "max_stars_repo_name": "minhoryang/advent-of-code-2019", "max_stars_repo_head_hexsha": "f5b468ce583a14548346f8e415d6b05589ec564f", "max_stars_repo_licenses": ["MIT"], "ma... |
import os
import psycopg2
import logging
import numpy as np
import pandas as pd
import multiprocessing as mp
from multiprocessing.pool import ThreadPool
from ibmfl.data.data_handler import DataHandler
from ibmfl.util.datasets import load_mnist
logger = logging.getLogger(__name__)
def get_value_or_0(rows, patientId... | {"hexsha": "405d3832e3ac86427bdda5d39be9bbf07ca4a12c", "size": 13322, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/PHR/data/sofa_postgresql_data_handler.py", "max_stars_repo_name": "imec-int/federated-learning-lib", "max_stars_repo_head_hexsha": "1b2dc964de01cd23f357edbce7527ec1bcfc2cd3", "max_stars_... |
import numpy as np
from random import randint,random
import math
global H_feature,H_label,H_featureS,H_feature_lable
H_feature={}
H_label={}
H_feature_lable={}
H_featureS={}
global feature_item,label_num
feature_item=1449
label_num=45
def read_sparse_arff(f_path, xml_path):
global feature_item
f = open(f_p... | {"hexsha": "4275f07552c75b19559f3a6c8dd51df09e45fd23", "size": 13423, "ext": "py", "lang": "Python", "max_stars_repo_path": "Experiment_enron_medical/medical_GSEMO.py", "max_stars_repo_name": "Danxuan-Liu/diversification-code", "max_stars_repo_head_hexsha": "53a2e0216e731d7d693086b81e32e2a61b322b4e", "max_stars_repo_li... |
from vicero.algorithms.qlearning import Qlearning
import numpy as np
# DynaQ is an algorithm that is very similar to
# classical tabular Q-learning, with the one difference being that it
# keeps an internal model that simulates the consequences of actions
# based entirely on experience
# More details: S&B18 Chapter 8... | {"hexsha": "9e238beb352a053439714de7f662ca6d69dd851b", "size": 1443, "ext": "py", "lang": "Python", "max_stars_repo_path": "vicero/algorithms/dynaq.py", "max_stars_repo_name": "Jontahan/vicero", "max_stars_repo_head_hexsha": "678f4f139788cb9be149f6d9651d93ca737aeccd", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.