text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
module da_4dvar
use da_tracing, only : da_trace_entry, da_trace_exit
use da_reporting, only : da_error, message
use da_control, only : comm, var4d_bin, var4d_lbc, trace_use_dull, num_fgat_time, multi_inc
#ifdef VAR4D
use module_streams, only : MAX_WRF_ALARMS
use module_wrf_top, only : domain, head_grid, model_config... | {"hexsha": "98928f718c9110344f1c2e87ccc5c2c67f40d21b", "size": 2165, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "var/da/da_4dvar/da_4dvar.f90", "max_stars_repo_name": "matzegoebel/WRF-fluxavg", "max_stars_repo_head_hexsha": "686ae53053bf7cb55d6f078916d0de50f819fc62", "max_stars_repo_licenses": ["BSD-2-Clau... |
[STATEMENT]
lemma arg_cnj_not_pi:
assumes "Arg z \<noteq> pi"
shows "Arg (cnj z) = -Arg z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Arg (cnj z) = - Arg z
[PROOF STEP]
proof(cases "Arg z = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. Arg z = 0 \<Longrightarrow> Arg (cnj z) = - Arg z
2. Arg z \<no... | {"llama_tokens": 1560, "file": "Complex_Geometry_More_Complex", "length": 18} |
### Edge and Gradient Related Image Operations ###
# Edge/gradient filters
function sobel()
f = [ -1.0 0.0 1.0
-2.0 0.0 2.0
-1.0 0.0 1.0 ]
return f', f
end
function prewitt()
f = [ -1.0 0.0 1.0
-1.0 0.0 1.0
-1.0 0.0 1.0 ]
return f', f
end
# Consist... | {"hexsha": "ca4f40dd4d9a223fdcf46db224424827357f02aa", "size": 15400, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/edge.jl", "max_stars_repo_name": "staticfloat/Images.jl", "max_stars_repo_head_hexsha": "90ee20e16c43960addce8d71b3e57973f6188799", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
__author__ = 'lucabasa'
__version__ = '0.0.3'
__status__ = 'development'
from tubesml.base import BaseTransformer
from tubesml.model_inspection import get_coef, get_feature_importance
from tubesml.model_selection import cv_score
import pandas as pd
import numpy as np
from sklearn.base import clone
import warnings
... | {"hexsha": "dfdd6426e4358753459d1c0b08e370ae66d51422", "size": 10356, "ext": "py", "lang": "Python", "max_stars_repo_path": "tubesml/stacker.py", "max_stars_repo_name": "AramKoorn/tubesML", "max_stars_repo_head_hexsha": "1904989c018d4a4c7f62236ceeadafc7a7c48ccb", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co... |
//
// Copyright (c) 2000-2006
// Joerg Walter, Mathias Koch, Michael Stevens, Gunter Winkler
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that... | {"hexsha": "dbfd5da7404919c4fcda3d9ca496b0f2b0abefbc", "size": 6674, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "gamess/libqc/rysq/src/externals/boost/numeric/ublas/storage_adaptors.hpp", "max_stars_repo_name": "andremirt/v_cond", "max_stars_repo_head_hexsha": "6b5c364d7cd4243686488b2bd4318be3927e07ea", "max_s... |
[STATEMENT]
lemma degree_none[simp]: "\<not> v \<in> V \<Longrightarrow> degree v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. v \<notin> V \<Longrightarrow> degree v = 0
[PROOF STEP]
using degree_def degree_no_loops has_loop_in_verts incident_edges_sedges incident_sedges_empty
[PROOF STATE]
proof (prove)
us... | {"llama_tokens": 276, "file": "Undirected_Graph_Theory_Undirected_Graph_Basics", "length": 2} |
module Data.Optics.Lens
import Data.Morphisms
||| Lens
data Lens s a =
MkLens (s -> a) (s -> a -> s)
%name Lens lens, lens1, lens2
%default total
||| return the getter part of the lens
get: Lens s a -> (s -> a)
get (MkLens get set) = get
||| return the setter part of the lens
set: Lens s a -> (s -> a -> s)
set... | {"hexsha": "4343e35a349aae28ab2c3ee5c28a56058f818a65", "size": 1437, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "Data/Optics/Lens.idr", "max_stars_repo_name": "justjoheinz/idris-optics", "max_stars_repo_head_hexsha": "7a2dfae46ceebc78c066ec17ffd4d3f16cfa1ba9", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
[STATEMENT]
lemma msrevs:
"0 < n \<Longrightarrow> (k * n + m) div n = m div n + k"
"(k * n + m) mod n = m mod n"
for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (0 < n \<Longrightarrow> (k * n + m) div n = m div n + k) &&& (k * n + m) mod n = m mod n
[PROOF STEP]
by simp_all | {"llama_tokens": 132, "file": "Word_Lib_More_Arithmetic", "length": 1} |
"""
tint.helpers
============
"""
import string
import numpy as np
import pandas as pd
from .grid_utils import parse_grid_datetime, get_grid_size
class Counter(object):
"""
Counter objects generate and keep track of unique cell ids.
Currently only the uid attribute is used, but this framework can
... | {"hexsha": "db1f024ff85c7956697d047ff9d1546e7ab205c2", "size": 5220, "ext": "py", "lang": "Python", "max_stars_repo_path": "tint/helpers.py", "max_stars_repo_name": "Cxl1013/TINT", "max_stars_repo_head_hexsha": "479c5899713d149003096fbbc900b3c52793394d", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count": 5... |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from source.aggregate_data import (aggregate_CSV_files,
aggregate_residual_df,
residual)
from source.plotting_tools import (plot_df, plot_pairwise_dicti... | {"hexsha": "b192e72c181f9e98f31b0a32f615435988cc2025", "size": 1649, "ext": "py", "lang": "Python", "max_stars_repo_path": "explore.py", "max_stars_repo_name": "Dylan-Tran/Time-Series-Correlation", "max_stars_repo_head_hexsha": "bba461c66ce230a7c44f6d2ecc4dd394105927a6", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
function [elem2dof,elem2edge,edge,bdDof,freeDof] = dofP3(elem)
%% DOFP3 dof structure for P3 element.
%
% [elem2dof,edge,bdDof] = DOFP3(elem) constructs the dof structure
% for the quadratic element based on a triangle. elem2dof(t,i) is the
% global index of the i-th dof of the t-th element.
%
% The global indices ... | {"author": "wme7", "repo": "Aero-matlab", "sha": "9430008f2e3b84f28633775a44dff534e780fbac", "save_path": "github-repos/MATLAB/wme7-Aero-matlab", "path": "github-repos/MATLAB/wme7-Aero-matlab/Aero-matlab-9430008f2e3b84f28633775a44dff534e780fbac/iFEM/dof/dofP3.m"} |
import pandas as pd
import numpy as np
from joblib import dump, load
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
from prettytable import PrettyTable
from predicteasy.core import metrics
from predicteasy.core.data import TableFrame
from predicteasy.core.supervised import Clas... | {"hexsha": "d350e50a973ab9c363dfac37eee1e22a3df7e2c1", "size": 1628, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_modules.py", "max_stars_repo_name": "CleverInsight/predicteasy", "max_stars_repo_head_hexsha": "d16354b46abc1de032c7b188666533898847fac1", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
import numpy as np
# a = np.array([[1, 0],
# [1, 1],
# [0, 1]], dtype=bool)
# b = np.array([[1, 1, 0],
# [0, 1, 1]], dtype=bool)
a = np.array([[True, False],
[True, True],
[False, True]], dtype=bool)
b = np.array([[True, True, Fals... | {"hexsha": "fe881721f861eb26d81b45bf1e8c88c637cc12a0", "size": 414, "ext": "py", "lang": "Python", "max_stars_repo_path": "References/numpy/\u5e03\u5c14\u7b97\u672f\u77e9\u9635\u4e58\u6cd5.py", "max_stars_repo_name": "royqh1979/python_libs_usage", "max_stars_repo_head_hexsha": "57546d5648d8a6b7aca7d7ff9481aa7cd4d8f511"... |
theory Mod_Plus_Minus
imports Kyber_spec
begin
section \<open>Re-centered Modulo Operation\<close>
text \<open>To define the compress and decompress functions,
we need some special form of modulo. It returns the
representation of the equivalence class in \<open>(-q div 2, q div 2]\<close>.
Using these represe... | {"author": "ThikaXer", "repo": "Kyber_Formalization", "sha": "a1832e7b8e29852c35f252b5703083f912cfe5ff", "save_path": "github-repos/isabelle/ThikaXer-Kyber_Formalization", "path": "github-repos/isabelle/ThikaXer-Kyber_Formalization/Kyber_Formalization-a1832e7b8e29852c35f252b5703083f912cfe5ff/Mod_Plus_Minus.thy"} |
import numpy as np
import numpy.linalg
import scipy
import scipy.linalg
import scipy.optimize
import matplotlib.pyplot as plt
from ode_solvers import *
from scipy.linalg import expm
from numpy.linalg import solve, norm
from numpy import *
def exp_euler_long(f, Df, y0, t0, T, N):
"""
Exponentielles... | {"hexsha": "d99062f3972070691aa56b50d43f312be1bf3393", "size": 6324, "ext": "py", "lang": "Python", "max_stars_repo_path": "stiff_ode_solvers.py", "max_stars_repo_name": "patcher1/numerik", "max_stars_repo_head_hexsha": "ad24c8522d61970a3a881e034a7940d43ba486be", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
/* CirKit: A circuit toolkit
* Copyright (C) 2009-2015 University of Bremen
* Copyright (C) 2015-2017 EPFL
*
* 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, in... | {"hexsha": "4a78caf6444f25e71daed31e8e418e2f4d5edf3d", "size": 4504, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "addons/cirkit-addon-reversible/programs/reversible/embed_pla.cpp", "max_stars_repo_name": "eletesta/cirkit", "max_stars_repo_head_hexsha": "6d0939798ea25cecf92306ce796be154139b94f5", "max_stars_repo... |
import numpy as np
import matplotlib.pyplot as plt
def parseFile(fn):
''' loads in a file and parses the data '''
file = open(fn,'r')
head = file.readline()
head = head.strip().replace('<','').replace('>','').replace('#','').split()
lines = file.readlines()
dlines = np.array([line.strip().split() for line in l... | {"hexsha": "4151c8b6fc6c9fa6dd7b2ef688575557713ddd5a", "size": 765, "ext": "py", "lang": "Python", "max_stars_repo_path": "plotting/plot.py", "max_stars_repo_name": "ebrooker/RadDecay", "max_stars_repo_head_hexsha": "fb30b7d5ba3f4090fc49ab26c710eab4239eca9a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
from modeci_mdf.utils import load_mdf, print_summary
from modeci_mdf.mdf import Node, Edge, OutputPort
from modeci_mdf.execution_engine import EvaluableGraph
from modelspec.utils import FORMAT_NUMPY, FORMAT_TENSORFLOW
import sys
import numpy as np
verbose = True
verbose = False
def execute(multi=False):
mdf_m... | {"hexsha": "6b36d07dee6215d5e25c6d7cc387999f4cd8cc38", "size": 3141, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/NeuroML/FNrun.py", "max_stars_repo_name": "29riyasaxena/MDF", "max_stars_repo_head_hexsha": "476e6950d0f14f29463eb4f6e3be518dfb2160a5", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! EVB-QMDFF - RPMD molecular dynamics and rate constant calculations on
! black-box generated potential energy surfaces
!
! Copyright (c) 2021 by Julien Steffen (steffen@pctc.uni-kiel.de)
! Stefa... | {"hexsha": "90da4ba985d49be51aa019be9887a6ca8eb6765b", "size": 4604, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/ff_nonb_two.f90", "max_stars_repo_name": "Trebonius91/EVB-QMDFF", "max_stars_repo_head_hexsha": "8d03e1ad073becb0161b0377b630d7b65fe3c290", "max_stars_repo_licenses": ["MIT", "Unlicense"], "... |
#! /usr/bin/env python
"""
Moduł zawiera klasę definiującą zbiór właściwości.
"""
import typing
from multiprocessing import Pool
import numpy
import numpy as np
from itertools import repeat
from bitmap.bitmap_grayscale import BitmapGrayscale
from feature.feature import Feature
import pickle
class FeatureExtracto... | {"hexsha": "4b478c936e5e7c7eeb33f28cbc3c74318f301115", "size": 3024, "ext": "py", "lang": "Python", "max_stars_repo_path": "feature_extractor/feature_extractor.py", "max_stars_repo_name": "smogork/TAiO_ImageClassification", "max_stars_repo_head_hexsha": "14b2f6e707475b45e936a8ddd4345309aaef78f2", "max_stars_repo_licens... |
using Test
using Transpiler
@testset "Unit tests - python" begin
end
| {"hexsha": "4c64dc10e9574e726f668e1737d575a0a2785c2e", "size": 71, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/unit/runtests.jl", "max_stars_repo_name": "charleskawczynski/Transpiler.jl", "max_stars_repo_head_hexsha": "8cc34acd849aa982a4ab09c3f31ddb345f154fbd", "max_stars_repo_licenses": ["MIT"], "max_st... |
# 13 Root Finding
An important tool in the computational tool box is to find roots of equations for which no closed form solutions exist:
We want to find the roots $x_0$ of
$$
f(x_0) = 0
$$
## Problem: Projectile range
The equations of motion for the projectile with linear air resistance (see *12 ODE applications*... | {"hexsha": "ca7df84862923f8c3c48343b9435bc090404f99c", "size": 176200, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "13_root_finding/.ipynb_checkpoints/13-Root-finding-checkpoint.ipynb", "max_stars_repo_name": "nachrisman/PHY494", "max_stars_repo_head_hexsha": "bac0dd5a7fe6f59f9e2ccaee56ebafcb7d97... |
/******************************************************************************
* Copyright 2019 The Apollo 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
... | {"hexsha": "40c1ddbd8d1dfdf41df225b9a7bcb2c9de0f5af7", "size": 7558, "ext": "cc", "lang": "C++", "max_stars_repo_path": "modules/localization/msf/local_pyramid_map/pyramid_map/pyramid_map_test.cc", "max_stars_repo_name": "yaominhappy/apollo", "max_stars_repo_head_hexsha": "9c7400b507b29dc114f7a30322949c26de384edc", "ma... |
[STATEMENT]
lemma prod_mset_prime_factorization:
assumes "x \<noteq> 0"
shows "prod_mset (prime_factorization x) = normalize x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<Prod>\<^sub># (prime_factorization x) = normalize x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a... | {"llama_tokens": 223, "file": null, "length": 2} |
[STATEMENT]
lemma mpi_algo_eq_mpi:
assumes "d \<in> D\<^sub>D" "v \<le> \<L>\<^sub>b v" "eps > 0"
shows "mpi_algo d v m = mpi d v m (LEAST n. 2 * l * dist (mpi_val d v m n) (\<L>\<^sub>b (mpi_val d v m n)) < eps * (1 - l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. mpi_algo d v m = mpi d v m (LEAST n. 2 * l... | {"llama_tokens": 10307, "file": "MDP-Algorithms_Modified_Policy_Iteration", "length": 34} |
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
from openalpr import Alpr
from distutils.version import StrictVersion
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
fro... | {"hexsha": "c4d53f686b8dc3d887ed2d64980c6c0db5cb322d", "size": 7448, "ext": "py", "lang": "Python", "max_stars_repo_path": "Objectdete&PlateDete.py", "max_stars_repo_name": "FrankDidier/Object-and-plate-number-detection-recognition-", "max_stars_repo_head_hexsha": "6dd96e5fd2dd26e7838aa23ffcea9935d21ce807", "max_stars_... |
import cv2
import numpy as np
from plantcv.plantcv import invert
def test_invert(test_data):
"""Test for PlantCV."""
# Read in test data
img = cv2.imread(test_data.small_bin_img, -1)
inverted_img = invert(gray_img=img)
total_px = img.shape[0] * img.shape[1]
expected = total_px - np.count_nonze... | {"hexsha": "74cf7ddebff6c82affe98e78fa2245274f4acc5d", "size": 382, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/plantcv/test_invert.py", "max_stars_repo_name": "ygarrot/plantcv", "max_stars_repo_head_hexsha": "e934a891e0d1bf8987ca6a9f982a4ac1f420bfe7", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
from environment import Environment
from numpy.random import choice
class Agent():
def __init__(self):
self.total_reward = 0.0
def step(self, env=Environment()):
state = env.get_current_state()
action = choice(env.get_actions(), 1, p=[0.5, 0.5])
env.perform_action(state, i... | {"hexsha": "42a63635e726ff6ba74b0fc530f2dc8f40dea29b", "size": 332, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/Random_walk/agent.py", "max_stars_repo_name": "aliasgar-m/Reinforcement-Learning", "max_stars_repo_head_hexsha": "b9751dddf45388f8e3f134856f5421fc050d39c4", "max_stars_repo_licenses": ["MIT"], ... |
# Setting up a Demand Function
## 1. Why do we need it?
paminco allows to compute parametric minimum cost flows (MCF) w.r.t. to demand multiplier $\lambda$. I.e., the goal is to find a MCF for all values of $\lambda$ in the interval $\left[0, \lambda^{\max }\right]$:
$$
\begin{align*}
\min \text { } & C(\mathbf{... | {"hexsha": "d92307b4626778927a21f6a3dd175e46fd8096dd", "size": 20201, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "docs/source/user_guide/network_setup/howto_set_demand.ipynb", "max_stars_repo_name": "paminco/paminco", "max_stars_repo_head_hexsha": "2b8da7cc83adde3c72af5150cf6d7294ff6fd29e", "max... |
import pandas as pd
import numpy as np
import sys, os
from tensorflow.keras import datasets
sys.path.insert(1, '../../_network')
from layers import Network_V2, Dense_V2
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
class Network:
def __init__(self, hidden_shape, sigma=... | {"hexsha": "7647ed59022164904af6ec5a2670e482bd7e5360", "size": 2752, "ext": "py", "lang": "Python", "max_stars_repo_path": "deep_learning/artificial_neural_networks/radial_basis_network/sample_scratch.py", "max_stars_repo_name": "niektuytel/Machine_Learning", "max_stars_repo_head_hexsha": "0cd5656ca8076c383fd81c5e32a49... |
#define _GLIBCXX_USE_CXX11_ABI 1
#define BOOST_TEST_MODULE TestReadParquet
#define BOOST_TEST_DYN_LINK
#include <iostream>
#include <thread>
#include <string>
#include <vector>
#include "enumeratePairs.hpp"
#include <boost/test/unit_test.hpp>
using std::string;
BOOST_AUTO_TEST_CASE(read_parquet) {
std::vector<... | {"hexsha": "13dbbff4e68885ae7481f12794fc6753e7653004", "size": 956, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "cooccurrenceMatrix/tests/testGeneratePairs.cpp", "max_stars_repo_name": "rusheniii/ppmi-svd", "max_stars_repo_head_hexsha": "bb9eb27712228f7c4f5e329809643d00bf0bf906", "max_stars_repo_licenses": ["BS... |
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from Utils.Helpers import *
idx_experiment = 8
training_hist_path = Path(f'experiments/experiment_{idx_experiment}/training_history.pkl')
training_hist = load_pickle_obj(training_hist_path)
settings_path = Path(f'experiments/experiment_{idx_ex... | {"hexsha": "b75c151cc0cdbad48910359c55b3506cbb58d003", "size": 770, "ext": "py", "lang": "Python", "max_stars_repo_path": "show_training_history.py", "max_stars_repo_name": "rinkwitz/Thesis_Semantic_Image_Segmentation_on_Satellite_Imagery_using_UNets", "max_stars_repo_head_hexsha": "75d3a4a536f6ef81fe0efd4f5fbba32b627a... |
SUBROUTINE inpd21 (task, nelem, nelms, iwrit, elsnam)
!*** READ control DATA
USE curv_db, ONLY : nlcur
USE ctrl_db, ONLY : ntype
USE c_input
USE ele21_db
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN):: task
CHARACTER(len=*),INTENT(IN):: elsnam
INTEGER (kind=4) nelem,nelms,iwrit
INTEGER... | {"hexsha": "fb9a26dbecf33752afd0c83c593daad99d9118f5", "size": 1784, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/ele21/inpd21.f90", "max_stars_repo_name": "jerebenitez/IFE-simpact-openfoam", "max_stars_repo_head_hexsha": "2dbcbf3195b22fca1c80ad0da6b3822b6cad5cdf", "max_stars_repo_licenses": ["MIT"], "m... |
\begin{sitedescription}{SRL}
Dedicated to tackling scientific challenges with long-term impact and of genuine importance to real life, Simula Research Laboratory (Simula) offers an environment that emphasises and promotes basic research. At the same time, we are deeply involved in research education and application-dr... | {"hexsha": "2f2532fd2066f614c08a79047848acf7ed16397c", "size": 3444, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Participants/Simula.tex", "max_stars_repo_name": "takluyver/bossee-proposal", "max_stars_repo_head_hexsha": "cb7db4be878205dc402a5c7253fb76b477631e31", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
from ledfx.utils import BaseRegistry, RegistryLoader
from abc import abstractmethod
from threading import Thread
from ledfx.events import DeviceUpdateEvent, Event
import voluptuous as vol
import numpy as np
import importlib
import pkgutil
import logging
import time
import os
import re
_LOGGER = logging.getLogger(__nam... | {"hexsha": "4877a3628c48ef08db535b9a8489e2e9bcc30a90", "size": 6737, "ext": "py", "lang": "Python", "max_stars_repo_path": "ledfx/devices/__init__.py", "max_stars_repo_name": "danhartfiction/LedFx", "max_stars_repo_head_hexsha": "eaf40ab180ef7e8f4f769193b35b3ffd5fe2a340", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
subroutine dspg(n,x,m,eps,eps2,maxit,maxfc,output,f,cginfn,cgtwon,
+ iter,fcnt,gcnt,flag)
C Subroutine SPG implements the Spectral Projected Gradient
C Method (Version 2: "feasible continuous projected path") to
C find the local minimizers of a given function with convex
C ... | {"hexsha": "ca31116b11f55558c199922ffe7aade7bb1b8376", "size": 13858, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "arpack/SRC/dspg.f", "max_stars_repo_name": "GEOS-ESM/GMAO_Shared", "max_stars_repo_head_hexsha": "022af23abbc7883891006b57379be96d9a50df23", "max_stars_repo_licenses": ["NASA-1.3", "ECL-2.0", "Ap... |
""" Convolutional Neural Network @D image of skeletal formula model for logP """
import os
from utils.build_dataset import get_data
from utils.misc import f1_score, plot_data, save_history
import tensorflow as tf
import numpy as np
import keras
from keras.utils import multi_gpu_model
from keras.initializers import gl... | {"hexsha": "e1c805452d5ad78865f971b69d82f72d4b74ebd5", "size": 11155, "ext": "py", "lang": "Python", "max_stars_repo_path": "incep_resnet_tox21_50.py", "max_stars_repo_name": "xcccelia/Project-CS230", "max_stars_repo_head_hexsha": "7457e0719e5decac7ebedc6a9b046c793f3d852d", "max_stars_repo_licenses": ["MIT"], "max_star... |
#import plotly.graph_objects as go
import plotly.graph_objs as go
import numpy as np
N = 75000
N=1000
fig = go.Figure()
fig.add_trace(
go.Scatter(
x = np.random.randn(N),
y = np.random.randn(N),
mode = 'markers',
marker = dict(
line = dict(
width = 1,
... | {"hexsha": "d63b606a198d094ec2a9acccf2346717d3ca81c7", "size": 449, "ext": "py", "lang": "Python", "max_stars_repo_path": "plotly_extra/scatter.py", "max_stars_repo_name": "rheiland/pc4biorobots_plotly", "max_stars_repo_head_hexsha": "e1b75b17cb049aa1381ed0e70baab2cd5cd050b5", "max_stars_repo_licenses": ["BSD-3-Clause"... |
# coding=utf-8
# Author: Rion B Correia
# Date: Aug 06, 2019
#
# Description: Dispalys Statistics about number of genes (including DGE) we found for each species
#
# Instructions:
#
import math
# import numpy as np
import pandas as pd
pd.set_option('display.max_rows', 100)
pd.set_option('display.max_columns', 500)
pd.s... | {"hexsha": "bf64ef33edbcce10dbc461def14411dfc5a3bb0f", "size": 16633, "ext": "py", "lang": "Python", "max_stars_repo_path": "02-core_genes/99s-stats_genes.py", "max_stars_repo_name": "rionbr/meionav", "max_stars_repo_head_hexsha": "3e0cca6bea206023ea3a3b322c5bfdd2081e9842", "max_stars_repo_licenses": ["MIT"], "max_star... |
# coding=utf-8
# Copyright (c) 2020 Alibaba PAI team.
#
# 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": "3e75a69f752aaeba368fc91cd2b6a5730af65edb", "size": 15376, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/mell/core/evaluator.py", "max_stars_repo_name": "zhenhua32/EasyTransfer", "max_stars_repo_head_hexsha": "07940087b80b7dc001fb688c81d9420a2055a2bd", "max_stars_repo_licenses": ["Apache-2.0... |
import numpy as np
# transform the feature vector
def score_model(x, significant, to_significant):
mul = 1/(to_significant-significant+1)
total = 0.0
for sig in range(significant,to_significant,1):
total += np.round(x,sig)
return total * mul
def face_recognize_risk(risk_difference=None, risk_v... | {"hexsha": "3f67df60f14285d34935eb6b22e86b7f9e4ef8e3", "size": 1033, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/object_detection/keras/face_recognition_aspect/inference/score.py", "max_stars_repo_name": "Intel-OpenVINO-Edge-AI-Scholarship/intelai-models-benchmarking", "max_stars_repo_head_hexsha": "e... |
from __future__ import print_function
import numpy as np
from matplotlib import pyplot as plt
from graphs.construction import neighbor_graph
if hasattr(__builtins__, 'raw_input'):
input = raw_input
def main():
print("Select coordinates for graph vertices:")
plt.plot([])
coords = np.array(plt.ginput(n=-1, tim... | {"hexsha": "799c622b87c998b3745550d6a1b5366b76a689fe", "size": 519, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/interactive.py", "max_stars_repo_name": "vishalbelsare/graphs", "max_stars_repo_head_hexsha": "4fbeb025dfe33340335f34300f58dd3809228822", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
#Funcion que calcula la matriz resultante después de aplicar la operacion Convolusion de A*B.
import numpy as np
def convolusion(A,B):
C2 = []
contadorRen = 0
while (len(B)) + contadorRen <= (len(A)):
C =[]
contadorCol = 0
while (len(B[0]) + contadorCol )<= (len(A[0]))... | {"hexsha": "6bbfea836c7da017a949b4d326512cb4ff5b9b92", "size": 1033, "ext": "py", "lang": "Python", "max_stars_repo_path": "miconvolusion.py", "max_stars_repo_name": "a01745865/hcap-prueba", "max_stars_repo_head_hexsha": "3dfbc856fed086a64825d695b9ec36d51077f9e5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
###########################################################################
# Imports
###########################################################################
# Standard library imports
import os
import time
import numpy as np
import matplotlib.pyplot as plt
########################################################... | {"hexsha": "b6a9db1a1cc70fdd880599b953cdd14de9c5c3b4", "size": 9766, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/simulated_annealing/simple_simulated_annealing.py", "max_stars_repo_name": "auvapr/Museum-Path-Optimization", "max_stars_repo_head_hexsha": "ff2c13b74d76f893fd4c3e5b184529f201ee9d80", "max_st... |
# flake8: noqa
import time
import numpy
import pytest
from skimage.metrics import structural_similarity as ssim
from aydin.io.datasets import normalise, add_noise, add_blur_2d, characters
from aydin.it.deconvolution.lr_deconv_tf import ImageTranslatorLRDeconvTensorflow
from aydin.util.log.log import lsection, lprint,... | {"hexsha": "8ad8af4f61ae57b5a82f314e7e72f9dec7847ee2", "size": 1926, "ext": "py", "lang": "Python", "max_stars_repo_path": "aydin/it/deconvolution/test/test_lr_2D_tf.py", "max_stars_repo_name": "royerloic/aydin", "max_stars_repo_head_hexsha": "f9c61a24030891d008c318b250da5faec69fcd7d", "max_stars_repo_licenses": ["BSD-... |
import numpy as np
import multiprocessing
import itertools as it
import collections as coll
from functools import partial
import logging
import h5py
import scipy.ndimage as nd
from scipy.sparse import coo_matrix
from scipy.ndimage.measurements import label
from scipy.spatial.distance import pdist, cdist, squareform
fro... | {"hexsha": "ca4568f36360ef8768b039f4651b88e95f1e9f0c", "size": 13197, "ext": "py", "lang": "Python", "max_stars_repo_path": "raveler/ray/ray/evaluate.py", "max_stars_repo_name": "VCG/gp", "max_stars_repo_head_hexsha": "cd106b604f8670a70add469d41180e34df3b1068", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
from sklearn.metrics import accuracy_score
import argparse
import numpy as np
import pandas as pd
import json
parser = argparse.ArgumentParser()
parser.add_argument('--library', choices=['h2o', 'lightgbm', 'sklearn', 'xgboost', 'catboost'], required=True)
args = parser.parse_args()
# Load the data.
path_train = 'data... | {"hexsha": "d1f284fb87c772cc34208af9b4aa04864fa49842", "size": 2628, "ext": "py", "lang": "Python", "max_stars_repo_path": "crates/tree/benchmarks/iris.py", "max_stars_repo_name": "OneToolsCollection/tangramdotdev-tangram", "max_stars_repo_head_hexsha": "666343a87b88a1c1b34a4be2298f6aa54f0fc2eb", "max_stars_repo_licens... |
import gc
import os
import time
from typing import Union
import numpy as np
import torch
import torch.nn as nn
from tqdm import tqdm
from torch.cuda import amp
def load_model(
network,
optimizer: torch.optim.Optimizer,
scheduler: torch.optim.lr_scheduler,
recorder,
model_dir: str,
resume: boo... | {"hexsha": "529abda1f307a905fd0fd6a1a5275f3656a68e29", "size": 12244, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/utils/net_utils.py", "max_stars_repo_name": "rurusasu/OrigNet", "max_stars_repo_head_hexsha": "3b3384cb3d09b52c7c98bb264901285f006e51c1", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
import numpy as np
import time
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.colors as mcolors
from Ritoapi import Ritoapi
## map data domains
xmin = -120
xmax = 14870
ymin = -120
ymax = 14980
xdomain = xmax - xmin
ydomain = ymax - ymin
## plot range = image pixels w & h
xrange ... | {"hexsha": "2596162dd0b3116d402eacdb3d7695b578f32011", "size": 2105, "ext": "py", "lang": "Python", "max_stars_repo_path": "RankedDeathTracker/RankedDeathTracker.py", "max_stars_repo_name": "cptdagon/RankedDeathTracker", "max_stars_repo_head_hexsha": "c8bd067c99e1b3a38b5c341705b00b28bb7114e3", "max_stars_repo_licenses"... |
"""Stochastic optimization (SO) problem equivalent for DRO problem."""
import numpy as np
import os
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import mesmo
from dro_stage_1 import Stage1
from dro_stage_2 import Stage2
from dro_data_interface import DRODataSet
from dro_data_inter... | {"hexsha": "9fbcb012cd756a867a06e9e3e6586ed6adab1a4f", "size": 5198, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/publications/paper_2021_zhang_distributionally_robust_optimization/so_main.py", "max_stars_repo_name": "TUMCREATE-ESTL/FLEDGE.jl", "max_stars_repo_head_hexsha": "c89c704231687085acd1a88c6... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from hypothesis import given, assume
import hypothesis.strategies as st
from itertools import izip
from caffe2.python import core, model_helper, brew
import caffe2.python.hypothesis_test_uti... | {"hexsha": "5d626ff073d04ab40de834c8fed2e8ec7a1f4683", "size": 9785, "ext": "py", "lang": "Python", "max_stars_repo_path": "caffe2/python/operator_test/instance_norm_test.py", "max_stars_repo_name": "kyper999/caffe2-2", "max_stars_repo_head_hexsha": "7c10b470de8d19261f10e958846d7efcfd751a09", "max_stars_repo_licenses":... |
/-
Copyright (c) 2019 Yury Kudryashov. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Yury Kudryashov
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.algebra.group.type_tags
import Mathlib.algebra.group.units_hom
import Mathlib.algebra.ring... | {"author": "AurelienSaue", "repo": "Mathlib4_auto", "sha": "590df64109b08190abe22358fabc3eae000943f2", "save_path": "github-repos/lean/AurelienSaue-Mathlib4_auto", "path": "github-repos/lean/AurelienSaue-Mathlib4_auto/Mathlib4_auto-590df64109b08190abe22358fabc3eae000943f2/Mathlib/deprecated/group_auto.lean"} |
# -*- coding: utf-8 -*-
"""
使用Elman网络(简单局部回归网络)
@author: simon
"""
import sys,time
import numpy
import theano
import theano.tensor as T
import matplotlib.pyplot as plt
from collections import OrderedDict
import copy
import utilities.datagenerator as DG
reload(DG)
compile_mode = 'FAST_COMPILE'
# compile_mode = 'FAST_... | {"hexsha": "7b9ba82d5562398e86a172cadc0d0eb8b42781ab", "size": 9221, "ext": "py", "lang": "Python", "max_stars_repo_path": "MaskRNN_EKF.py", "max_stars_repo_name": "SimonHL/TSA", "max_stars_repo_head_hexsha": "735a720a61443d35de580e0e737b325fa1699a8d", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count": nul... |
/-
Copyright (c) 2021 Gabriel Moise. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Moise, Yaël Dillies, Kyle Miller
-/
import combinatorics.simple_graph.basic
import data.matrix.basic
/-!
# Incidence matrix of a simple graph
This file defines the unoriented ... | {"author": "saisurbehera", "repo": "mathProof", "sha": "57c6bfe75652e9d3312d8904441a32aff7d6a75e", "save_path": "github-repos/lean/saisurbehera-mathProof", "path": "github-repos/lean/saisurbehera-mathProof/mathProof-57c6bfe75652e9d3312d8904441a32aff7d6a75e/src/tertiary_packages/mathlib/src/combinatorics/simple_graph/in... |
//
//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// h... | {"hexsha": "b12ba1005d2a5301f6784410d7d1a6c9f65ca2fd", "size": 1229, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "boost/boost/graph/transpose_graph.hpp", "max_stars_repo_name": "randolphwong/mcsema", "max_stars_repo_head_hexsha": "eb5b376736e7f57ff0a61f7e4e5a436bbb874720", "max_stars_repo_licenses": ["BSD-3-Cla... |
# compiler driver and main interface
# NOTE: the keyword arguments to compile/codegen control those aspects of compilation that
# might have to be changed (e.g. set libraries=false when recursing, or set
# strip=true for reflection). What remains defines the compilation job itself,
# and those values... | {"hexsha": "4e1762b79726eda412107bb07dd16e5c163e9e07", "size": 13209, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/driver.jl", "max_stars_repo_name": "JuliaGPU/GPUCompiler.jl", "max_stars_repo_head_hexsha": "f1fd912126ab4400fc245a216f10163805035420", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6... |
[STATEMENT]
lemma covisi:"ov^-1 O s^-1 \<subseteq> b^-1 \<union> m^-1 \<union> ov^-1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ov\<inverse> O s\<inverse> \<subseteq> b\<inverse> \<union> m\<inverse> \<union> ov\<inverse>
[PROOF STEP]
using csov
[PROOF STATE]
proof (prove)
using this:
s O ov \<subseteq> b \<uni... | {"llama_tokens": 198, "file": "Allen_Calculus_allen", "length": 2} |
[STATEMENT]
lemma const_StrictRefEq\<^sub>S\<^sub>e\<^sub>t_empty : "const X \<Longrightarrow> const (X \<doteq> Set{})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. const X \<Longrightarrow> const (X \<doteq> Set{})
[PROOF STEP]
apply(rule StrictRefEq\<^sub>S\<^sub>e\<^sub>t.const, assumption)
[PROOF STATE]
proo... | {"llama_tokens": 164, "file": "Featherweight_OCL_collection_types_UML_Set", "length": 2} |
# User inputs relevant directories and a model catalog
# System loops over the directories and intelligently populates catalog
import os
import numpy as np
from astropy.io import fits
from astropy.table import Table, Column, join, hstack
WORKING_DIR = '/Volumes/WD4/Current/COSMOS2020/data/output/catalogs/candide/cosm... | {"hexsha": "e7d8707f141bbccb87a8045feb56e2525f8590ef", "size": 9972, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tools/smart_collector.py", "max_stars_repo_name": "astroweaver/dev-tractor-pipeline", "max_stars_repo_head_hexsha": "5535380cf0c1838a282aa872da010767fbb65e73", "max_stars_repo_licenses": ["BSD... |
import cedille-options
open import general-util
module classify (options : cedille-options.options) {mF : Set → Set} {{_ : monad mF}} where
open import lib
open import cedille-types
open import constants
open import conversion
open import ctxt
open import is-free
open import lift
open import rename
open import rewrit... | {"hexsha": "32125a2e6dbff2c453c7c20f7259ea1ce1ff2561", "size": 90327, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "src/classify.agda", "max_stars_repo_name": "xoltar/cedille", "max_stars_repo_head_hexsha": "acf691e37210607d028f4b19f98ec26c4353bfb5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
# Simple visualizer of vehicle trajectory in svg format.
import numpy as np
# set svg template path
SVG_TEMPLATE_PATH = '../template/svg_template.svg'
def svg_visualizer(timestamp, car_x_ary, car_y_ary, ref_x_ary, ref_y_ary, outputpath, svgtemplate=SVG_TEMPLATE_PATH):
# Set parameters
MARGIN_RATE = 10 # % of... | {"hexsha": "a372eaf7c5b1e76038a05757363fe3352096b7e3", "size": 3300, "ext": "py", "lang": "Python", "max_stars_repo_path": "include/svg_visualizer.py", "max_stars_repo_name": "MizuhoAOKI/motion_svg_visualizer", "max_stars_repo_head_hexsha": "409dc30474705cf318c2f8c25e8296faea455712", "max_stars_repo_licenses": ["MIT"],... |
export maxcol, myround, clip, clip!, trim, trim!, MINWEIGHT, MINPROB, sortcols
const MINWEIGHT = 1e-10 # trim() deletes prior points with less than this weight.
const MINPROB = 1e-100 # clip() sets to zero entries smaller than this.
const DIGITS = 5 ## digits to round off to when calling unique(), by default
using ... | {"hexsha": "661031d155b07419c02bd16e10e55bb97eddf620", "size": 7367, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/manip.jl", "max_stars_repo_name": "mcabbott/WeightedArrays.jl", "max_stars_repo_head_hexsha": "adbeff71b858aeac2f6890607d6fe44211c85266", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
[STATEMENT]
lemma loop_apx_least_fixpoint:
"apx.is_least_fixpoint (\<lambda>x . y * x \<squnion> z) (\<mu> (\<lambda>x . y * x \<squnion> z) \<squnion> n(\<nu> (\<lambda>x . y * x \<squnion> z)) * L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. order.is_least_fixpoint (\<sqsubseteq>) (\<lambda>x. y * x \<squnio... | {"llama_tokens": 772, "file": "Correctness_Algebras_Recursion_Strict", "length": 2} |
using Plots;gr()
T = 1000
dt = 0.001
y_0 = 0
g_0 = 1
function euler_method(y_0, g_0, T, dt)
y = zeros(T)
y[1] = y_0
f = y_0
g = g_0
for t = 1:T-1
y[t+1] = y[t] + dt*g
g = g + dt*(6*g - 9*y[t+1])
end
y
end
exact_solution(t) = t*exp(3*t)
t = 0:dt:(T-1)dt
y = euler_method(... | {"hexsha": "4533c9f3aad9914f70f5cc507b9a08e223812382", "size": 536, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "ode/2nd_order_euler.jl", "max_stars_repo_name": "nocotan/numerical_calculus.jl", "max_stars_repo_head_hexsha": "76b46b22d04e2e7e82cf44788c4f48ce25d59847", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
import onnx
from onnx import TensorProto
from onnx import helper
_type_conversion = {
None: TensorProto.UNDEFINED,
np.float32: TensorProto.FLOAT,
np.uint8: TensorProto.UINT8,
np.int8: TensorProto.INT8,
np.uint16: TensorProto.UINT16,
np.int16: TensorProto.INT16,
np.int32: ... | {"hexsha": "97da627a94f40f1a2785bb83dba6f2001fa7fa49", "size": 5468, "ext": "py", "lang": "Python", "max_stars_repo_path": "builder/exporter.py", "max_stars_repo_name": "diyessi/onnx-builder", "max_stars_repo_head_hexsha": "537ff90a6ce82268404ad879479076e028cbc517", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy as np
import numpy.linalg as la
import numpy.random as npr
#from matrixmath import is_pos_def,mdot,specrad,minsv,sympart,dlyap,dare,solveb
import sys
sys.path.append("..")
from ltimult import LQRSys,LQRSysMult
from pickle_io import pickle_export
from time import time
import os
from utility import printo... | {"hexsha": "3acbc48d102203d8ef0aa2b7d0069a7f872dd76b", "size": 5628, "ext": "py", "lang": "Python", "max_stars_repo_path": "polgrad_multinoise/gradient_estimate_study/example_gradient_estimate_variance.py", "max_stars_repo_name": "TSummersLab/polgrad-multinoise", "max_stars_repo_head_hexsha": "c51a81212bc648256976a4696... |
import inviwopy
# import inviwopy.glm as glm
import numpy as np
import h5py
from envisionpy.utils.exceptions import *
from .baseNetworks.LinePlotSubnetwork import LinePlotSubnetwork
class Bandstructure(LinePlotSubnetwork):
'''
Manages a subnetwork for bandstructure visualisation.
Uses a default LinePlotSu... | {"hexsha": "95348eb1a9b1652c1f91914a985cdf414d14e292", "size": 771, "ext": "py", "lang": "Python", "max_stars_repo_path": "envisionpy/network/Bandstructure.py", "max_stars_repo_name": "adamskor/ENVISIoN", "max_stars_repo_head_hexsha": "95cf5e74411807e21909f1a0d47b52fd6318a855", "max_stars_repo_licenses": ["BSD-2-Clause... |
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from time import*
import warnings;warnings.filterwarnings('ignore')
class Sectional_measurement:
def __init__(self):
self.an_area = 0
self.all_area = 0
end_division = int(input("グラフ分割数 :"))
... | {"hexsha": "6ce69c1846432000a9d8c3f693b4c70f855871a1", "size": 2656, "ext": "py", "lang": "Python", "max_stars_repo_path": "sectional_measurement.py", "max_stars_repo_name": "TakuKitamura/sectional-mesurement", "max_stars_repo_head_hexsha": "1e9ef96eee15681524d1903a697d4ce411aa6880", "max_stars_repo_licenses": ["MIT"],... |
import numpy as np
from tf_explain.callbacks.activations_visualization import (
ActivationsVisualizationCallback,
)
def test_should_call_activations_visualization_callback(
random_data, convolutional_model, output_dir, mocker
):
mock_explainer = mocker.MagicMock(
explain=mocker.MagicMock(return_va... | {"hexsha": "e560df950153ebc99f756f1f06ecc75b617fc627", "size": 980, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/callbacks/test_activations_visualization.py", "max_stars_repo_name": "sicara/mentat", "max_stars_repo_head_hexsha": "fbcfbbe71042740f05e0b1e368bb747c8e0d10ee", "max_stars_repo_licenses": ["MI... |
import xarray as xr
import numpy as np
import scipy.interpolate
import dask as da
def interp_dim(x, scale):
x0, xlast = x[0], x[-1]
newlength = int(len(x) * scale)
y = np.linspace(x0, xlast, num=newlength, endpoint=False)
return y
def blocks(data, width=352):
#n = data.t.shape[0]
w = data.x.sh... | {"hexsha": "360f8b64a66cb027b6cb925f967f53809b8fb0ee", "size": 3328, "ext": "py", "lang": "Python", "max_stars_repo_path": "windflow/datasets/utils.py", "max_stars_repo_name": "tjvandal/windflow", "max_stars_repo_head_hexsha": "20eee2b04ca983ba1fe6399f30f7ebd67dc68b5b", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import os
import logging
import joblib
import numpy as np
from torch.optim import SGD
from torch.utils.data import TensorDataset
from scipy.sparse import csr_matrix
from sklearn.neighbors import NearestNeighbors
from annoy import AnnoyIndex
from knodle.transformation.majority import input_to_majority_vote_input
fro... | {"hexsha": "279ff95897cf7bd024564ba4177a08debc001d98", "size": 6242, "ext": "py", "lang": "Python", "max_stars_repo_path": "knodle/trainer/knn_aggregation/knn.py", "max_stars_repo_name": "michael-aloys/knodle", "max_stars_repo_head_hexsha": "393e7ba0558036828fb228875511977c40000ed5", "max_stars_repo_licenses": ["Apache... |
import cv2
import mediapipe as mp
import numpy as np
import csv
import os # importing os module
from glob import glob
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_pose = mp.solutions.pose
# CSV Header
fieldnames = ['left_shoulder_x', 'left_shoulder_y', 'right_shoulder_x',... | {"hexsha": "04ff9b12b552c41d9845506afbe0832ef39beea3", "size": 7958, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/extractor.py", "max_stars_repo_name": "VengSW/ICARE", "max_stars_repo_head_hexsha": "e538952d839c685b09a43d9b842b86e3e1fea9ca", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
#!/usr/bin/env python
# ######################################################################################################################
#
#
# Compute TSNR using inputed anat.nii.gz and fmri.nii.gz files.
#
# ---------------------------------------------------------------------------------------------------------... | {"hexsha": "2e6eda9487f708efc92c31928d247587e3c67b48", "size": 3438, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/sct_fmri_compute_tsnr.py", "max_stars_repo_name": "valosekj/spinalcordtoolbox", "max_stars_repo_head_hexsha": "266bfc88d6eb6e96a2c2f1ec88c2e185c6f88e09", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
import torch
import torchvision
from matplotlib import pyplot as plt
from torch import nn
from torchvision import models
from torch.utils import data
import torchvision.transforms as transforms
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import KFol... | {"hexsha": "9c1980e86e6f46dac72b3ee9e08ce7956988d838", "size": 4680, "ext": "py", "lang": "Python", "max_stars_repo_path": "cv/classification/caggleTest/leavesClassification/resNet50 pretrained=T.py", "max_stars_repo_name": "XingJinming-real/DL", "max_stars_repo_head_hexsha": "9c793338a60b663ab3cdc702dc73617156b4ae93",... |
||| Turns and segment logic
module Bautzen.Game.Turn
import Bautzen.Combats
import Bautzen.GameUnit
import Bautzen.Game.Core
import Bautzen.Pos
import Bautzen.Terrain
import Data.Fin
public export
newTurn : Game -> Either GameError Event
newTurn (MkGame _ (MkGameState FZ _ _ _) _) = Right GameEnded
newTurn (MkGame _... | {"hexsha": "4911053188ee5ce1932ee0ee5ac602a459837ff8", "size": 1248, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "bautzen1945/idris/Bautzen/Game/Turn.idr", "max_stars_repo_name": "steshaw/hsgames", "max_stars_repo_head_hexsha": "4cf8cd02fcc93d1e030144676e2e1cbf9da2514f", "max_stars_repo_licenses": ["Apache-2.... |
/-
Copyright (c) 2019 Reid Barton. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Reid Barton
-/
import topology.category.Top.adjunctions
/-!
# Epi- and monomorphisms in `Top`
This file shows that a continuous function is an epimorphism in the category of topological... | {"author": "leanprover-community", "repo": "mathlib", "sha": "5e526d18cea33550268dcbbddcb822d5cde40654", "save_path": "github-repos/lean/leanprover-community-mathlib", "path": "github-repos/lean/leanprover-community-mathlib/mathlib-5e526d18cea33550268dcbbddcb822d5cde40654/src/topology/category/Top/epi_mono.lean"} |
import numpy as np
def congruent_linear_generator(a : int, m : int, c : int, x0 : int):
"""
:def: Linear Congruent Generator Technique
: Method to generate pseudo-randoms
:
:param a: Random Parameter
:type a: int
:param c: Constant used to create bigger variation of generated numbers
... | {"hexsha": "22c56b648c8eaafbe598cd7b09f5e14f6e9b0c1b", "size": 1038, "ext": "py", "lang": "Python", "max_stars_repo_path": "components/LCG.py", "max_stars_repo_name": "felipeboffnunes/Discrete-Event-Simulation", "max_stars_repo_head_hexsha": "378c736ea9aa661d2660b5feed4131690df5c60d", "max_stars_repo_licenses": ["MIT"]... |
theory CC_Explain2_Termination
imports CC_Explain2_Definition
begin
section \<open>Termination of \<open>cc_explain2\<close>\<close>
subsection \<open>Invariant definition for \<open>timestamps\<close>\<close>
function (domintros) path_to_c :: "nat list \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat list"
... | {"author": "reb-ddm", "repo": "congruence-closure-isabelle", "sha": "fcc4964ff2d19fbea4da76029bb0619f84bac724", "save_path": "github-repos/isabelle/reb-ddm-congruence-closure-isabelle", "path": "github-repos/isabelle/reb-ddm-congruence-closure-isabelle/congruence-closure-isabelle-fcc4964ff2d19fbea4da76029bb0619f84bac72... |
import networkx as nx
def edges(path):
with open(path) as f:
for edge in f.readlines():
yield edge.strip().split(')')
def graph(path):
G = nx.Graph()
for pr in edges(path):
G.add_edge(*pr)
return G
def minimal_orbital_transfers(g, you='YOU', santa='SAN'):
return len(nx.shortest_path(g, you, santa)) - 3... | {"hexsha": "261dab9958a6563fbf99109032cc2b7a883e961e", "size": 614, "ext": "py", "lang": "Python", "max_stars_repo_path": "aoc2019/python/day06.py", "max_stars_repo_name": "austinsalonen/advent_of_code", "max_stars_repo_head_hexsha": "c085a813511ace023620739f367948c58e7ca5e7", "max_stars_repo_licenses": ["MIT"], "max_s... |
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// 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://kylelutz.gi... | {"hexsha": "8b10bf0b64eb10d4e484e76089dbca566e80ba86", "size": 1722, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/compute/algorithm/detail/find_extrema.hpp", "max_stars_repo_name": "bastiankoe/compute", "max_stars_repo_head_hexsha": "57eec36d20e122a496d3fbfddf8bf4ad8d6f4a4f", "max_stars_repo_licen... |
import os
import time
import torch
import random
import datetime
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from typing import List
from logging import INFO
from logger_factory import logger_factory
from sklearn.model_selection import train_test_split
from keras.prepr... | {"hexsha": "abdc553ede85b518dce8c427c3df0ced96d74904", "size": 14798, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/finetuner.py", "max_stars_repo_name": "lukaschoebel/BERT", "max_stars_repo_head_hexsha": "aa7ef93f161d30a98ad120735f1d7f89e3ce8c88", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
MODULE dtran2_I
INTERFACE
!...Generated by Pacific-Sierra Research 77to90 4.4G 09:48:01 03/09/06
SUBROUTINE dtran2 (R, T, IOPER)
USE vast_kind_param,ONLY: DOUBLE
REAL(DOUBLE), DIMENSION(3,3), INTENT(INout) :: R
REAL(DOUBLE), DIMENSION(5,5,12), INTENT(inOUT) :: T
... | {"hexsha": "6a6f70fc7d1d3171d00b2eec32d9d423235d6715", "size": 420, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "2006_MOPAC7.1/src_interfaces/dtran2_I.f90", "max_stars_repo_name": "openmopac/MOPAC-archive", "max_stars_repo_head_hexsha": "01510e44246de34a991529297a10bcf831336038", "max_stars_repo_licenses": ... |
// Copyright 2014 by BBN Technologies Corp.
// All Rights Reserved.
#include "Generic/common/leak_detection.h"
#include "Generic/theories/FactSet.h"
#include "Generic/theories/Fact.h"
#include <boost/make_shared.hpp>
#include <boost/foreach.hpp>
FactSet::FactSet() { }
FactSet::~FactSet() { }
void F... | {"hexsha": "944404167292ba4540f17cc04e8be3e31b13c3d0", "size": 1497, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/Generic/theories/FactSet.cpp", "max_stars_repo_name": "BBN-E/serif", "max_stars_repo_head_hexsha": "1e2662d82fb1c377ec3c79355a5a9b0644606cb4", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
#' @title Category Plot Table Data
#' @description Transform category plot data for printing in a report table
#' @param plot_data dataframe with "identifier", "timepoint" and category columns,
#' @return dataframe transformed for printing in an individual report
#' @import dplyr
#' @export
category_plot_table_data <-... | {"hexsha": "d168a569cea386b153f8b0e9e22e50c78861a803", "size": 625, "ext": "r", "lang": "R", "max_stars_repo_path": "R/category_plot_table_data.r", "max_stars_repo_name": "Landis-Lewis-Lab/goals-of-care", "max_stars_repo_head_hexsha": "6c7ac3a021ca97379cb0229845f9395a554bea3b", "max_stars_repo_licenses": ["Apache-2.0"]... |
import os
import json
import yaml
import csv
import numpy as np
import tensorflow as tf
from google.protobuf import text_format
from object_detection.protos import pipeline_pb2
def get_default_params(model):
with open('defaults.json', 'r') as f:
default_dict = json.load(f)
return default_dict[model].c... | {"hexsha": "70f56a922facadd3c88f5beb80c4e4ec57789407", "size": 16075, "ext": "py", "lang": "Python", "max_stars_repo_path": "workflows/tf-object-detection-training/utils.py", "max_stars_repo_name": "onepanelio/templates", "max_stars_repo_head_hexsha": "8032b68ae343abece91bc737350b5368680887a9", "max_stars_repo_licenses... |
context("apply_lag")
library(mnmacros)
#library(testthat)
data <- data.frame(
a = c(1,2,3,4),
b = c(2,3,4,5),
c = c(4,5,6,7)
)
actual <- data %>% apply_lag(hold = "a", move = "b", lag = 0)
expected <- data.frame(
a = c(1,2,3,4),
b = c(2,3,4,5)
)
expect_equal(actual, expected)
actual <- data %>% apply_lag(... | {"hexsha": "50b3412d01665fce8aedb10f786bb55075d54a7c", "size": 942, "ext": "r", "lang": "R", "max_stars_repo_path": "tests/testthat/test.apply_lag.r", "max_stars_repo_name": "yushuqi/mndredge", "max_stars_repo_head_hexsha": "9a6a26d4537e557ee58ce290b83daca60e2b4a3d", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import tensorflow as tf
import os
import argparse as _argparse
from PIL import Image
import numpy as np
import collections
import copy
import random
from tqdm import tqdm
def list_check(src, dst):
if len(src) != len(dst):
return False
for idx, s in enumerate(src):
if s != dst[idx]:
... | {"hexsha": "525a36eff6528744c7d69b5246a142f20c9166ea", "size": 12208, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/prepro.py", "max_stars_repo_name": "tdtt0507/Background-Generator-with-Tensorflow", "max_stars_repo_head_hexsha": "bf5deea555355a5f51f04c7213eda6e91840a6a3", "max_stars_repo_licenses": ["MIT"... |
import numpy as np
from impala import superCal as sc
import matplotlib.pyplot as plt
import pyBASS as pb
import fdasrsf as fs
import pandas as pd
np.seterr(under='ignore')
#############################################################################
# TODO:
# Warping diagnostics
# Emulator diagnostics
# Be... | {"hexsha": "9bf9622acd68c8faa6e95479dc8f61fbd263f78e", "size": 15457, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/shpb-flyer-Al5083_pooled.py", "max_stars_repo_name": "lanl/impala", "max_stars_repo_head_hexsha": "dec3c2e0584d7e58da325549dccf2667fee71002", "max_stars_repo_licenses": ["BSD-3-Clause"],... |
"""
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license
(https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import numpy as np
from collections import OrderedDict
from numpy.core.fromnumeric import nonzero
import torch
from torch import nn
from torch im... | {"hexsha": "e7492d970ae0b2f889a8ddfe8f44f390438e2e45", "size": 22926, "ext": "py", "lang": "Python", "max_stars_repo_path": "networks.py", "max_stars_repo_name": "cplusx/SIGN", "max_stars_repo_head_hexsha": "9777fc3ddd4c6f799caeefe1e72482d5b1ecd8ae", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": null, "... |
#!/usr/bin/env python
import argparse
import numpy as np
import scipy.io as sio
import os
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('thres_list')
parser.add_argument('save_file')
args = parser.parse_args()
with open(args.thres_list) as f:
thres_file... | {"hexsha": "76d09be9a3f569c4ec0ac9a6f0e7f07f4e79ca41", "size": 1019, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/detection/thres_recall_curve.py", "max_stars_repo_name": "myfavouritekk/T-CNN", "max_stars_repo_head_hexsha": "84789e411114fd4669e5a44d9ceeb0dde903efab", "max_stars_repo_licenses": ["MIT"], ... |
import os
import pandas as pd
from datetime import datetime
from scipy.stats.mstats import gmean
from dateutil.relativedelta import relativedelta
from server.models.portfolio.sent_analysis import SentimentAnalysis, predict
from server.models.portfolio.stats import *
from server.models.portfolio.cost import costs
from... | {"hexsha": "3897f1a9f477f8d915f499069f8449fa923d9792", "size": 11499, "ext": "py", "lang": "Python", "max_stars_repo_path": "server/models/portfolio/main.py", "max_stars_repo_name": "lluo5779/Robo-Adviser", "max_stars_repo_head_hexsha": "43aa4b73bfc96e55ed664328330a930975596124", "max_stars_repo_licenses": ["MIT"], "ma... |
# render a block of a RegressionTable
function render(io::IO, block::Array{String, 2}, colWidths::Vector{Int64}, align::String, settings::RenderSettings = asciiSettings; isHeader::Bool = false)
c = size(block,2)
if length(colWidths) != c
error("colWidths has invalid length.")
end
if ... | {"hexsha": "cba3409797239328647743770eff04ae9de141d8", "size": 4645, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/render.jl", "max_stars_repo_name": "grahamstark/RegressionTables.jl", "max_stars_repo_head_hexsha": "5d32ca1c0bead12b8dbf08fed03d9114c58a3b5e", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import nifty
import nifty.graph.agglo
import nifty.segmentation
import h5py
import numpy
import pylab
import vigra
# load affinities
w = 500
path_affinities = "/home/tbeier/nice_probs/isbi_test_offsetsV4_3d_meantda.h5"
offsets = numpy.array([
[-1, 0, 0], [0, -1, 0], [0, 0, -1], # direct 3d nhood for a... | {"hexsha": "fd2325bd53bbc57540d78c9b3208518e93c92155", "size": 3501, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/dagglo3.py", "max_stars_repo_name": "konopczynski/nifty", "max_stars_repo_head_hexsha": "dc02ac60febaabfaf9b2ee5a854bb61436ebdc97", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3... |
[STATEMENT]
lemma fun_set_rel_RUNIV[relator_props]:
assumes SV: "single_valued R"
shows "Range (\<langle>R\<rangle>fun_set_rel) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Range (\<langle>R\<rangle>fun_set_rel) = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. Range (\<lan... | {"llama_tokens": 1353, "file": "Collections_GenCF_Impl_Impl_Cfun_Set", "length": 17} |
"""Calculate filtering metrics for a dataset and store in a .hdf file.
"""
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# 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 rest... | {"hexsha": "0aa4156030e2f98a3a84f67be3070dc3e4e1f28e", "size": 6072, "ext": "py", "lang": "Python", "max_stars_repo_path": "samples/driver-oaas/facenet/src/calculate_filtering_metrics.py", "max_stars_repo_name": "tsh2/lib-python-databox2", "max_stars_repo_head_hexsha": "41212c77a5dac5c494ee2690cc9570c5e7cac744", "max_s... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# flatten a multidoc summarization dataset in .jsonl format to a parallel dataset that uses
# the *.sources *.targets format from cnn-dm
# TODO: support shuffling since the cluster items will be sequential by default
# TODO: support formatting with special tokens to i... | {"hexsha": "635ee72c2d406ab690ddfb461a43a82f0722c472", "size": 1690, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/multidoc_jsonl_dataset_to_parallel_dataset.py", "max_stars_repo_name": "chrishokamp/dynamic-transformer-ensembles", "max_stars_repo_head_hexsha": "2757c68936d6aca0ab06cb86e988cd96155a2b1c", "m... |
#!/usr/bin/env python
"""
from:
https://github.com/j2kun/computing-homology/blob/master/homology.py
https://jeremykun.com/2013/04/10/computing-homology/
"""
import numpy
import numpy.linalg
def rowSwap(A, i, j):
temp = numpy.copy(A[i, :])
A[i, :] = A[j, :]
A[j, :] = temp
def colSwap(A, i, j):
temp = num... | {"hexsha": "69a43d53613e2563cb6490eacfdfbfe52d4eb24a", "size": 4073, "ext": "py", "lang": "Python", "max_stars_repo_path": "bruhat/extern/homology.py", "max_stars_repo_name": "punkdit/bruhat", "max_stars_repo_head_hexsha": "3231eacc49fd3464542f7eb72684751371d9876c", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
[STATEMENT]
lemma valid_failure': "A \<sigma> = None \<Longrightarrow> \<not>(\<sigma> \<Turnstile> ((s \<leftarrow> A ; M s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. A \<sigma> = None \<Longrightarrow> \<not> (\<sigma> \<Turnstile> bind\<^sub>S\<^sub>E A M)
[PROOF STEP]
by(simp add: valid_SE_def unit_SE_de... | {"llama_tokens": 131, "file": "UPF_Monads", "length": 1} |
struct TwoLoopVars{T, TR, M}
d::T # search direction
S::TR # change in x
Y::TR # change in successive gradients
α::M
ρ::M
end
function TwoLoopVars(x, memory)
d = copy(x)
S = [copy(x) for i = 1:memory]
Y = [copy(x) for i = 1:memory]
α = similar(x, memory)
ρ = similar(x, memory)
... | {"hexsha": "c4f43156f39e93317dfb8e5ae457de158eef42db", "size": 5040, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/optimize/linesearch/limitedquasinewton.jl", "max_stars_repo_name": "mohamed82008/NLSolvers.jl", "max_stars_repo_head_hexsha": "1c0252243975bfd3e45f210caf60947b46785611", "max_stars_repo_license... |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
# Created by Mario Chen, 04.01.2021, Shenzhen
# My Github site: https://github.com/Mario-Hero
import sys
import os
import hashlib
# import datefinder
try:
import cv2
except ImportError:
os.system('pip install opencv-python')
import cv2
import n... | {"hexsha": "9c8f28edeb24b7d034357a291e18aed34913c7bb", "size": 9909, "ext": "py", "lang": "Python", "max_stars_repo_path": "toolDeleteDuplicate.py", "max_stars_repo_name": "Mario-Hero/toolDeleteDuplicate", "max_stars_repo_head_hexsha": "b52bb3d2de18f9929cd9f3f4c88fe902f5bdadf1", "max_stars_repo_licenses": ["MIT"], "max... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.