text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
import numpy as np import matplotlib.pyplot as plt from scipy.constants import gravitational_constant as G from scipy.integrate import odeint def star_positions_at(time, omega, r): angle = omega*time x1 = np.array([r*np.cos(angle), r*np.sin(angle)]) second_angle = angle + np.pi # on the otherside x2 = ...
{"hexsha": "a878b5d026f2c7c04ccecfb322859c86e95c8ded", "size": 3318, "ext": "py", "lang": "Python", "max_stars_repo_path": "r3bp.py", "max_stars_repo_name": "cosmo-jana/numerics-physics-stuff", "max_stars_repo_head_hexsha": "f5fb35c00c84ca713877e20c1d8186e76883cd28", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import logging import numpy as np from luna.radiology.mirp.imageProcess import crop_image, get_supervoxels, get_supervoxel_overlap from luna.radiology.mirp.utilities import extract_roi_names def rotate_image(img_obj, settings=None, rot_angle=None, roi_list=None): """ Rotation of image and rois """ if setti...
{"hexsha": "b8018a4305fb0626d8c02d374f16e073b296ec4a", "size": 9398, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyluna-radiology/luna/radiology/mirp/imagePerturbations.py", "max_stars_repo_name": "msk-mind/data-processing", "max_stars_repo_head_hexsha": "c016d218da2eca003d06b96f2c03f16b3ce97873", "max_stars...
-- Challenge 229 Hard In Idris -- | Reverses a number reverse : Integer -> Integer reverse = cast . reverse . show solution : Integer -> Integer solution max = solution' 0 0 where solution' : Integer -> Integer -> Integer solution' n sum = if nextN > max then sum else s...
{"hexsha": "4208f78bc0abf13feeb0967566a4fbf5c919c117", "size": 569, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "Difficult/Challenge229/Challenge229.idr", "max_stars_repo_name": "RossMeikleham/DailyProgrammer", "max_stars_repo_head_hexsha": "1520436e57589c2da8bbdfa1cb732cd0948371f2", "max_stars_repo_licenses"...
import os import shutil import numpy as np import numpy.matlib as matl import torch from sklearn.cluster import KMeans from sklearn.metrics import pairwise_distances from torchvision import transforms from tqdm import tqdm class AverageMeter(object): """Computes and stores the average and current value""" d...
{"hexsha": "f56eae26abb27ccbc9815658357dc9d4edd6accf", "size": 5482, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepml/utils/libs.py", "max_stars_repo_name": "bacnguyencong/Deep-metric-learning", "max_stars_repo_head_hexsha": "cac570966e3af0be3c90df9123af552216827322", "max_stars_repo_licenses": ["MIT"], "m...
import torch import torch.utils.data import torch.cuda import torch.backends.cudnn import random import numpy as np from typing import Optional def fix(offset: int = 0, fix_cudnn: bool = True): random.seed(0x12345678 + offset) torch.manual_seed(0x0DABA52 + offset) torch.cuda.manual_seed(0x0DABA52 + 1 + of...
{"hexsha": "04bc30840486f98829e293c4cbc992559b587672", "size": 809, "ext": "py", "lang": "Python", "max_stars_repo_path": "framework/utils/seed.py", "max_stars_repo_name": "lukovnikov/transformer_generalization", "max_stars_repo_head_hexsha": "a538bfbba6877cd7a21e710f2535df2e9236ba52", "max_stars_repo_licenses": ["MIT"...
export iauPn00 """ Precession-nutation, IAU 2000 model: a multi-purpose function, supporting classical (equinox-based) use directly and CIO-based use indirectly. This function is part of the International Astronomical Union's SOFA (Standards Of Fundamental Astronomy) software collection. Status: support function. ...
{"hexsha": "8bd8be9198d7a64485f498b91790be0d28ce0dd1", "size": 4757, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/pn00.jl", "max_stars_repo_name": "UnofficialJuliaMirror/SOFA.jl-ad3d3fd0-b5f2-51ee-b274-8cdbe62317e2", "max_stars_repo_head_hexsha": "528ba57a011551cac11c62712e69d03da6bebdef", "max_stars_repo_...
%%% PLEASE RUN A SPELL CHECKER BEFORE COMMITTING YOUR CHANGES! %%% PLEASE RUN A SPELL CHECKER BEFORE COMMITTING YOUR CHANGES! %%% PLEASE RUN A SPELL CHECKER BEFORE COMMITTING YOUR CHANGES! %%% PLEASE RUN A SPELL CHECKER BEFORE COMMITTING YOUR CHANGES! %%% PLEASE RUN A SPELL CHECKER BEFORE COMMI...
{"hexsha": "4b25800b2a2122a11f8a280e4470cbe1d1286b7f", "size": 38531, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/version-history/8-4.history.tex", "max_stars_repo_name": "kurhula/HTCondor", "max_stars_repo_head_hexsha": "457d077e91900cd899b6254c4f0c8f582a70d0ea", "max_stars_repo_licenses": ["Apache-2.0"],...
import numpy as np import random as rand # given a length n, # return a random binary vector def secretVector(n): x = np.zeros(n, dtype = int) for i in range(0, len(x) - 1): r = rand.uniform(0, 1) if r < 0.5: x[i] = 0 else: x[i] = 1 return x # g...
{"hexsha": "af58ea3c6ee3fa708f6e9a07aa0222acf781926e", "size": 949, "ext": "py", "lang": "Python", "max_stars_repo_path": "attackUtils.py", "max_stars_repo_name": "johncmerfeld/BUCS_dataPrivacy", "max_stars_repo_head_hexsha": "788cb17fc0cef8135cdb2366526af00bc36c735b", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
# Copyright (c) 2018, Curious AI Ltd. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain View...
{"hexsha": "8254d5c9cc751e430e883aabc02e5ca0b0f8e30e", "size": 5143, "ext": "py", "lang": "Python", "max_stars_repo_path": "ImbalancedSelfPU/mean_teacher/data.py", "max_stars_repo_name": "JSchweisthal/Positive-and-Unlabeled-Learning-from-Imbalanced-Data", "max_stars_repo_head_hexsha": "82e193842e4f6a7b4a0ef476f1104944e...
import numpy as np import os import sys from data_utils.prepare_dialogue_data import read_total_embeddings def read_response_file(file_name, word2id): #word_unk = "</s>" word_unk = "<unk>" word_unk_id = word2id[word_unk] f = open(file_name, "r", encoding="utf-8") response_data = [] for line ...
{"hexsha": "89622a725373a2ddfc7994c8ea1085908243b68c", "size": 5062, "ext": "py", "lang": "Python", "max_stars_repo_path": "metrics.py", "max_stars_repo_name": "AnonymousCIKM2021-2518/SAEDS", "max_stars_repo_head_hexsha": "165d081f6aacdefe16f5d04683c00d2ecd2b6a31", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import torch import torch.nn as nn import numpy as np import warnings warnings.filterwarnings("ignore") torch.backends.cudnn.benchmark = True def test(args, encoder, decoder, x, prev_hidden_temporal_list): """ Runs forward, computes loss and (if train mode) updates parameters for the provided batch of in...
{"hexsha": "9fdf578e7cc43f2809fc70a5c85ccde1896719e0", "size": 5120, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/test.py", "max_stars_repo_name": "luuckiest/rvos", "max_stars_repo_head_hexsha": "f42a679c639270660201df687b04ff1c3e7a171f", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 294...
# Run tests on functions in src/by_reference_doc/tracks.jl using Spotify.Tracks @testset verbose = true "GET-request endpoints for tracks" begin track_id = SpId() @test ~isempty(tracks_get_audio_analysis(track_id)[1]) @test ~isempty(tracks_get_audio_features(track_id)[1]) # Cycle through different...
{"hexsha": "829a07ba83e5d408120422a64db09d607f3418b9", "size": 850, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_tracks.jl", "max_stars_repo_name": "vnegi10/Spotify.jl", "max_stars_repo_head_hexsha": "fe93096d8871f385acf955888dfcd4af41f075e1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6,...
# Imports import typhoon.api.hil as hil from tests.utils import psim_export_netxml from typhoon.api.schematic_editor import model from typhoon.test.capture import start_capture, get_capture_results import pytest import typhoon.test.signals as sig from typhoon.test.ranges import around import numpy as np import os from ...
{"hexsha": "98b75d4526a4bfc0215594c406fc3c29b1ba7754", "size": 3080, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_switching_components/test_mosfet/test_mosfet.py", "max_stars_repo_name": "typhoon-hil/schematic-converter", "max_stars_repo_head_hexsha": "86846ca0851c0a7c814f414eed52bd6b41da9921", "ma...
import importlib import sys import os import pylbm import pytest import numpy as np path = os.path.dirname(__file__) + '/../demo/3D' path = os.path.abspath(path) @pytest.fixture def test3D_case_dir(): sys.path.append(path) yield sys.path.pop() @pytest.mark.slow @pytest.mark.h5diff(single_reference=True)...
{"hexsha": "0df35e49d4143c943ed7cf750eaf88499e8e9fcf", "size": 1137, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_demo_3d.py", "max_stars_repo_name": "bgraille/pylbm", "max_stars_repo_head_hexsha": "fd4419933e05b85be364232fddedfcb4f7275e1f", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c...
Base.@deprecate contiguous_view ContiguousView Base.@deprecate strided_view StridedView Base.@deprecate unsafe_view unsafe_aview Base.@deprecate view aview
{"hexsha": "4935593e1acdbb1c39de650306c704c800bb045c", "size": 156, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/deprecates.jl", "max_stars_repo_name": "goretkin/ArrayViews.jl", "max_stars_repo_head_hexsha": "d32696431d85648cc5885440a6b45b8cdf23a334", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
# Author: Moises Henrique Pereira # this class handles to train models and give the corresponding prediction from numpy.lib.arraysetops import isin from sklearn.ensemble import RandomForestClassifier from sklearn.ensemble import IsolationForest from .CounterfactualEngineEnums import CounterfactualEngineEnums class C...
{"hexsha": "b912c1262fd3f27df93f0b069ce87b246898ed93", "size": 2091, "ext": "py", "lang": "Python", "max_stars_repo_path": "ui/CounterfactualEngine/CounterfactualEngine.py", "max_stars_repo_name": "MoisesHenr/OCEAN", "max_stars_repo_head_hexsha": "e99c853893adc89652794ace62fcc8ffa78aa7ac", "max_stars_repo_licenses": ["...
[STATEMENT] lemma nth_w2p: "bit ((2::'a::len word) ^ n) m \<longleftrightarrow> m = n \<and> m < LENGTH('a::len)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. bit (2 ^ n) m = (m = n \<and> m < LENGTH('a)) [PROOF STEP] by transfer (auto simp add: bit_exp_iff)
{"llama_tokens": 120, "file": "Word_Lib_More_Word", "length": 1}
import numpy as np import torch import numpy.linalg as linalg import scipy.stats as stats import pickle from sys import exit import argparse import os parser = argparse.ArgumentParser() parser.add_argument("--m", type = int, default = 20) parser.add_argument("--n", type = int, default = 40) parser.add_argument("--K", ...
{"hexsha": "5c58402951c7eeea9272ab2b99fc664756a2821a", "size": 1135, "ext": "py", "lang": "Python", "max_stars_repo_path": "Bayesian_lasso_svd_mi/normal_distributed_noise/script/simulate_data.py", "max_stars_repo_name": "RuoshuiAqua/Bayesian_SVD_MI", "max_stars_repo_head_hexsha": "4b221ca86d909ba8a9f54bdda65c90045f10e9...
function b = r8mat_gesl ( a, n, pivot, b, job ) %*****************************************************************************80 % %% R8MAT_GESL solves a system factored by R8MAT_GEFA. % % Discussion: % % This is a simplified version of the LINPACK routine DGESL. % % Licensing: % % This code is distributed und...
{"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/test_mat/r8mat_gesl.m"}
[STATEMENT] lemma dg_Funct_is_arrI: assumes "\<NN> : \<FF> \<mapsto>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>" shows "ntcf_arrow \<NN> : cf_map \<FF> \<mapsto>\<^bsub>dg_Funct \<alpha> \<AA> \<BB>\<^esub> cf_map \<GG>" [P...
{"llama_tokens": 1688, "file": "CZH_Elementary_Categories_czh_ecategories_CZH_DG_FUNCT", "length": 10}
module debspkg # Write your package code here. using ForwardDiff include("extra_file.jl") export f,derivative_of_f1 end
{"hexsha": "e27193ff788d31c2773c1d82d3b3b726646a5a53", "size": 124, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/debspkg.jl", "max_stars_repo_name": "krishna-vasudev/debspkg.jl", "max_stars_repo_head_hexsha": "dd788f253bd965bdadd0c28cf22c37f18011bf6e", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
{"hexsha": "76d45a170bb770804bf2b109cac027aa88a33202", "size": 37639, "ext": "py", "lang": "Python", "max_stars_repo_path": "improver_tests/synthetic_data/test_set_up_test_cubes.py", "max_stars_repo_name": "cpelley/improver", "max_stars_repo_head_hexsha": "ebf77fe2adc85ed7aec74c26671872a2e4388ded", "max_stars_repo_lice...
# 2-level system with oscillating detuning ## Imports Start by importing the necessary packages ```python %load_ext autoreload %autoreload 2 import joblib import matplotlib.pyplot as plt from matplotlib import animation from mpl_toolkits.mplot3d import Axes3D plt.style.use("ggplot") import numpy as np import qutip ...
{"hexsha": "3d8f8f6c9c1a26400ea279d66bee4c0a6c5d4040", "size": 248506, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "examples/Two-level system with oscillating detuning - no RWA.ipynb", "max_stars_repo_name": "otimgren/toy-systems", "max_stars_repo_head_hexsha": "017184e26ad19eb8497af7e7e4f3e7bb81...
from math import log, sqrt import numpy as np class MCTSNode: def __init__(self, parent, action, player, numberOfAgents): self.parent = parent self.action = action self.children = [] self.explored_children = 0 self.visits = 0 self.value = np.zeros(numberOfA...
{"hexsha": "32ca34e5c16907d1f17192eacc6bb5cc70239cfa", "size": 487, "ext": "py", "lang": "Python", "max_stars_repo_path": "game_logic/mcts_util.py", "max_stars_repo_name": "matiasmv/MultiAgentes2020", "max_stars_repo_head_hexsha": "1c25216a077fd62491b16a533332866817242a25", "max_stars_repo_licenses": ["MIT"], "max_star...
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #include <gtest/gtest.h> #include <boost/uuid/random_generator.hpp> #include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid_io.hpp> #include <boost/variant.hpp> #include "backend/protobuf/query_responses/proto_query_r...
{"hexsha": "28282fe6d47eff9c34e05e08f03782f8a7be0338", "size": 5721, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/regression/regression_test.cpp", "max_stars_repo_name": "iceseer/iroha", "max_stars_repo_head_hexsha": "4a68cd50c24c8922dded85ee28872e07f636b32f", "max_stars_repo_licenses": ["Apache-2.0"], "ma...
push!(LOAD_PATH, "/Users/eroesch/Documents/phd/neural-ode/") using Flux, DiffEqFlux, DifferentialEquations, Plots ## Setup ODE to optimize function lotka_volterra(du,u,p,t) x, y = u α, β, δ, γ = p du[1] = dx = α*x - β*x*y du[2] = dy = -δ*y + γ*x*y end u0 = [1.0,1.0] tspan = (0.0,10.0) p = [1.5,1.0,3.0,1.0] pro...
{"hexsha": "36e5d965be7e2098d42d07e891766972ef4a5282", "size": 1320, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "other/diffeq/lis_two_stage.jl", "max_stars_repo_name": "LislPisl/model-zoo", "max_stars_repo_head_hexsha": "e0684ddcf027d9509461fc1024ee53327fb6a65d", "max_stars_repo_licenses": ["MIT"], "max_stars...
""" twomotors.py Run two motors with a sinusoidal speed input. This example is an extension of `motor_one.py`. Its purpose is to show how to use list comprehensions to access and run the two motors. Note also that the current time (`tcurr`) will have different values for each motor. Using the correct time stamp for ...
{"hexsha": "e9ea500f8514c0482330389180acf21f1fcba796", "size": 2012, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/twomotors.py", "max_stars_repo_name": "EduardoNigro/pyev3", "max_stars_repo_head_hexsha": "dbb84a3eee85b6733014ef9a54e5f2270f5ef6a6", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
%%%%%%%%%%%%%%%%%%%%%definitions%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \input{../../doc/related_pages/header.tex} \input{../../doc/related_pages/newcommands.tex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%DOCUMENT%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \title{ The full-F electromagnetic model in toroidal geometr...
{"hexsha": "6ced081c16ddb68f04a078e9d795d4265bdaf34a", "size": 96116, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "src/feltor/feltor.tex", "max_stars_repo_name": "RaulGerru/FELTOR_Raul", "max_stars_repo_head_hexsha": "a566f8a9003ade437e093334877f839f3dfd0260", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
@testset "Genus" begin Qx, x = FlintQQ["x"] K, a = NumberField(x - 1, "a", cached = false) OK = maximal_order(K) rlp = real_places(K) sig = Dict(rlp[1] => 2) p2 = prime_decomposition(OK, 2)[1][1] p3 = prime_decomposition(OK, 3)[1][1] p5 = prime_decomposition(OK, 5)[1][1] @test length(Hecke.local_gen...
{"hexsha": "450651b268237933e6b7261534a74e75b6e44b82", "size": 1976, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/QuadForm/Quad/Genus.jl", "max_stars_repo_name": "tthsqe12/Hecke.jl", "max_stars_repo_head_hexsha": "ced5350865aeaaa471a42f0300b1a7c459a73f09", "max_stars_repo_licenses": ["BSD-2-Clause"], "max...
#!/usr/bin/env python """ pyOpt_objective Holds the representation of a pyOptSparse objective Copyright (c) 2008-2013 by pyOpt Developers All rights reserved. Developers: ----------- - Dr. Gaetan K.W. Kenway (GKK) History ------- v. 1.0 - Initial Class Creation (GKK, 2013) """ import numpy # ==================...
{"hexsha": "2dfd8d27374f815a4a39a31df64553aef2eba15f", "size": 1278, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyoptsparse/pyOpt_objective.py", "max_stars_repo_name": "robfalck/pyoptsparse", "max_stars_repo_head_hexsha": "c99f4bfe8961492d0a1879f9ecff7a2fbb3c8c1d", "max_stars_repo_licenses": ["CNRI-Python"]...
import holoviews as hv import numpy as np import param # from ...models import Interface from ..abstract_plot_models import InterfacePlottingBase class GeneCountOverTime(InterfacePlottingBase): """ For each treatment group: + Curve: mean / median / trend + Points: given by count_variable. ...
{"hexsha": "af40c722dd21f9350c8589162531fdce66c04fe8", "size": 6228, "ext": "py", "lang": "Python", "max_stars_repo_path": "GSForge/plots/gem/_gene_count_vs_time.py", "max_stars_repo_name": "SystemsGenetics/GEMprospector", "max_stars_repo_head_hexsha": "7c5c7f5003a4b12feffe8d94325da96d53cc17f6", "max_stars_repo_license...
import sys import numpy as np from scipy.stats import multivariate_normal sys.path.append('./../../') from src.HMC.hmcparameter import HMCParameter class VelParam(HMCParameter): """ This class implements a velocity parameter for an HMC parameter, with a Gaussian distribution. """ def __init__(self, ...
{"hexsha": "5eb27ea62a63d14de5fa20f0e224c40aae5a5b54", "size": 1286, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/FullModel/vel_param.py", "max_stars_repo_name": "noashin/local_global_attention_model", "max_stars_repo_head_hexsha": "531e6a4cc1dc364a6a4168de1b9f972727a8aeb1", "max_stars_repo_licenses": ["M...
from typing import List import spacy nlp = spacy.load("en_core_web_sm") # example text # text = """First of all, my obvious answer is Grave of The Fireflies. The emotional labor--no thank you. Second of all, the less obvious answer is A Whisker Away, because it was so well-made and relatable in my opinion that I was c...
{"hexsha": "82d160810f4be004cb5948112bd56865d44387ff", "size": 4938, "ext": "py", "lang": "Python", "max_stars_repo_path": "entity_recognition.py", "max_stars_repo_name": "singinzrain/codechella-spoiler-detection", "max_stars_repo_head_hexsha": "acc3339a91e0e36a5a761bc2bc4d20d132074fd8", "max_stars_repo_licenses": ["Ap...
import numpy as np import pandas as pd class Dictionary: def __init__(self, dict_dir): ''' Hash Table or dict() ''' self.data = pd.read_csv(dict_dir, encoding="UTF8") print("Building Dictionary from ", dict_dir) self._word2idx = {} self._idx2word = {} ...
{"hexsha": "af01e2d3443cefe1509d8d575bfcd9d351828e93", "size": 1594, "ext": "py", "lang": "Python", "max_stars_repo_path": "law/dictionary.py", "max_stars_repo_name": "Evangeline98/Legal-AI", "max_stars_repo_head_hexsha": "4d6e01e7956f2f1940f803bc7c9599581a992a2d", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import contextlib import datetime import io import json import logging import numpy as np import os import shutil import pycocotools.mask as mask_util from fvcore.common.timer import Timer from iopath.common.file_io import file_lock from PIL import Image import glob import pdb from pathlib import Path from detectron2....
{"hexsha": "cc78e49393997e5cf67491e076333f3f2f2e5776", "size": 5192, "ext": "py", "lang": "Python", "max_stars_repo_path": "detectron2/data/datasets/tdw_playroom.py", "max_stars_repo_name": "honglin-chen/detectron2_panoptic_deeplab", "max_stars_repo_head_hexsha": "9e31751a3dbd3a1223fb6fed11cec7800ab5b4ea", "max_stars_r...
#!/usr/bin/env python import os, sys import logging import subprocess import shutil from setuptools import setup, find_packages #from setuptools.command.build_py import build_py #from setuptools.extension import Extension #import numpy as np #from Cython.Build import cythonize #import cmake # Set up the logging...
{"hexsha": "5a6c490debe9aedceb157fb95242bfeaae6bec2d", "size": 2953, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "paul-krug/Target-Approximation-Model", "max_stars_repo_head_hexsha": "17406423ba45a4b001661b0364023ce8b5b78fbc", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
# -*- coding: utf-8 -*- import astropy.units as u import matplotlib.pyplot as plt import numpy as np import pandas as pd from astropy.units import cds from sloscillations import generate_data cds.enable() if __name__=="__main__": metadata = pd.read_csv('metadata.csv') dat = generate_data....
{"hexsha": "a27ae86eb19168834acec6a3478a6887f1c2480e", "size": 588, "ext": "py", "lang": "Python", "max_stars_repo_path": "sloscillations/tests/test_datagen.py", "max_stars_repo_name": "jsk389/RGB-PowerSpectra-v2", "max_stars_repo_head_hexsha": "47ca7cae256ad09a7e5a40fe9da82d48c32ff7cc", "max_stars_repo_licenses": ["MI...
import rdkit import rdkit.Chem as Chem import numpy as np import random elem_list = ['C', 'N', 'O', 'S', 'F', 'Si', 'P', 'Cl', 'Br', 'Mg', 'Na', 'Ca', 'Fe', 'As', 'Al', 'I', 'B', 'V', 'K', 'Tl', 'Yb', 'Sb', 'Sn', 'Ag', 'Pd', 'Co', 'Se', 'Ti', 'Zn', 'H', 'Li', 'Ge', 'Cu', 'Au', 'Ni', 'Cd', 'In', 'Mn', 'Zr', 'Cr', 'Pt',...
{"hexsha": "2970eac8c0105d16dd6a88e987ecaa05d540f5df", "size": 15329, "ext": "py", "lang": "Python", "max_stars_repo_path": "USPTO-15K/rank-diff-wln/mol_graph.py", "max_stars_repo_name": "wengong-jin/nips17-rexgen", "max_stars_repo_head_hexsha": "fb7dea369b0721b88cd0133a7d66348d244f65d3", "max_stars_repo_licenses": ["M...
import os, cv2 import numpy as np from .utils import normalize from typing import Tuple, Dict def dividir_dataset_em_treinamento_e_teste(dataset: np.ndarray, divisao=(80,20)): """ Divisão representa a porcentagem entre conj. de treinamento e conj. de teste. Ex: (80,20) representa 80% para treino e 20% para...
{"hexsha": "e774b5def425d232e18e62416736614348ac3bb7", "size": 3990, "ext": "py", "lang": "Python", "max_stars_repo_path": "denoising/pre_processing.py", "max_stars_repo_name": "darlannakamura/denoising-dbt", "max_stars_repo_head_hexsha": "19171cda784b1b4beb1c8fb030102b8b8e98e27b", "max_stars_repo_licenses": ["MIT"], "...
"""Constraints module. Classes for constraints and lists of constraints. """ import numpy as np import casadi as cs from enum import Enum from safe_control_gym.envs.benchmark_env import BenchmarkEnv class ConstrainedVariableType(str, Enum): """Allowable constraint type specifiers. """ STATE = 'STATE...
{"hexsha": "e5e4ece62ac543b619da4fc026544d592ff67e35", "size": 21862, "ext": "py", "lang": "Python", "max_stars_repo_path": "safe_control_gym/envs/constraints.py", "max_stars_repo_name": "gokhanalcan/safe-control-gym", "max_stars_repo_head_hexsha": "e9086e102663a60a66f2cc9c8cd7610888744056", "max_stars_repo_licenses": ...
/* Classes for Boost.Flyweight key-value tests. * * Copyright 2006-2009 Joaquin M Lopez Munoz. * 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/flyweight for library home page...
{"hexsha": "11a97d0e99593db88c82c10cb4dad33403fc529f", "size": 2800, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "boost/libs/flyweight/test/heavy_objects.hpp", "max_stars_repo_name": "randolphwong/mcsema", "max_stars_repo_head_hexsha": "eb5b376736e7f57ff0a61f7e4e5a436bbb874720", "max_stars_repo_licenses": ["BSD...
SUBROUTINE readsrc(srcfile,iexit) !------------------------------------------------------------- ! ! Reads the source maps based on the format = 0/1 ! !------------------------------------------------------------- USE invar USE totvar IMPLICIT NONE INTEGER, INTENT(INOUT) :: iexit INTEGER :: form, a, ni, i, j, g, xs, ...
{"hexsha": "09d77455ccb2e5838048365d0e6269c2dda8d79a", "size": 2227, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "variations-old/anisdd-2d/readsrc.f90", "max_stars_repo_name": "lanl/pidots", "max_stars_repo_head_hexsha": "9b1bf717337ce84ea20b82cfb358eadb04532d6c", "max_stars_repo_licenses": ["BSD-3-Clause"]...
#!/usr/bin/env python # coding: utf-8 # Render metrics graphs import csv import logging import os import glob import socket from argparse import ArgumentParser from collections import defaultdict import matplotlib.pyplot as plt import matplotlib.ticker as mtick import numpy as np import torch from mpl_toolkits.axe...
{"hexsha": "c775a86cbabb3cc785e614a537a1a8c928065c22", "size": 7389, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/create_metric_graphs.py", "max_stars_repo_name": "TomFrederik/grok", "max_stars_repo_head_hexsha": "dee13b05ad60c097c90ddfdb4a61eaa33df312b7", "max_stars_repo_licenses": ["MIT"], "max_star...
#include <boost/test/unit_test.hpp> #include <hotplate/hotplate.h> BOOST_AUTO_TEST_SUITE(hotplate_test_suite) BOOST_AUTO_TEST_CASE(hotplate_test_1) { hotplate::hotplate hp(42); BOOST_REQUIRE(true); } BOOST_AUTO_TEST_SUITE_END()
{"hexsha": "386a292bfa9387fcbb48512361ce3df3685a2b16", "size": 233, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/hotplate_boost_test/hotplate_boost_test.cpp", "max_stars_repo_name": "samwarring/hotplate", "max_stars_repo_head_hexsha": "2176054ffe315023208a085777682bc4ebccdbe7", "max_stars_repo_licenses": ["...
import tensorflow as tf import numpy as np import nltk import pickle import random import Helper import argparse # parse cli arguments ap = argparse.ArgumentParser(description="Tensorflow RNN for text generation") ap.add_argument('-t', '--train', help = 'Set this flag to train the RNN from scratch', action='store_true...
{"hexsha": "6237984a454f7d5d7dc135e8c13ae3b344787242", "size": 11928, "ext": "py", "lang": "Python", "max_stars_repo_path": "Lil JadenBot/word-lstm.py", "max_stars_repo_name": "oduwa/pyRNN", "max_stars_repo_head_hexsha": "d6c60724da68b76e2e9cf941431e6aa67ee0f329", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
import numpy as np from library.c4_bbox_iou import bbox_overlaps def demo_bbox_iou(): pred_bbox3 = np.array([[10, 20, 60, 65, 0.6], [10, 27, 60, 75, 0.8], [50, 90, 90, 95, 0.45], [10, 90, 90, 95, 0.8], [20,...
{"hexsha": "1ab0b81400327221ca01d9175981fb6a9817f5d6", "size": 576, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/c4_bbox_iou.py", "max_stars_repo_name": "hhaAndroid/deep_learning_codesegment", "max_stars_repo_head_hexsha": "2b09654b9cb2aec9f534c496819ad19d69734897", "max_stars_repo_licenses": ["MIT"], "...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Apr 10 08:55:25 2020 @author: Miguel """ import sys sys.path.append('C:/Users/mahom/Documents/Python Scripts/UNM/utils') import numpy as np import time from sklearn.gaussian_process import GaussianProcessRegressor from sklearn import gaussian_process f...
{"hexsha": "801af5eaab64e4ffdcda1a5095e3f9bc18f1941d", "size": 6224, "ext": "py", "lang": "Python", "max_stars_repo_path": "GP24I_v4.py", "max_stars_repo_name": "Miguel-Hombrados/GPK-pytorch", "max_stars_repo_head_hexsha": "ef2addc5b40fa94a9ff1d8b650ee02d9044790c7", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
module Generic.Lib.Data.Product where open import Data.Product renaming (map to pmap; zip to pzip) hiding (map₁; map₂) public open import Generic.Lib.Intro open import Generic.Lib.Category infixl 4 _,ᵢ_ first : ∀ {α β γ} {A : Set α} {B : Set β} {C : A -> Set γ} -> (∀ x -> C x) -> (p : A × B) -> C (proj₁ p) × ...
{"hexsha": "efb22caced340ab9533d17509d9db817f87dde22", "size": 1462, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "src/Generic/Lib/Data/Product.agda", "max_stars_repo_name": "turion/Generic", "max_stars_repo_head_hexsha": "e102b0ec232f2796232bd82bf8e3906c1f8a93fe", "max_stars_repo_licenses": ["MIT"], "max_star...
from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np from gym import spaces from stable_baselines3.common.vec_env.base_vec_env import VecEnv, VecEnvWrapper from stable_baselines3.common.vec_env.stacked_observations import StackedDictObservations, StackedObservations class VecFrameStack(VecE...
{"hexsha": "e06d5125e0f4b666af20a1b86ef53c63b635c1b9", "size": 2694, "ext": "py", "lang": "Python", "max_stars_repo_path": "stable_baselines3/common/vec_env/vec_frame_stack.py", "max_stars_repo_name": "SwapnilPande/stable-baselines3", "max_stars_repo_head_hexsha": "93f62cef7c44295f7e82c751a8a7b23653361313", "max_stars_...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from data_utils.task_def import TaskType from module.san import SANClassifier #------------------------------ # The Discriminator # https://www.aclweb.org/anthology/2020.acl-main.191/ # https://github.com/crux82/ganbert #------...
{"hexsha": "8940367ef3206544b82465569ea98170ebd1ff9a", "size": 6467, "ext": "py", "lang": "Python", "max_stars_repo_path": "mttransformer/tasks/__init__.py", "max_stars_repo_name": "sicilyg/ganbert-test", "max_stars_repo_head_hexsha": "5bb14573a2330573ea9c932827ec1b462842a530", "max_stars_repo_licenses": ["Apache-2.0"]...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TEMPLATE: Define bibliography options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Define the options for bibliography and load biblatex package \RequirePackage...
{"hexsha": "dece7ce135c44bc56c8e2550ea3ca93c168cb7d1", "size": 16581, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "support/templates/tech/template-tech-format.tex", "max_stars_repo_name": "jcarpi/nasa-latex-docs", "max_stars_repo_head_hexsha": "9400faf9d26c8dd58489d5fecc3046d2183ccc6e", "max_stars_repo_licenses...
import logging import numpy as np import esutil as eu from metadetect.detect import MEDSifier from .util import get_masked_frac from .fofs import get_fofs from .mof_fitter import MOFFitter from .metacal_fitter import MetacalFitter, METACAL_TYPES logger = logging.getLogger(__name__) class MetacalPlusMOF(object): ...
{"hexsha": "750faa95def216210014902063d8e0c7fd920511", "size": 3661, "ext": "py", "lang": "Python", "max_stars_repo_path": "mdetsims/metacal/metacal_mof_fitter.py", "max_stars_repo_name": "kaiwen-kakuiii/metadetect-sims", "max_stars_repo_head_hexsha": "a0fd133ca5bc946c6ce769e8657ef2ce10226953", "max_stars_repo_licenses...
import os # import bct # import igraph import numpy as np import pylab as pl from copy import copy import networkx as nx from random import shuffle import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from mpl_toolkits.axes_grid1 import make_axes_locatable class Drawing(object): """ draw ...
{"hexsha": "6f40f1212c9a61c1f32960fc9e91381e6fe059c4", "size": 5930, "ext": "py", "lang": "Python", "max_stars_repo_path": "itng/drawing.py", "max_stars_repo_name": "SaeedTaghavi/itng_toolbox", "max_stars_repo_head_hexsha": "baae7abbea78cbeec3b5b8b29fad7d748dff3c20", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
#!/usr/bin/env python ############################################################################# ## # This file is part of Taurus ## # http://taurus-scada.org ## # Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## # Taurus is free software: you can redistribute it and/or modify # it under the terms of t...
{"hexsha": "0746a5d8eebdd53926ac823e6faa0e2380333890", "size": 3596, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/taurus/core/util/test/test_codecs.py", "max_stars_repo_name": "MikeFalowski/taurus", "max_stars_repo_head_hexsha": "ef041bf35dd847caf08a7efbe072f4020d35522e", "max_stars_repo_licenses": ["CC-B...
from mne.decoding import CSP import numpy as np import pandas as pd from scipy.signal import iirfilter, sosfilt from sklearn.base import BaseEstimator, TransformerMixin from sklearn.feature_selection import SelectKBest, mutual_info_classif FILTERS_YK2019 = [ (7.5, 14), (11, 13), (10, 14), (9, 12), (19, 22), (16, ...
{"hexsha": "76222e0db18b28563d525493e251f754ab12b1b7", "size": 4856, "ext": "py", "lang": "Python", "max_stars_repo_path": "moabb/pipelines/fbcsp_selectandcov.py", "max_stars_repo_name": "m2-farzan/moabb", "max_stars_repo_head_hexsha": "a8be50d2508f28ba4d272b0f111328a75c42adab", "max_stars_repo_licenses": ["BSD-3-Claus...
\documentclass[british]{article} \usepackage[T1]{fontenc} \usepackage[latin9]{luainputenc} \usepackage[a4paper]{geometry} \geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm} \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{babel} \usepackage{setspace} \usepackage{microtype} \onehalfspacing \usepackage...
{"hexsha": "0a46ff11477ce3c4995b27cfa2230748f18d19d3", "size": 12733, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Algorithm_Basics_Notes/Algorithm_Basics_Notes.tex", "max_stars_repo_name": "Yuvvi01/Notes", "max_stars_repo_head_hexsha": "42f22fcb564b8dfab1443b00ec6f75327f86a87e", "max_stars_repo_licenses": ["MI...
import numpy as np import thermoplotting as tp import matplotlib.pyplot as plt import matplotlib.patches as mpatches #Use structure score and lattice score to bin structures as FCC, BCC or HCP. #Uses struclat_scores.txt, generated through #casm query -k 'struc_score(PRIM,basis_score)' 'struc_score(PRIM,lattice_score)'...
{"hexsha": "44683245477cd1ae28b01f8f590795e89d60411a", "size": 2695, "ext": "py", "lang": "Python", "max_stars_repo_path": "old/scripts/strucbin.py", "max_stars_repo_name": "Van-der-Ven-Group/thermoplotting", "max_stars_repo_head_hexsha": "d826d728f406896b7a56207f3f4e9b4176de0e97", "max_stars_repo_licenses": ["MIT"], "...
#! /usr/bin/env python import unittest import numpy as np from mushi import histories from mushi import utils class TestMushi(unittest.TestCase): def test_constant_history(self): u"""test expected SFS under constant demography and mutation rate against the analytic formula from Fu (1995) ...
{"hexsha": "6bc1a3aca3fb17cb5c517a9ab5ce1c0c0234f4fd", "size": 839, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_mushi.py", "max_stars_repo_name": "Lukez-pi/mushi_lz", "max_stars_repo_head_hexsha": "a60d9d44834de56b764940c83562451b2db9e245", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
[STATEMENT] lemma id_closes: shows "(id \<Gamma>) closes \<Gamma>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Lam_ml.id \<Gamma> closes \<Gamma> [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. Lam_ml.id \<Gamma> closes \<Gamma> [PROOF STEP] { [PROOF STATE] proof (state) goal (1 subgoal):...
{"llama_tokens": 1008, "file": "Lam-ml-Normalization_Lam_ml", "length": 14}
from client import Client import numpy as np import configparser from utilities import * # Handle configuration file config = configparser.ConfigParser() config.read('config.ini') binance_config = config['Binance Futures'] order_layout_mode = binance_config['OrderLayoutMode'] if order_layout_mode not in ('constant', '...
{"hexsha": "d6f0c9d59cdc57b235eae80f2cedf19b7b3e1bca", "size": 4603, "ext": "py", "lang": "Python", "max_stars_repo_path": "place-order.py", "max_stars_repo_name": "TurtleARM/CryptoLayering", "max_stars_repo_head_hexsha": "d544ce2ac63a3a42edd16092d1d3db8266639daf", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
# -*- coding: utf-8 -*- """ Bilinear Bayer CFA Demosaicing ============================== *Bayer* CFA (Colour Filter Array) bilinear demosaicing. References ---------- - :cite:`Losson2010c` : Losson, O., Macaire, L., & Yang, Y. (2010). Comparison of Color Demosaicing Methods. In Advances in Imaging and Elec...
{"hexsha": "92a830162f6dc973b89de5842e3aa66570434c6e", "size": 3657, "ext": "py", "lang": "Python", "max_stars_repo_path": "colour_demosaicing/bayer/demosaicing/bilinear.py", "max_stars_repo_name": "maaleske/colour-demosaicing", "max_stars_repo_head_hexsha": "5470a538323adfc14779e4444e36c3af69945dd7", "max_stars_repo_l...
#data set class from torch.utils.data import Dataset import pandas as pd import numpy as np import glob class brain_dataset(Dataset): def __init__(self, instance_list, label_list): self.instance_list = instance_list self.instance_label = label_list def __getitem__(self, index): ...
{"hexsha": "3d9e132164cc56eef94799f93598812d4ef1896e", "size": 4371, "ext": "py", "lang": "Python", "max_stars_repo_path": "helpers/brain_data.py", "max_stars_repo_name": "tufts-ml/fNIRS-mental-workload-classifiers", "max_stars_repo_head_hexsha": "b5199d6184e659152d1fe650db48eba53a221186", "max_stars_repo_licenses": ["...
from __future__ import print_function import matplotlib matplotlib.use('tkAgg') import matplotlib.pyplot as plt from scipy.sparse import csr_matrix from dolfin import * import scipy import numpy as np import pyshtools from deepsphere import utils # Test for PETSc and SLEPc if not has_linear_algebra_backend("PETSc...
{"hexsha": "e51c433593e5b461574c97b1deb05a42083eebab", "size": 5106, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/03.FEM_laplacian/equiangular/normal/16_check_reordering_mask.py", "max_stars_repo_name": "MartMilani/PDM", "max_stars_repo_head_hexsha": "cca07a8485c6933361536286279ae6c7e14d7fa1", "max_star...
#!/usr/bin/env python2 ########################################################## # # Script: smooth_mesh_2d.py # # Description: Smooths a 2D region of an AWP-12 mesh for # each k value along the z axis. # # The interpolation boundaries are points on # the x-axis. # # Eg: M8 80m C...
{"hexsha": "13b272ea7dd8e7c19ad21d1f7919e4f81ae8c9d4", "size": 4286, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/scripts/mesh/smooth_mesh_2d.py", "max_stars_repo_name": "baagaard-usgs/UCVMC", "max_stars_repo_head_hexsha": "53d3c136ea32bceaa02a89c351fee7e8155a5af5", "max_stars_repo_licenses": ["Apach...
from story.utils import result_replace import numpy as np class GPT2Generator: def __init__(self, **kwargs): pass def generate(self, prompt, debug_print=False): if debug_print: print("******DEBUG******") print("Prompt is: ", repr(prompt)) for _ in range(5): ...
{"hexsha": "8322aa95dc774fcb51fc571d0472f424035143ad", "size": 644, "ext": "py", "lang": "Python", "max_stars_repo_path": "generator/gpt2/gpt2_dummy.py", "max_stars_repo_name": "Ezekial711/AIDungeon", "max_stars_repo_head_hexsha": "0915796c5b5a1729cf1a4cf221aec97b0a1a82cf", "max_stars_repo_licenses": ["MIT"], "max_star...
import time import numpy as np import oneflow as flow class Logger(object): def __init__(self, rank): self.rank = rank self.step = 0 self.metrics = dict() def register_metric( self, metric_name, metric, print_format=None, reset_after_print=False ): if metric_name i...
{"hexsha": "1e3dbe222ecd6b9006dfa85a06ab344a70873a5f", "size": 4369, "ext": "py", "lang": "Python", "max_stars_repo_path": "GPT/oneflow_gpt/logger.py", "max_stars_repo_name": "mls1999725/models", "max_stars_repo_head_hexsha": "77b3a9d727cb7cf3a14a75d8fdb0d17bb411bd02", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
""" Algorithm for solving Physics-Informed Neural Networks problems. Arguments: * `dx` is the discretization of the grid * `chain` is a Flux.jl chain with a d-dimensional input and a 1-dimensional output, * `init_params` is the initial parameter of the neural network, * `phi` is a trial solution, * `autodiff` is a boo...
{"hexsha": "09ebb02ae44422f9d0073f2fc016d39e6f472c47", "size": 14990, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/pinns_pde_solve.jl", "max_stars_repo_name": "smibayy/NeuralPDE.jl", "max_stars_repo_head_hexsha": "0721880667f56957c668ed26736118cc8626b82b", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
import pulp import pandas as pd from data3_mrmcsp import * from scipy.spatial import distance """ This is a calculation of routes between origins and destinations it append to a dictionary (keys are a origin-destination pair id) Example: example = ['o0_s0_s1_s2_s9_d0', 'o0_s2_s3_s8_d0'] is a set of routes between...
{"hexsha": "1088dfe9e8b01d3ca3c5c179d860fe612b619614", "size": 5111, "ext": "py", "lang": "Python", "max_stars_repo_path": "mrmcsp/mrmcsp.py", "max_stars_repo_name": "adaj/patrol-plan", "max_stars_repo_head_hexsha": "25c603b50d2a56b7163756aa3a8c4f66f39a3e0f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,...
(*Theorem DivergesAt_Transfer: forall n lookahead against matched, MatchFrontAlign lookahead matched -> MatchFrontAlign against matched -> n < length lookahead -> ~(EqDivergesAt lookahead against n). Proof. intros ?; induction n; intros ? ?. intros ? HFAlm HFAam HL [HTA HD]; do 2 rewrite -> skipn_O in *...
{"author": "blainehansen", "repo": "traya", "sha": "aafacf52221f234e0d1616d0d6a966fbe73935fd", "save_path": "github-repos/coq/blainehansen-traya", "path": "github-repos/coq/blainehansen-traya/traya-aafacf52221f234e0d1616d0d6a966fbe73935fd/scratch.v"}
import os import torch import h5py from torchvision import transforms from PIL import Image from torch.autograd import Variable from DataAugment import DataAugment import numpy as np import nibabel as nib import pandas as pd augment = DataAugment() transform = {'MinMax': True, 'ZScore' : True, 'Resize': 82, 'TenCrop':...
{"hexsha": "eefe9d0afdf50c8c309c40adc4ce787a707fc403", "size": 3056, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/infer.py", "max_stars_repo_name": "koriavinash1/PAC18", "max_stars_repo_head_hexsha": "7ee1439cab112aab5af40451b32f4d79f9c499aa", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6, "max...
From Coqprime Require Import PocklingtonRefl. Local Open Scope positive_scope. Lemma primo81: prime 4732254109989697-> prime 46357161274830326863. Proof. intro H. apply (Pocklington_refl (Ell_certif 46357161274830326863 9796 ((4732254109989697,1)::nil) 0 711828 117 ...
{"author": "mukeshtiwari", "repo": "Formally_Verified_Verifiable_Group_Generator", "sha": "e80e8d43e81b5201d6ab82a8ebc07a5cef03476b", "save_path": "github-repos/coq/mukeshtiwari-Formally_Verified_Verifiable_Group_Generator", "path": "github-repos/coq/mukeshtiwari-Formally_Verified_Verifiable_Group_Generator/Formally_Ve...
[STATEMENT] lemma vD_nsqn_sqn [elim, simp]: assumes "ip\<in>vD(rt)" shows "nsqn rt ip = sqn rt ip" [PROOF STATE] proof (prove) goal (1 subgoal): 1. nsqn rt ip = sqn rt ip [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. nsqn rt ip = sqn rt ip [PROOF STEP] from \<open>ip\<in>vD(rt)\<close> [...
{"llama_tokens": 477, "file": "AODV_variants_c_gtobcast_C_Fresher", "length": 7}
''' Created on Apr 23, 2018 @author: rsepulveda3 ''' #import sys #sys.path.append('C:\ProgramData\Anaconda3\Lib\site-packages') import datetime import matplotlib.pyplot as plt from sklearn import tree import graphviz from sklearn.datasets import load_iris from sklearn.datasets import load_wine import sklearn.dat...
{"hexsha": "dd7e57945b2327a509679406a898a676bc3296a5", "size": 3305, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/decision_tree/tree_test.py", "max_stars_repo_name": "SirLaughalot/pythonTest", "max_stars_repo_head_hexsha": "a74e49f670e026877b3daa1f0ec9714d054ff9af", "max_stars_repo_licenses": ["BSD-3-Clau...
# Copyright 2021 Sony Semiconductors Israel, Inc. 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 b...
{"hexsha": "aca5b98427bd09b42819dd098e51665058f719a3", "size": 4802, "ext": "py", "lang": "Python", "max_stars_repo_path": "model_compression_toolkit/keras/visualization/nn_visualizer.py", "max_stars_repo_name": "haihabi/model_optimization", "max_stars_repo_head_hexsha": "97372a9596378bb2287c59f1180b5059f741b2d6", "max...
Require Import Reals Psatz Omega ClassicalEpsilon. From discprob.basic Require Export base Series_Ext order bigop_ext sval Reals_ext. From Coquelicot Require Export Rcomplements Rbar Series Lim_seq Hierarchy Markov Continuity. From stdpp Require Export base. Definition le_prop {X} (P1 P2: X → Prop) := ∀ x, P1 x → P2...
{"author": "jtassarotti", "repo": "coq-proba", "sha": "11d69b2286940ff532421252a7d9b1384c2f674a", "save_path": "github-repos/coq/jtassarotti-coq-proba", "path": "github-repos/coq/jtassarotti-coq-proba/coq-proba-11d69b2286940ff532421252a7d9b1384c2f674a/theories/measure/sets.v"}
/* * Copyright (c) 2011-2019, The DART development contributors * All rights reserved. * * The list of contributors can be found at: * https://github.com/dartsim/dart/blob/master/LICENSE * * This file is provided under the following "BSD-style" License: * Redistribution and use in source and binary forms, w...
{"hexsha": "f6689c0bd4c89464c2dfd0b905ac2794dea5308c", "size": 15179, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "unittests/comprehensive/test_SoftDynamics.cpp", "max_stars_repo_name": "jyf588/nimblephysics", "max_stars_repo_head_hexsha": "6c09228f0abcf7aa3526a8dd65cd2541aff32c4a", "max_stars_repo_licenses": [...
from os import path import sys sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) from pymapf.decentralized.velocity_obstacle.velocity_obstacle import ( MultiAgentVelocityObstacle, ) from pymapf.decentralized.position import Position import numpy as np sim = MultiAgentVelocityObstacle(simulation_...
{"hexsha": "4d92baab726189f74e6d6db7afc93b8369628262", "size": 772, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/switch_positions_vel_obstacles.py", "max_stars_repo_name": "APLA-Toolbox/pymapf", "max_stars_repo_head_hexsha": "255df006925401e5ccdf82afc7dac339221574ba", "max_stars_repo_licenses": ["MIT"...
\section{Data preprocessing} \subsection{Resizing and Normalization} Before applying the classification models we preprocessed our image data. We started off by resizing each image to a window of pixels of \(64 \times 64\), forming a square. Although all the images had the same size before this step, we decided to res...
{"hexsha": "c5394e81b7561ea3aee9c86b0fed3d6ea9e09b79", "size": 2634, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "report/sections/data-preprocessing.tex", "max_stars_repo_name": "vascoalramos/image-face-detection", "max_stars_repo_head_hexsha": "c6aced3864343481dea27882a164134890fb001a", "max_stars_repo_license...
import numpy as np from foolbox import set_seeds from foolbox.attacks import LocalSearchAttack as Attack def test_attack(bn_model, bn_criterion, bn_images, bn_labels): set_seeds(22) attack = Attack(bn_model, bn_criterion) advs = attack(bn_images, bn_labels, unpack=False, d=1, t=20, R=250) for adv in ...
{"hexsha": "16cce2137e2825dd36de696fceff4527d1514df8", "size": 1051, "ext": "py", "lang": "Python", "max_stars_repo_path": "cnns/foolbox/foolbox_2_3_0/tests/attacks/test_batch_attacks_localsearch.py", "max_stars_repo_name": "anonymous-user-commits/perturb-net", "max_stars_repo_head_hexsha": "66fc7c4a1234fa34b92bcc85751...
"""Image utility functions. """ # standard imports from typing import Union, Tuple, List from pathlib import Path import logging # third party imports import numpy as np # toolbox imports from ..base.image import Imagelike from ..base.image import ImageReader, ImageWriter, ImageDisplay, ImageResizer # logging LOG =...
{"hexsha": "cb19af9b42ff79a6085770026691505a38024d24", "size": 7392, "ext": "py", "lang": "Python", "max_stars_repo_path": "dltb/util/image.py", "max_stars_repo_name": "Petr-By/qtpyvis", "max_stars_repo_head_hexsha": "0b9a151ee6b9a56b486c2bece9c1f03414629efc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "...
subroutine ktsol(n,ns,nv,a,b,x,ktilt,maxeq) !----------------------------------------------------------------------- ! Solution of a system of linear equations by gaussian elimination with ! partial pivoting. Several right hand side matrices and several ! variables are allowed. ! NOTE: All input...
{"hexsha": "9de5510dc9c6ff1ee61596224a75c206a1da343a", "size": 5215, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "for_code/kt3d/gslib/ktsol.f90", "max_stars_repo_name": "cmrajan/pygslib", "max_stars_repo_head_hexsha": "acdf96d9ec17658f18fe9f078104c6259b479f52", "max_stars_repo_licenses": ["MIT"], "max_stars...
import pandas as pd import numpy as np path="./RAWCSV/2021-10-25" STATE_NAMES = { # 'AP': 'Andhra Pradesh', 'AR': 'Arunachal Pradesh', 'AS': 'Assam', 'BR': 'Bihar', 'CT': 'Chhattisgarh', 'GA': 'Goa', 'GJ': 'Gujarat', 'HR': 'Haryana', 'HP': 'Himachal Pradesh', 'JH': 'Jharkhand', 'KA': 'Karnataka...
{"hexsha": "998bf181715f83df4542ab8c91081999b01fea72", "size": 3188, "ext": "py", "lang": "Python", "max_stars_repo_path": "json_creation/DataminJSON-code.py", "max_stars_repo_name": "incovid19/incovid19", "max_stars_repo_head_hexsha": "57bdb7fe52a6dea699c77117e9c36696b88bb059", "max_stars_repo_licenses": ["MIT"], "max...
from json import load import queue from database import * import sklearn.preprocessing import pandas as pd import numpy as np from sklearn.cluster import KMeans from queue import Queue import loader available = False last_centroids = None centroids_queue = Queue(100) query = f""" SELECT block_hash, wallets.* ...
{"hexsha": "b084de28cfcec1da263af56e083ae9fe509d2fb6", "size": 3376, "ext": "py", "lang": "Python", "max_stars_repo_path": "wallet_clustering.py", "max_stars_repo_name": "di3go-sona/bitcoin-viz", "max_stars_repo_head_hexsha": "dd70b21ea9e5371318b28683f08994a14fe74011", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_...
import os import numpy as np import pandas as pd from CHECLabPy.plotting.setup import Plotter from scipy.stats import norm class PedestalSpread(Plotter): def plot(self, eped_sigma): mean = np.mean(eped_sigma) std = np.std(eped_sigma) x = np.linspace(eped_sigma.min(), eped_sigma.max(), 100...
{"hexsha": "c39a61191d9f5a57bc00f7bfe3a5ab509be7e3b3", "size": 1329, "ext": "py", "lang": "Python", "max_stars_repo_path": "sstcam_sandbox/old/mc_config/fadc_pedestal_variation.py", "max_stars_repo_name": "watsonjj/CHECLabPySB", "max_stars_repo_head_hexsha": "91330d3a6f510a392f635bd7f4abd2f77871322c", "max_stars_repo_l...
import numpy as np import time tests = np.arange(1, 11) * 1000 timings = np.zeros(tests.size) for idx, N in enumerate(tests): a = np.linspace(0, 2 * np.pi, N) k = 100 A = a[:, np.newaxis] start_time = time.time() M = np.exp(1j * k * np.sqrt(A ** 2 + A.T ** 2)) timings[idx] = time.time() - sta...
{"hexsha": "8f27a697d1fb37d566b7aeabb424859e71ff3286", "size": 343, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "clavigne/julia-numpy-fortran-test", "max_stars_repo_head_hexsha": "1d56454c411eb7d25e29c3dab263c890a156bec3", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
import torch from torch import nn import torch.nn.functional as nnFunc import numpy as np class TorusPadding(nn.Module): ''' Padding Module thats pad the images as it is on a torus ''' def __init__(self, padSize): super(TorusPadding, self).__init__() self.padSize = padSize def forwa...
{"hexsha": "31b7ebc558d19061201a77c1db87ead7bf7bde24", "size": 4322, "ext": "py", "lang": "Python", "max_stars_repo_path": "gotex/vgg.py", "max_stars_repo_name": "ahoudard/GOTEX", "max_stars_repo_head_hexsha": "3dad19918ae8e72904d0b47f9eca2a5cf5434fca", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_sta...
# ----------------------------------------------------------- # Test lead lag and multi-delayed transformations # # (C) 2020 Kevin Schlegel, Oxford, United Kingdom # Released under Apache License, Version 2.0 # email kevinschlegel@cantab.net # ----------------------------------------------------------- import numpy as ...
{"hexsha": "db90b55ac9595e814b6260620eb4fea9811d6e18", "size": 3040, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_leadlag.py", "max_stars_repo_name": "WeixinYang/PSFDataset", "max_stars_repo_head_hexsha": "f29b37489c580ad3c677bb9385a721cc57da60e4", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
# forecast models # Author: Christian Hubbs # Email: christiandhubbs@gmail.com # Date: 03.05.2019 import numpy as np from calendar import monthrange import warnings from .demand_utils import * # List of forecast commands that can be called # forecast_options = [False, 'UNIFORM', 'UNIFORM_HORIZON', # 'AGGREGATE_HORI...
{"hexsha": "b223cec7d0cffc24b1b5a0315bdcca915d046660", "size": 24792, "ext": "py", "lang": "Python", "max_stars_repo_path": "ada/environments/demand_models/forecast.py", "max_stars_repo_name": "hubbs5/public_drl_sc", "max_stars_repo_head_hexsha": "139ee12a4b498e3b55afe7b813c59538df2193f6", "max_stars_repo_licenses": ["...
import vrep import time import numpy as np import scipy.linalg as sla M=[] s=[] def skew3(arr): a=arr[0] b=arr[1] c=arr[2] mat = np.array([[0,-c,b],[c,0,-a],[-b,a,0]]) return mat def skew6(arr): a = arr[0] b = arr[1] c = arr[2] d = arr[3] e = arr[4] f ...
{"hexsha": "247415dd82ff6c607686631b5190575732a79737", "size": 14404, "ext": "py", "lang": "Python", "max_stars_repo_path": "week4/in.py", "max_stars_repo_name": "AngelosGuan/ECE470FinalProj", "max_stars_repo_head_hexsha": "eaac5e11b22e8e61046934dc0b14c9f959a7ff05", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
\documentclass[12pt]{article} \usepackage[margin=0.75in, top=1in, bottom=1in, a4paper]{geometry} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsthm} \usepackage{pgfplots} \usepackage{mathtools} \usepackage{booktabs} \usepackage{indentfirst} \newcommand{\mo}[1]{\lvert #1 \rvert} \newcommand{\mos}[1]{\lvert #...
{"hexsha": "560132e3f92822084cf9b5a22d5aead8f6c82e1e", "size": 5200, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "homework-1/homework-1.tex", "max_stars_repo_name": "davidmaamoaix/convex-opt", "max_stars_repo_head_hexsha": "9a47c6f3241a72aac2b0df90e7f85869ccb09dd7", "max_stars_repo_licenses": ["MIT"], "max_star...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim class FullyConnectedNetwork(nn.Module): def __init__(self, state_size, output_size, hidden_size, output_gate=None): super(FullyConnectedNetwork, self).__init__() self.linear1 = n...
{"hexsha": "96a4c9fbbabacd9c83d690cbef61698db14b4d88", "size": 1812, "ext": "py", "lang": "Python", "max_stars_repo_path": "p2_continuous-control/model.py", "max_stars_repo_name": "royveshovda/deep-reinforcement-learning", "max_stars_repo_head_hexsha": "64ba7ef5ab44f095b7e8b29f6c4ff1585025981a", "max_stars_repo_license...
[STATEMENT] lemma rawpsubst2_fresh_switch: assumes "r \<in> atrm" "t \<in> trm" "s \<in> trm" "x \<in> var" "y \<in> var" and "x \<noteq> y" "x \<notin> FvarsT s" "y \<notin> FvarsT t" shows "rawpsubstT r ([(s,y),(t,x)]) = rawpsubstT r ([(t,x),(s,y)])" [PROOF STATE] proof (prove) goal (1 subgoal): 1. rawpsubstT r [(...
{"llama_tokens": 340, "file": "Syntax_Independent_Logic_Syntax_Arith", "length": 2}
import sys import numpy as np n, a, *x = map(int, sys.stdin.read().split()) def main(): m = 2500 dp = np.zeros((n + 1, m + 1), dtype=np.int64) dp[0, 0] = 1 for i in range(n): dp[1:, x[i] :] += dp[:-1, : -x[i]].copy() i = np.arange(1, n + 1) print(dp[i, i * a].sum()) ...
{"hexsha": "86820c8f92f571b3192707e4118eae2e51c3f54f", "size": 362, "ext": "py", "lang": "Python", "max_stars_repo_path": "jp.atcoder/abc044/arc060_a/11773307.py", "max_stars_repo_name": "kagemeka/atcoder-submissions", "max_stars_repo_head_hexsha": "91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e", "max_stars_repo_licenses": ...
[STATEMENT] lemma alpha_Tree_supp_rel: assumes "t1 =\<^sub>\<alpha> t2" shows "supp_rel (=\<^sub>\<alpha>) t1 = supp_rel (=\<^sub>\<alpha>) t2" [PROOF STATE] proof (prove) goal (1 subgoal): 1. supp_rel (=\<^sub>\<alpha>) t1 = supp_rel (=\<^sub>\<alpha>) t2 [PROOF STEP] using assms [PROOF STATE] proof (prove) using...
{"llama_tokens": 11549, "file": "Modal_Logics_for_NTS_FL_Formula", "length": 36}
from .bananas import * from numpy.testing import Tester test = Tester().test bench = Tester().bench
{"hexsha": "6613d0e976d007e91b6d34ab3fb6b6898054cc6c", "size": 101, "ext": "py", "lang": "Python", "max_stars_repo_path": "bananas/__init__.py", "max_stars_repo_name": "bccp/bananaplots", "max_stars_repo_head_hexsha": "dbfe107207e07351c7d7125430fde16fb2731cc2", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun...
# USAGE # python skindetector.py # python skindetector.py --video video/skin_example.mov # import the necessary packages from pyimagesearch import imutils import numpy as np import argparse import cv2 def has_hand(image, image_path="result.JPG"): # define the upper and lower boundaries of the HSV pixel # int...
{"hexsha": "e57a324175b22eb08d23acd1f7687597b368dc53", "size": 1854, "ext": "py", "lang": "Python", "max_stars_repo_path": "skindetector.py", "max_stars_repo_name": "minhkhang1795/iKrfatR", "max_stars_repo_head_hexsha": "2c8375cfe7decb068cc092b2bd57ccf622253f97", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n...
import numpy as np import math, operator import random class Sample(object): def __init__(self, id, image, label): self.id = id self.image = image self.label = label class MiniBatch(object): def __init__(self): self.ids = [] self.images = [] self.labels = [] ...
{"hexsha": "59fd2128d8b80c20f6a651f1834d993ecc9fc9c4", "size": 5141, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/reader/batch_patcher_online.py", "max_stars_repo_name": "kaist-dmlab/Ada-Boundary", "max_stars_repo_head_hexsha": "abdefe4a6009ab862f6ed0467462b0900b921c3a", "max_stars_repo_licenses": ["MIT"]...
import numpy import numpy_demo a = numpy.array([1.0, 3.5, 8.4, 2.3, 6.6, 4.1], "d") numpy_demo.sum_of_squares(a)
{"hexsha": "46a1fb0c93b3be7b996bd98ac963449c7b31c7a2", "size": 114, "ext": "py", "lang": "Python", "max_stars_repo_path": "Demos/run_numeric_demo.py", "max_stars_repo_name": "smok-serwis/cython", "max_stars_repo_head_hexsha": "e551a3a348888bd89d4aad809916709a634af1fb", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import tensorflow as tf import numpy as np from tensorflow import keras ''' Build the model ''' model = keras.models.Sequential() model.add(keras.layers.Conv2D())
{"hexsha": "ae23e8083c0e38a47450773937d9f2773eb78d07", "size": 224, "ext": "py", "lang": "Python", "max_stars_repo_path": "deep_feature_extraction_TF2.0/CNN_structure_tf20.py", "max_stars_repo_name": "rechardchen123/trjaectory_image_process_from_frequency_domain", "max_stars_repo_head_hexsha": "b3af5eed3d66e0bda569b480...
% based on example 7 in pythontex_gallery % https://github.com/gpoore/pythontex/ \documentclass[12pt]{mmalatex} \usepackage{examples} \begin{document} \section*{Step-by-step integration} This is another nice example drawn from the Pythontex gallery, see \ \url{https://github.com/gpoore/pythontex}. It shows the ste...
{"hexsha": "de35a8ddc3b251e1016e5c172da76b352a855388", "size": 2317, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "mathematica/examples/example-03.tex", "max_stars_repo_name": "leo-brewin/hybrid-latex", "max_stars_repo_head_hexsha": "2debaf3f97eb551928d08dc4baded7ef7a4ab29a", "max_stars_repo_licenses": ["MIT"], ...