text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
```python
import numpy as np
import sympy as sy
import control.matlab as cm
```
```python
z = sy.symbols('z', real=False)
hh,r1,s0,s1, aa = sy.symbols('h,r1,s0,s1, a')
pc1 = -1.555-1j*1.555
pc2 = np.conjugate(pc1)
Tr = 1
omega0 = 2.2/Tr
#h = 0.2/omega0
h = Tr/10.0
a = -2*omega0
ad = sy.exp(h*a)
#ad = sy.symbols('a_d'... | {"hexsha": "58bd5ccf22e3ac72eb8dc50217269e65c44289ed", "size": 6293, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "polynomial-design/notebooks/L4-Spring16-RST-double-integrator.ipynb", "max_stars_repo_name": "kjartan-at-tec/mr2007-computerized-control", "max_stars_repo_head_hexsha": "16e35f5007f53... |
# Code to plot the waypoints
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import time
data = pd.read_csv("Graph_data.csv")
names_axis=['upper_arm_link_x','upper_arm_link_y','upper_arm_link_z','shoulder_link_x','shoulder_link_y','shoulder_link_z',
'fore... | {"hexsha": "b5d2a696a1f71a77bf9dbe9f4ba0b72885d169ac", "size": 1642, "ext": "py", "lang": "Python", "max_stars_repo_path": "cobot-control/scripts/e_waste_setup/e_waste_plot.py", "max_stars_repo_name": "Niegil-Francis/ur5-ag95-resources", "max_stars_repo_head_hexsha": "52be04a7cbd0adeee584283671aec4583e3a1612", "max_sta... |
import pandas as pd
import numpy as np
import h5py
import os
import logging
from pathlib import Path
from numba import jit
#@jit() # Set "nopython" mode for best performance, equivalent to @njit
def get_road_network(dir, image_size, testing, data_type):
grid = np.zeros(image_size)
i=0
tot = len(os.listdir(... | {"hexsha": "1d609ca30186b1a55af418b066d6b5cae5557d3f", "size": 4946, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/gnn_make_static_grid.py", "max_stars_repo_name": "qiq208/traffic4cast_graph_ens", "max_stars_repo_head_hexsha": "0608d9839fd1a69ea3e138ab8730a47ee5cbcd75", "max_stars_repo_licenses": ["Apache-... |
# -*- coding: utf-8 -*-
"""
Created by Claudio Tiecher
This script contains several functions to facilitate the analysis of
whole-cell electrophysiology data and perform offline correction
of voltage clamp error due to series resistance and cell capacitance.
Reference
Traynelis SF (1998) Software-based correction of ... | {"hexsha": "3116c3f36c61cfda2e3b43722962c8509082d13b", "size": 11390, "ext": "py", "lang": "Python", "max_stars_repo_path": "volt_err_corr_IV.py", "max_stars_repo_name": "janclod/voltage_clamp_correction_tool", "max_stars_repo_head_hexsha": "7490e0e225655f6218b029ae06a424d945fcd994", "max_stars_repo_licenses": ["CC0-1.... |
# -*- coding: utf-8 -*-
"""
This script highlight:
* How to define a normal-inverse Gaussian distribution.
* How to sample from the defined distribution.
* How to estimate the parameters of the distribution using method of moments, Gaussian approximation, expectation-maximization, and gradient descent.
... | {"hexsha": "658d2a119f8e2605cb149bf30e185748c24c4938", "size": 4622, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/marginal/generateEstimateEvaluate.py", "max_stars_repo_name": "andyGFHill/fieldosophy", "max_stars_repo_head_hexsha": "8677048d56b382a45a80383fe8ff84d75a5f9760", "max_stars_repo_licenses"... |
import importlib
from hydroDL.master import basins
from hydroDL.app import waterQuality
from hydroDL import kPath
from hydroDL.model import trainTS
from hydroDL.data import usgs, gageII, gridMET, transform
from hydroDL.post import axplot, figplot
import torch
import os
import json
import numpy as np
import pandas as p... | {"hexsha": "58c52b91e1d6260944622f4bb659cd774b3e7d06", "size": 2916, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/waterQual/legacy/silica/learnLSTM.py", "max_stars_repo_name": "fkwai/geolearn", "max_stars_repo_head_hexsha": "30cb4353d22af5020a48100d07ab04f465a315b0", "max_stars_repo_licenses": ["MIT"], "m... |
*dk,shiftr
integer function shiftr(num,i)
C
C #####################################################################
C
C PURPOSE - ... | {"hexsha": "259e72174f2cf0b869fc2c84efaed9a548accc98", "size": 1731, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lg_util/src/shiftr.f", "max_stars_repo_name": "millerta/LaGriT-1", "max_stars_repo_head_hexsha": "511ef22f3b7e839c7e0484604cd7f6a2278ae6b9", "max_stars_repo_licenses": ["CNRI-Python"], "max_stars_... |
import pandas as pd
import numpy as np
import sqlite3
from retrobiocat_web.retro.generation.node_analysis import rdkit_smile
def convert_to_rdkit(smi):
try:
new_smi = rdkit_smile(smi)
return new_smi
except:
return None
def load_data(path, cols, sep, smi_col):
print(f'Load path: {pa... | {"hexsha": "60cfd740e1681f8a5c532acc4c6b638d84183e3a", "size": 1790, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/buyable/download_and_process_buyable_smiles.py", "max_stars_repo_name": "ihayhurst/RetroBioCat", "max_stars_repo_head_hexsha": "d674897459c0ab65faad5ed3017c55cf51bcc020", "max_stars_repo_l... |
## Copyright (c) 2001-2006, Andrew Straw. All rights reserved.
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are
## met:
## * Redistributions of source code must retain the above copyright
## notice, this list of c... | {"hexsha": "4453b5f5a138cd0d89ac80a3f34e41b85f59dc44", "size": 17720, "ext": "py", "lang": "Python", "max_stars_repo_path": "ipython/attachments/DataFrame/DataFrame.py", "max_stars_repo_name": "cassiasamp/scipy-cookbook", "max_stars_repo_head_hexsha": "67c120be33302554edfd7fe7962f3e2773109021", "max_stars_repo_licenses... |
% XOVMP.m Multi-point crossover
%
% Syntax: NewChrom = xovmp(OldChrom, Px, Npt, Rs)
%
% This function takes a matrix OldChrom containing the binary
% representation of the individuals in the current population,
% applies crossover to consecutive pairs of individuals with
% ... | {"author": "vonsylvia", "repo": "MATLAB_Algorithm_with_cases", "sha": "646e51a377568889f48b8fdebbc44f0a2514048a", "save_path": "github-repos/MATLAB/vonsylvia-MATLAB_Algorithm_with_cases", "path": "github-repos/MATLAB/vonsylvia-MATLAB_Algorithm_with_cases/MATLAB_Algorithm_with_cases-646e51a377568889f48b8fdebbc44f0a25140... |
import numpy as np
from statsmodels.nonparametric.smoothers_lowess import lowess
class Smoother:
def __init__(self, data):
self._data = data
def _poly(self, order):
return np.polyval(np.polyfit(self._data.x, self._data.AverageTemperature, order), self._data.x)
def _lowess(self, level)... | {"hexsha": "2f34ab10cc5b1553a69710c47271bcef1eb7a13e", "size": 561, "ext": "py", "lang": "Python", "max_stars_repo_path": "Smooth.py", "max_stars_repo_name": "Manik2000/time_series_prediction", "max_stars_repo_head_hexsha": "619a36a3a604570ae83945a71905edcc61e03d5e", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# Use baremodule to shave off a few KB from the serialized `.ji` file
baremodule LibSSH2_jll
using Base
using Base: UUID
import JLLWrappers
JLLWrappers.@generate_main_file_header("LibSSH2")
JLLWrappers.@generate_main_file("LibSSH2", UUID("29816b5a-b9ab-546f-933c-edad1886dfa8"))
end # module LibSSH2_jll
| {"hexsha": "151dbd8253b98e89a071c0758d0a481361f93f1e", "size": 306, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/LibSSH2_jll.jl", "max_stars_repo_name": "JuliaBinaryWrappers/LibSSH2_jll.jl", "max_stars_repo_head_hexsha": "722a8755873ae6c1fa531aec7e7668c9734c313b", "max_stars_repo_licenses": ["MIT"], "max_s... |
[STATEMENT]
lemma encode_0[simp]: "encode e 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. local.encode e 0 = 0
[PROOF STEP]
by (subst encode.simps) simp | {"llama_tokens": 72, "file": "Nested_Multisets_Ordinals_Goodstein_Sequence", "length": 1} |
from typing import Optional
import numpy as np
from AggiEngine import GameScreen
class Particles:
def __init__(self, gameScreen: GameScreen, startColor: Optional[list] = None,
endColor: Optional[list] = None, shape: Optional[list] = None, rate=0.5,
count=100, endSize=0.01, siz... | {"hexsha": "13c99a914437252ecf82b8b90dd8888d156e52b8", "size": 2386, "ext": "py", "lang": "Python", "max_stars_repo_path": "AggiEngine/particles.py", "max_stars_repo_name": "bradylangdale/AggiEngine", "max_stars_repo_head_hexsha": "8aae715567ffaafadb6fecc542128e649f110c1c", "max_stars_repo_licenses": ["MIT"], "max_star... |
"""
Templates.py is apart of the Teamplates component referenced in section 3.2 of the SDD, A03_SDD_Team4.docx.
Copyright (c) 2020 Fall Detection System, All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met... | {"hexsha": "ab1a28371bc249973b9be0efbb17f69326209b33", "size": 8903, "ext": "py", "lang": "Python", "max_stars_repo_path": "Templates.py", "max_stars_repo_name": "LoganKoch17/CSC450-Project-4", "max_stars_repo_head_hexsha": "d17b86b8373a26591b9ca04afd043610fc274267", "max_stars_repo_licenses": ["Unlicense"], "max_stars... |
include("DNA.jl")
include("Synthesizer.jl")
include("MultiScalarRule.jl")
include("ScalarRule.jl")
include("SetRule.jl")
| {"hexsha": "543a2e1aa9932b948859ee89b5a5d62b76208dd4", "size": 121, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "genome/index.jl", "max_stars_repo_name": "unbornchikken/julia-ml-proto", "max_stars_repo_head_hexsha": "ade4dbe78890be9f81ddc9e03f4f6fc2cfe31825", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
from __future__ import print_function, division, absolute_import, unicode_literals
from nltk.corpus import wordnet as wn
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import click
def transitive_isometry(t1, t0):
u'''
computing isometry which move... | {"hexsha": "7db74dfcc7ac40d2a8c309f6d0211f758b4fdd48", "size": 2981, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/plot_mammal_subtree.py", "max_stars_repo_name": "escherba/poincare-embedding", "max_stars_repo_head_hexsha": "cc9dd4b83ff75f2ab9953b00c1f4bab8e30e9f82", "max_stars_repo_licenses": ["MIT"],... |
import numpy as np
class LDA:
def __init__(self, n_components):
self.n_components = n_components
self.linear_discriminants = None
def fit(self, X, y):
n_features = X.shape[1]
class_labels = np.unique(y)
# Within class scatter matrix:
# SW = sum((X_c - mean_X_c... | {"hexsha": "9c7a293612033f6ec1e674dea9c739cd982155bb", "size": 2348, "ext": "py", "lang": "Python", "max_stars_repo_path": "mlfromscratch/lda.py", "max_stars_repo_name": "USPA-Technology/MLfromscratch", "max_stars_repo_head_hexsha": "e8458b5233fa2f23a6bb5f887a8c95835791b190", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
from nose2.tools import *
from video_poker_sim.deck_simplifier import get_suit_pattern
import unittest
class SuitPatternsTestCase(unittest.TestCase):
def setup(self):
print "setup!"
def teardown(self):
print "tear down"
def test_basic_suit_pattern(self):
test_f... | {"hexsha": "9eec730fd123681ed89515c09efedbd509651ca0", "size": 552, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_deck_simplifier.py", "max_stars_repo_name": "nickweinberg/Python-Video-Poker-Sim", "max_stars_repo_head_hexsha": "f5a71da5c2c7e4926bd8b5f20fb83aa44dda56de", "max_stars_repo_licenses": ["... |
import json
import numpy as np
def stock_cutting(request):
data = request.get_json()
pieces = data['dimensions']
'''
** Nearly Pure Python ** Implementation of the
Extreme-point BFD-Heuristic for 2D-Cutting Stock Problem:
Based on "Extreme Point-Based Heuristics for
Three-Dimensional Bin P... | {"hexsha": "ba440aa252efb6156b04d9c93641ba39106ae01e", "size": 17325, "ext": "py", "lang": "Python", "max_stars_repo_path": "stock_cutting.py", "max_stars_repo_name": "bchaiks/2D_Cutting_Stock", "max_stars_repo_head_hexsha": "e591691ab292275f6b905cab6fbfd27443f65b33", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
module atomopt_io_module
implicit none
private
public :: flag_continue_atomopt
public :: read_atomopt_io
public :: write_atomopt_io
public :: read_diis_atomopt_io
public :: write_diis_atomopt_io
public :: read_bfgs_atomopt_io
public :: write_bfgs_atomopt_io
character(5),parameter :: version='ver0... | {"hexsha": "9a0171e5c1ef35438f5c6e28f1b0638efed96571", "size": 4321, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/atomopt/atomopt_io_module.f90", "max_stars_repo_name": "j-iwata/RSDFT_DEVELOP", "max_stars_repo_head_hexsha": "14e79a4d78a19e5e5c6fd7b3d2f2f0986f2ff6df", "max_stars_repo_licenses": ["Apache-... |
import copy
import numpy as np
from collections import deque
from random import shuffle
from poker_env.datatypes import Globals,Action,SUITS,RANKS
def flatten(l):
return [item for sublist in l for item in sublist]
CARDS = []
for i in range(RANKS.LOW,RANKS.HIGH):
for j in range(SUITS.LOW,SUITS.HIGH):
... | {"hexsha": "b79489dff1f4687d028a13c20bb5471e8693108c", "size": 9784, "ext": "py", "lang": "Python", "max_stars_repo_path": "poker/poker_env/data_classes.py", "max_stars_repo_name": "MorGriffiths/PokerAI", "max_stars_repo_head_hexsha": "a68400f4918f10dde82574ad19654243c9a65024", "max_stars_repo_licenses": ["MIT"], "max_... |
#/*
# * The MIT License
# *
# * Copyright 2021 Ethan Welborn - ethan.welborn@go.tarleton.edu.
# *
# * Permission is hereby granted, free of charge, to any person obtaining a copy
# * of this software and associated documentation files (the "Software"), to deal
# * in the Software without restriction, including w... | {"hexsha": "6366f0454b7ba1787cf5d3c5c73618a67e32ff26", "size": 12203, "ext": "py", "lang": "Python", "max_stars_repo_path": "MachineLearningProject/MachineLearningProject.py", "max_stars_repo_name": "ewelborn/Australian-Weather-Prediction-Model", "max_stars_repo_head_hexsha": "c007a1e942ddf8860b6cd8ad669aa7925cdcfd66",... |
import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
''' Usage
from cfl.visualization_methods import macrostate_vis
data = an n_samples x an up to 3D shape for each sample
macrostate_vis(data=data, exp_id=0, cause_or_effect='cause', subtract_global_mean=True)
'''
def visualize_macrostates(data,... | {"hexsha": "d3ee1ccde541ca2e1523c4cce1fb68e84b1e3df2", "size": 5644, "ext": "py", "lang": "Python", "max_stars_repo_path": "cfl/visualization_methods/basic_visualizations.py", "max_stars_repo_name": "eberharf/cfl", "max_stars_repo_head_hexsha": "077b99a05824f1371ac47d76dfed6bb160222668", "max_stars_repo_licenses": ["BS... |
""" A simple example to show how to use weave with VTK. This lets one
create VTK objects using the standard VTK-Python API (via 'import
vtk') and then accelerate any of the computations by inlining C++ code
inside Python.
Please note the use of the `inc_dirs` and the `lib_dirs` variables in
the call to weave.inline. ... | {"hexsha": "3ffd56429bc419fe0ecd0a16f6aec05f904c610e", "size": 3584, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/vtk_example.py", "max_stars_repo_name": "zanellia/weave", "max_stars_repo_head_hexsha": "25915e7106e7e628795971b3824f46eb0b515eea", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Define the Gammapy matplotlib plotting style."""
from __future__ import absolute_import, division, print_function, unicode_literals
from astropy.visualization import astropy_mpl_style
__all__ = ['gammapy_mpl_style']
gammapy_mpl_style = astropy_mpl_sty... | {"hexsha": "28c3a5e8ea7da30bdf7f34b7bb16a2c88e268076", "size": 753, "ext": "py", "lang": "Python", "max_stars_repo_path": "gammapy/utils/mpl_style.py", "max_stars_repo_name": "grburgess/gammapy", "max_stars_repo_head_hexsha": "609e460698caca7223afeef5e71826c7b32728d1", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
#' Pad string with leading zeros
#'
#' Function to pad a string with leading zeros. Useful for parameter codes and USGS site IDs.
#'
#' @param x character
#' @param padTo number Final desired length of the character
#' @keywords data import USGS web service
#' @return x character returned with leading zeros
#' @export... | {"hexsha": "5f6fa304bb1f3997c28cef31c6c03c13b00cf24a", "size": 951, "ext": "r", "lang": "R", "max_stars_repo_path": "R/zeroPad.r", "max_stars_repo_name": "mikejohnson51/dataRetrieval", "max_stars_repo_head_hexsha": "b5ef0976d9f0e0aff9595730440855a0030d2e72", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": 20... |
function [X,nuclearnorm] = prox_nuclear(B,lambda)
% The proximal operator of the nuclear norm of a matrix
%
% min_X lambda*||X||_*+0.5*||X-B||_F^2
%
% version 1.0 - 18/06/2016
%
% Written by Canyi Lu (canyilu@gmail.com)
%
[U,S,V] = svd(B,'econ');
S = diag(S);
svp = length(find(S>lambda));
if svp>=1
S = S(1:svp)... | {"author": "canyilu", "repo": "LibADMM-toolbox", "sha": "fa9bc9458b8fbe22ac264c6008b26e7e41e70742", "save_path": "github-repos/MATLAB/canyilu-LibADMM-toolbox", "path": "github-repos/MATLAB/canyilu-LibADMM-toolbox/LibADMM-toolbox-fa9bc9458b8fbe22ac264c6008b26e7e41e70742/proximal_operators/prox_nuclear.m"} |
import os
import torch
import torch.nn.functional as F
import pytorch3d
from torchvision.utils import save_image
from pytorch3d.loss import ( mesh_optimizer )
import matplotlib.pyplot as plt
from pytorch3d.utils import ico_sphere
import numpy as np
# Util function for loading meshes
from pytorch3d.io import load_objs... | {"hexsha": "e2cd771cff54c384763f7e233fbf52bf06903d63", "size": 3445, "ext": "py", "lang": "Python", "max_stars_repo_path": "docs/examples/large_steps_inv_rendering.py", "max_stars_repo_name": "JulianKnodt/pytorch3d", "max_stars_repo_head_hexsha": "d28a50e70aae62355e6e52908d3172c5e9175ba8", "max_stars_repo_licenses": ["... |
#' dewpoint
#'
#' Computes the dewpoint temperature in degC following different computational schemes defined by formula of saturation pressure estimation
#' ("NOAA","Sonntag","Paroscientific").
#'
#' @param t numeric Air temperature in degC.
#' @param rh numeric Air Relative humidity in percentage.
#' @param formula... | {"hexsha": "1512812ec1afcfb2262e6c1e88d3a159b478145e", "size": 1049, "ext": "r", "lang": "R", "max_stars_repo_path": "R/dewpoint.r", "max_stars_repo_name": "alfcrisci/rBiometeo", "max_stars_repo_head_hexsha": "1fe0113d017372393de2ced18b884f356c76049b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_star... |
program syr
use :: util_mod
implicit none
integer, parameter :: n = 3
real, dimension(n) :: vector = [ 3.0, 5.0, 7.0 ]
real, dimension(n, n) :: matrix = 0.0
call print_vector(vector, 'vector:', '(*(F5.1))')
call print_matrix(matrix, 'original matrix:', '(*(F5.1))')
call ssyr('u', n, 1.0... | {"hexsha": "8855ae84ffb7cef5750c4d2f2907968febc08304", "size": 414, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "source_code/blas_lapack/syr.f90", "max_stars_repo_name": "caguerra/Fortran-MOOC", "max_stars_repo_head_hexsha": "fb8a9c24e62ce5f388deb06b21e3009aea6b78d4", "max_stars_repo_licenses": ["CC-BY-4.0"... |
[STATEMENT]
lemma dtree_from_list_sucs_cases:
"Node r xs = dtree_from_list v ys \<Longrightarrow> xs = {||} \<or> (\<exists>x. xs = {|x|})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Node r xs = dtree_from_list v ys \<Longrightarrow> xs = {||} \<or> (\<exists>x. xs = {|x|})
[PROOF STEP]
using dtree.inject dtre... | {"llama_tokens": 371, "file": "Query_Optimization_Dtree", "length": 2} |
[STATEMENT]
lemma finite_ball_include:
fixes a :: "'a::metric_space"
assumes "finite S"
shows "\<exists>e>0. S \<subseteq> ball a e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>e>0. S \<subseteq> ball a e
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S
goal (1 subgoal):
... | {"llama_tokens": 1787, "file": null, "length": 20} |
"""
================
Spectrogram Demo
================
Demo of a spectrogram plot (`~.axes.Axes.specgram`).
"""
import matplotlib.pyplot as plt
import numpy as np
# Fixing random state for reproducibility
np.random.seed(19680801)
dt = 0.0005
t = np.arange(0.0, 20.0, dt)
s1 = np.sin(2 * np.pi * 100 * t)
s2 = 2 * np.s... | {"hexsha": "43ee7b3c1af8fbdbe32ba3f2c0e228b8018b3f45", "size": 1252, "ext": "py", "lang": "Python", "max_stars_repo_path": "matplotlib-3.4.3/matplotlib-3.4.3/examples/images_contours_and_fields/specgram_demo.py", "max_stars_repo_name": "JohnLauFoo/clc_packages_Yu", "max_stars_repo_head_hexsha": "259f01d9b5c02154ce25873... |
import os
import sys
import numpy as np
from PIL import Image
class ImageStack:
def __init__(self, frames, dtype=np.int16):
# frames = list(self._prestacked_frames(frames, agg_count=33))
print(f'Stacking image from {len(frames)} frames')
width, height, channels = frames[0].shape
image_stack = np.zeros(... | {"hexsha": "f30ca1a89ed204222c65ed48c57d359b32a89eca", "size": 2864, "ext": "py", "lang": "Python", "max_stars_repo_path": "planet_stacking/image_stack.py", "max_stars_repo_name": "simonvoelcker/astrotools", "max_stars_repo_head_hexsha": "89a2ecaee44a5764931422cae6cc46bad595b766", "max_stars_repo_licenses": ["CC0-1.0"]... |
[STATEMENT]
lemma index_together_alt_ss: "ps \<subseteq> G \<Longrightarrow> G \<in> \<G> \<Longrightarrow> card ps = 2 \<Longrightarrow> \<B> index ps = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>ps \<subseteq> G; G \<in> \<G>; card ps = 2\<rbrakk> \<Longrightarrow> \<B> index ps = 0
[PROOF STEP]
us... | {"llama_tokens": 278, "file": "Design_Theory_Group_Divisible_Designs", "length": 2} |
subroutine ed_get_eimp_(eimp)
real(8),dimension(4) :: eimp
eimp = [ed_Epot,ed_Eint,ed_Ehartree,ed_Eknot]
end subroutine ed_get_eimp_
subroutine ed_get_epot_(eimp)
real(8) :: eimp
eimp = ed_Epot
end subroutine ed_get_epot_
subroutine ed_get_eint_(eimp)
real(8) :: eimp
eimp = ed_Eint
end subroutine ed_get_e... | {"hexsha": "255d85811f8642feeabfbb795ed14c1072e08670", "size": 2020, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "FED_IO/get_eimp.f90", "max_stars_repo_name": "qftphys/A-solver-for-the-Dynamical-Mean-Field-Theory-based-on-the-full-Exact-Diagonalization-method.", "max_stars_repo_head_hexsha": "3758bfea488986... |
//
// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot 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)
//
#ifndef BEAST_STRING_VIEW_HPP
#define BEAST_STRING_VIEW_HPP
#include <boost/util... | {"hexsha": "f3bd7b1fde90b90a7985c684edf52bf2a255f296", "size": 628, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/beast/include/beast/core/string_view.hpp", "max_stars_repo_name": "vinniefalco/rippled", "max_stars_repo_head_hexsha": "2fbb2f5a45c3050bc5663e3b59b5cfb3f43242ea", "max_stars_repo_licenses": ["BSL... |
import nose
import copy
import numpy as np
from scipy import sparse
import pycuda.autoinit
import pycuda.gpuarray as gpu
from pycuda.driver import Stream
import binet.cusparse as cusparse
from nose.tools import assert_raises
from numpy.testing import assert_allclose, assert_array_equal
def test_cusparseScsrmm():
... | {"hexsha": "85326167929521dc2d0c4dcf78add3fc033ef47f", "size": 3585, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_cusparse.py", "max_stars_repo_name": "emaballarin/binet", "max_stars_repo_head_hexsha": "50fec5baf2611b44fb397016eaa60a4b68d487ff", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
theory Chapter12_5
imports "HOL-IMP.Hoare_Total"
begin
text\<open>
\exercise
Prove total correctness of the commands in exercises~\ref{exe:Hoare:sumeq} to
\ref{exe:Hoare:sqrt}.
\<close>
text\<open>
\endexercise
\exercise
Modify the VCG to take termination into account. First modify type @{text acom}
by annotating @... | {"author": "MaximilianAnzinger", "repo": "semantics2223-exercises", "sha": "938719cbbe0aaf89e133cd7d47e52da6adca8fec", "save_path": "github-repos/isabelle/MaximilianAnzinger-semantics2223-exercises", "path": "github-repos/isabelle/MaximilianAnzinger-semantics2223-exercises/semantics2223-exercises-938719cbbe0aaf89e133cd... |
#include <boost/python/object/forward.hpp>
| {"hexsha": "4f5c0c75fc6413e1f2a0125bc4b7595c356951da", "size": 43, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_python_object_forward.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0... |
import taichi as ti
import numpy as np
from .sph_solver import SPHSolver
class MCmuISPHSolver(SPHSolver):
def __init__(self, particle_system, TDmethod, density, cohesion, friction, eta_0):
super().__init__(particle_system, TDmethod)
print("Class M-C μ(I) Soil SPH Solver starts to serve!")
... | {"hexsha": "49a3d6cc4a1898ac4035a0e59f9a6103e35f86c1", "size": 4818, "ext": "py", "lang": "Python", "max_stars_repo_path": "eng/muIsph.py", "max_stars_repo_name": "Rabmelon/tiSPHi", "max_stars_repo_head_hexsha": "8ffb0e505edd01cb31cb049bfe54f1f2b99cf121", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "max_s... |
"""
This module provides functions to facilitate reporting information
about uncertainty calculations.
The abbreviation ``rp`` is defined as an alias for :mod:`reporting`,
to resolve the names of objects defined in this module.
Reporting functions
-------------------
* The function :func:`budget` pro... | {"hexsha": "e8de69b7a5fa943930fe321de4f08d6d70ec1251", "size": 37794, "ext": "py", "lang": "Python", "max_stars_repo_path": "GTC/reporting.py", "max_stars_repo_name": "MSLNZ/GTC2", "max_stars_repo_head_hexsha": "f73714a3efe6f9ce3d3f1e0925c94d774d12c80a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Helper layers to build GHNs.
"""
import torch
import torch.nn as nn
import numpy as np
import copy
def get_activat... | {"hexsha": "714620d7253f5b8bef8a966db092c9bf1f81db1a", "size": 5438, "ext": "py", "lang": "Python", "max_stars_repo_path": "ppuda/ghn/layers.py", "max_stars_repo_name": "CrispyHarder/ppuda", "max_stars_repo_head_hexsha": "15950ba297188163eaadd8ab69268ee7f6ffcf2a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import heapq
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# import utils
df_tsne = pd.read_csv("data/bot-search-metrics-id-tsne.csv")
# queries: np.ndarray = utils.convert_to_vec(df_tsne['Keyword'], utils.get_collection(100), 100)
queries: np.ndarray = df_tsne[['x-tsne', 'y-tsne']].values
... | {"hexsha": "394af739b1aea82f0453271fb1ca40d2b908c673", "size": 1124, "ext": "py", "lang": "Python", "max_stars_repo_path": "dbscun_param_choose_runner.py", "max_stars_repo_name": "DzianisH/SemanticFetcher", "max_stars_repo_head_hexsha": "7e393af003151937f28a10d0f801cde4569eeda8", "max_stars_repo_licenses": ["MIT"], "ma... |
#!/usr/bin/env python
from nose.tools import *
import networkx as nx
from networkx import NetworkXError
class TestStronglyConnected:
def setUp(self):
self.gc=[]
G=nx.DiGraph()
G.add_edges_from([(1,2),(2,3),(2,8),(3,4),(3,7),
(4,5),(5,3),(5,6),(7,4),(7,6),(8,1),(8... | {"hexsha": "d2569a99e6f781812b487db1db341b658c57977c", "size": 4735, "ext": "py", "lang": "Python", "max_stars_repo_path": "networkx-1.8.1/networkx/algorithms/components/tests/test_strongly_connected.py", "max_stars_repo_name": "lthurlow/Boolean-Constrained-Routing", "max_stars_repo_head_hexsha": "d60a648d17d5dadaa0fb5... |
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <iostream>
using boost::asio::ip::udp;
int main(int argc, char *argv[]) {
try {
if (argc != 2) {
std::cerr << "Usage: client <host>" << std::endl;
return 1;
}
boost::asio::io_context io_context;
udp::resolver resolver(io_con... | {"hexsha": "5dfffce5401350db15615d357f53721f9eaf2d04", "size": 914, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "boost_asio/server/daytime4.cpp", "max_stars_repo_name": "adlternative/boost-learn", "max_stars_repo_head_hexsha": "8efe901dec2b0caa1b6d59b805fd4af121c51e05", "max_stars_repo_licenses": ["BSD-2-Clause... |
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright (c) 2022 by Ignacio Peis, UC3M. +
# All rights reserved. This file is part of the HH-VAEM, and is released under +
# the "MIT License Agreement". Please see the LICENSE file that should ha... | {"hexsha": "3b70d0f906cdf0ad2b099f97267fcbb450564cf3", "size": 54374, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/base.py", "max_stars_repo_name": "ipeis/HH-VAEM", "max_stars_repo_head_hexsha": "b0280546e996c08b8ba2383cf8b8e8c178804bf8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "m... |
"""
#;+
#; NAME:
#; x_guis
#; Version 1.0
#;
#; PURPOSE:
#; Module for Plotting GUIs
#; 07-Sep-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
# Import libraries
import numpy as np
import pdb
import matplotlib.pyplot as plt
#from xastropy.xutils import xde... | {"hexsha": "b41ccaf291281a5cb54df9d2994e135eca13d45f", "size": 7355, "ext": "py", "lang": "Python", "max_stars_repo_path": "xastropy/plotting/simple.py", "max_stars_repo_name": "mneeleman/xastropy", "max_stars_repo_head_hexsha": "790aebfbc5cd26d43281bb70dec6bc63007dbb87", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
# Python code for Multiple Color Detection
import numpy as np
import cv2
# Capturing video
camCapture = cv2.VideoCapture(0)
# while loop
while(1):
# Reading from the video
_, imgFrame = camCapture.read()
# Convert the imgFrame from BGR(RGB color space) to
# HSV(hue-saturation-va... | {"hexsha": "37589da294df0140285b522a13e823ed64b662e1", "size": 3992, "ext": "py", "lang": "Python", "max_stars_repo_path": "rgb_detector.py", "max_stars_repo_name": "IshanAryendu/color_tracker", "max_stars_repo_head_hexsha": "b0bbbe535491fe2a446b9929b7da363a755c019d", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
[STATEMENT]
lemma minus_smod_eq_sdiv_mult:
\<open>a - a smod b = a sdiv b * b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. a - a smod b = a sdiv b * b
[PROOF STEP]
by (rule add_implies_diff [symmetric]) (fact sdiv_mult_smod_eq) | {"llama_tokens": 109, "file": null, "length": 1} |
import pytest
import numpy as np
from sklego.common import flatten
from sklego.decomposition import PCAOutlierDetection
from sklearn.utils import estimator_checks
@pytest.mark.parametrize(
"test_fn",
flatten(
[
# non-meta checks
estimator_checks.check_estimators_dtypes,
... | {"hexsha": "508c36a4f2d877f8c05d1e867b5115b510c242e5", "size": 2427, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_estimators/test_pca_reconstruction.py", "max_stars_repo_name": "kaipoethkow/scikit-lego", "max_stars_repo_head_hexsha": "b0b9cab19ef170fe47fcf18366dc47a1344b0d0b", "max_stars_repo_licen... |
#pragma once
#ifndef AMM_H
#define AMM_H
#include <boost/multiprecision/gmp.hpp>
#include "./token.hpp"
// sample class describing a simple constant product AMM
// We use the convention that the first token is the sell token
// and the second token is the buy token.
class CP_AMM {
public:
const int amm_... | {"hexsha": "9553cfd09bbe6509ae25fb85537efc6fae67ae82", "size": 1448, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/components/amm.hpp", "max_stars_repo_name": "cowprotocol/simple-solver-template", "max_stars_repo_head_hexsha": "51aeebd91c4d7b99627a93d0a066684553bdc5ad", "max_stars_repo_licenses": ["ECL-2.0",... |
import numpy as np
from collections import deque
import torch
import os
import random
import tqdm
from IPython import display
import marlgrid
from marlgrid.agents_base import Agent, AC, AC_Deterministic, AC_Network
from marlgrid.agents_torch import ConvLSTMA3C
from marlgrid.rendering import InteractivePlayerWindow
f... | {"hexsha": "7f6b7c267e8daf806ed050a8f8dc93204b8d694e", "size": 5750, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_torch.py", "max_stars_repo_name": "aivaslab/marlgrid", "max_stars_repo_head_hexsha": "10b53d27ce224fadeeb5830d6034350a69feb4b4", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": n... |
#pragma once
#include <boost/asio.hpp>
#include "mesos_hash.hpp"
#include "metrics_schema_struct.hpp"
#include "output_writer.hpp"
#include "params.hpp"
namespace metrics {
class MetricsTCPSender;
class ContainerMetrics;
/**
* A CollectorOutputWriter accepts data from one or more ContainerReaders, then tag... | {"hexsha": "d1a4a7616112b5a2b35426c8153566a8e1030642", "size": 2559, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "module/collector_output_writer.hpp", "max_stars_repo_name": "samvantran/dcos-metrics", "max_stars_repo_head_hexsha": "90208cc472361c6018c6c1293e0c4125d465dce4", "max_stars_repo_licenses": ["Apache-2... |
[STATEMENT]
lemma conjugate_sprod_vec:
fixes v w :: "'a :: conjugatable_ring vec"
assumes v: "v : carrier_vec n" and w: "w : carrier_vec n"
shows "conjugate (v \<bullet> w) = conjugate v \<bullet> conjugate w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. conjugate (v \<bullet> w) = conjugate v \<bullet> conj... | {"llama_tokens": 1484, "file": "Jordan_Normal_Form_Matrix", "length": 11} |
/*==================================================================================================
Copyright (c) 2015 Edouard Alligand and Joel Falcou
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
=======================... | {"hexsha": "04771b44bd4cbe9e4b5421aea7f9f13f2c38fb84", "size": 89732, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "vtk/8.1.0/src/ThirdParty/vtkm/vtk-m/vtkm/internal/brigand.hpp", "max_stars_repo_name": "Fresher-Chen/tarsim", "max_stars_repo_head_hexsha": "9d2ec1001ee82ca11325e4b1edb8f2843e36518b", "max_stars_re... |
import numpy as np
# settings for writing HDF5 files. See h5py documentation for the
# description of these terms
COMPARGS = {'compression':'gzip','compression_opts':9}
# data tyep for segmentation IDs. Permit negative segid
# to encode (x,y) ID for IFU-like object (maybe make this a float)
SEGTYPE = np.int32
| {"hexsha": "3c86ef2b7c96288c2e1434732f0e5de2a05d7d12", "size": 318, "ext": "py", "lang": "Python", "max_stars_repo_path": "pylinear/constants.py", "max_stars_repo_name": "Russell-Ryan/pyLINEAR", "max_stars_repo_head_hexsha": "d68e44bc64d302b816db69d2becc4de3b15059f9", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# hex player RBH 2016
# style influenced by
# * Michi (by Petr Baudis)
# * Morat (by Timo Ewalds)
# * Miaowy (by RBH)
# * Benzene (by
# Broderick Arneson, Philip Henderson, Jakub Pawlewicz,
# Aja Huang, Yngvi Bjornsson, Michael Johanson, Morgan Kan,
# Kenny Young, Noah Weninger,... | {"hexsha": "63680784a743c92cd08515f83431ed213c5fb68b", "size": 14835, "ext": "py", "lang": "Python", "max_stars_repo_path": "simple/hex/dev/h2.py", "max_stars_repo_name": "feiooo/games-puzzles-algorithms", "max_stars_repo_head_hexsha": "66d97135d163fb04e820338068d9bd9e12d907e9", "max_stars_repo_licenses": ["MIT"], "max... |
"""
Foi modificado a QTable para funcionar como aproximador de função.
Foi necessário a modificação das posições de [-2,2] sendo floats, por causa da transformação
numérica de decimal para binário
ao somar 0.2 a 0 o número se transforma em 1.9999996
Assim, estou remapeando os valores
-2 -> 0
-1.8 ->1
e assim por diant... | {"hexsha": "1019d50e6f0d401e58e21c0ce003a59ee820ddd2", "size": 8067, "ext": "py", "lang": "Python", "max_stars_repo_path": "qtable.py", "max_stars_repo_name": "FCChinen/SimpleQLearning-SIAI", "max_stars_repo_head_hexsha": "8992600880e51c7ab13e1208f623a59ad96ef311", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
[STATEMENT]
theorem dualization:
"\<turnstile> \<not>\<box>F = \<diamond>\<not>F"
"\<turnstile> \<not>\<diamond>F = \<box>\<not>F"
"\<turnstile> \<not>\<box>[A]_v = \<diamond>\<langle>\<not>A\<rangle>_v"
"\<turnstile> \<not>\<diamond>\<langle>A\<rangle>_v = \<box>[\<not>A]_v"
[PROOF STATE]
proof (prove)
goal (1... | {"llama_tokens": 427, "file": "TLA_Rules", "length": 2} |
from niaaml.classifiers import AdaBoost
import os
from niaaml.data import CSVDataReader
import numpy
"""
In this example, we show how to individually use an implemented classifier and its methods. In this case we use AdaBoost for demonstration, but
you can use any of the implemented classifiers in the same way.
"""
#... | {"hexsha": "0ba7ae67e57fe145f222f2a38d9e2f42184ba091", "size": 972, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/classifier.py", "max_stars_repo_name": "adi3/NiaAML", "max_stars_repo_head_hexsha": "e8ff31f16147ac497903cc5bb2e5badecda43ae7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
# Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | {"hexsha": "a15ae8726d5201f146f2c61c33dcaa262bae6007", "size": 3334, "ext": "py", "lang": "Python", "max_stars_repo_path": "savu/plugins/filters/inpainting/inpainting.py", "max_stars_repo_name": "elainehoml/Savu", "max_stars_repo_head_hexsha": "e4772704606f71d6803d832084e10faa585e7358", "max_stars_repo_licenses": ["Apa... |
import numpy as np
import torch
import torch.nn as nn
import pyro.distributions as D
import torch.nn.functional as F
from typing import NamedTuple
import pickle as pkl
import torchvision.transforms as transforms
import re
battery_pattern = re.compile('(\w{7})-(\w{2}-\w{2}-\w{2}-\w{2})\.pkl\Z')
class BatteryExample... | {"hexsha": "e048ede515531e21f536b0945501b4f516a9d0d0", "size": 5234, "ext": "py", "lang": "Python", "max_stars_repo_path": "battery/datasets.py", "max_stars_repo_name": "Wu-Chenyang/SMC-POMDP", "max_stars_repo_head_hexsha": "953c1abab412627080c63fbf8bb7f661b75e7006", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import pymc3 as pm
from numpy import linspace, zeros, unique
import theano
from theano import tensor as tt
from girth.multidimensional import initial_guess_md
from girth_mcmc.utils import get_discrimination_indices
from girth_mcmc.distributions import PartialCredit
__all__= ["multidimensional_credit_model"]
def m... | {"hexsha": "08aa6fbc9356177388f938a6670f4c5ef19676ca", "size": 2785, "ext": "py", "lang": "Python", "max_stars_repo_path": "girth_mcmc/polytomous/multidimensional_pcm.py", "max_stars_repo_name": "eribean/girth_mcmc", "max_stars_repo_head_hexsha": "911376eabf693b517683af8372984b589d6f7e09", "max_stars_repo_licenses": ["... |
#!/usr/bin/env python
'''
pyOpt_optimization
Holds the Python Design Optimization Classes (base and inherited).
Copyright (c) 2008-2014 by pyOpt Developers
All rights reserved.
Revision: 1.4 $Date: 22/06/2009 21:00$
Developers:
-----------
- Dr. Ruben E. Perez (RP)
- Mr. Peter W. Jansen (PJ)
History
-------
... | {"hexsha": "4fdfe0ff89f5b34e24f03fb10508ac4c3ad9f258", "size": 34947, "ext": "py", "lang": "Python", "max_stars_repo_path": "docker/optimization/pyOpt/tags/v1.2.0/pyOpt/pyOpt_optimization.py", "max_stars_repo_name": "liujiamingustc/phd", "max_stars_repo_head_hexsha": "4f815a738abad43531d02ac66f5bd0d9a1def52a", "max_sta... |
# -*- coding:utf-8 -*-
"""
"""
import numpy as np
import math
from collections import OrderedDict
from ..utils.common import generate_id
class MCNode(object):
def __init__(self, id, name, param_sample, parent=None, tree=None, is_terminal=False):
self.visits = 0
self.reward = 0.0
self.rewa... | {"hexsha": "b44d39486e19ca22c056ee3f09c8ed6cddebf1d9", "size": 7073, "ext": "py", "lang": "Python", "max_stars_repo_path": "hypernets/searchers/mcts_core.py", "max_stars_repo_name": "qigj/Hypernets", "max_stars_repo_head_hexsha": "534150e682f09df11ac3363e6aa7cd5e4a294c1d", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2010-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | {"hexsha": "fa5eb3d2949bea271860f5f2e183f30307e42574", "size": 7995, "ext": "py", "lang": "Python", "max_stars_repo_path": "openquake/risklib/tests/classical_test.py", "max_stars_repo_name": "gfzriesgos/shakyground-lfs", "max_stars_repo_head_hexsha": "2caf67cc32e6800286eded2df1efb05973ccf41b", "max_stars_repo_licenses"... |
using Uhlarm
using Base.Test
| {"hexsha": "4d047d5abe28b0d18382c717e7bface59f6ed845", "size": 29, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "zsunberg/Uhlarm.jl", "max_stars_repo_head_hexsha": "4ede69d7c8eed8e50958a900c454d44eaeebfaa3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "ma... |
import os
import pathlib
import sys
import pytest
from PIL import Image
import numpy as np
from drawbot_skia.runner import makeDrawbotNamespace, runScript, runScriptSource
from drawbot_skia.drawing import Drawing
testDir = pathlib.Path(__file__).resolve().parent
apiTestsDir = testDir / "apitests"
apiTestsOutputDir = ... | {"hexsha": "4a50ba866092bb9dd71ca0d2d85d344b3e9a0272", "size": 6724, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_api.py", "max_stars_repo_name": "hallotype/drawbot-skia", "max_stars_repo_head_hexsha": "17ded3796a117eccb60fb9788a17959d749f037a", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
import numpy
from numpy import matrix
from numpy import linalg
class ModMatrix(matrix):
def mod_inverse(self, p):
""" Finds the inverse of self matrix mod p
"""
n = len(self)
A = matrix(self)
adj = numpy.zeros(shape=(n, n))
for i in range(0, n):
for j in... | {"hexsha": "4ac0fd7c72cffe222cd6449f082de5d565f1615f", "size": 1768, "ext": "py", "lang": "Python", "max_stars_repo_path": "matrix.py", "max_stars_repo_name": "erfan-mehraban/hill_cipher", "max_stars_repo_head_hexsha": "edc9b3f2ebadcde2f9215e637c350ec40226485a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import sys, torch
from typing import Dict
from sklearn.preprocessing import MinMaxScaler
sys.path.insert(0,'../../nangs')
from burgers_lib import create_domain
from ml.burgers_pde import burgers_pde
from nangs import Dirichlet, MLP
from nangs.samplers import RandomSampler
import numpy as np
import json
import matplo... | {"hexsha": "9d0b762471b2dcc7b982c284414115db8ff2645b", "size": 6761, "ext": "py", "lang": "Python", "max_stars_repo_path": "burgers_2D/ml_train.py", "max_stars_repo_name": "pjuangph/PINN-Torch", "max_stars_repo_head_hexsha": "ce105ad595f00574f6cdb849717b3295f97cb8f4", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from dataloader import samplingloader
from dataloader import split_data
class Net(nn.Module):
def __init__(self, input):
super(Net, self).__init__()
self.input = input
self.net ... | {"hexsha": "9941602c6f30ab8643d3efb280e708d1ef52b7de", "size": 2798, "ext": "py", "lang": "Python", "max_stars_repo_path": "cgan/simple_classifier.py", "max_stars_repo_name": "ivokun/deep-learning-workbench", "max_stars_repo_head_hexsha": "16012d03bc4d58c51f739a8de32a533cae48c799", "max_stars_repo_licenses": ["MIT"], "... |
function get_irnss_orbital_elements(obj::IRNSSPropagator)
return jcall(obj, "getIRNSSOrbitalElements", IRNSSOrbitalElements, ())
end
| {"hexsha": "fb676194b79b04f61c58230e2e7c34ac7398b010", "size": 138, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "gen/OrekitWrapper/PropagationWrapper/AnalyticalWrapper/GnssWrapper/irnss_propagator.jl", "max_stars_repo_name": "JuliaAstrodynamics/Orekit.jl", "max_stars_repo_head_hexsha": "e2dd3d8b2085dcbb1d2c754... |
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD. See https://nomad-lab.eu for further info.
#
# 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/licen... | {"hexsha": "74b8c50bbcc94caa3bac75da6b8a1925a2b82b47", "size": 8466, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_turbomoleparser.py", "max_stars_repo_name": "nomad-coe/electronic-parsers", "max_stars_repo_head_hexsha": "defb47be6ac22b2e48d4fb9204c85390a3c2f328", "max_stars_repo_licenses": ["Apache... |
cell_to_vtkcell(::Type{Line}) = VTKCellTypes.VTK_LINE
cell_to_vtkcell(::Type{Line2D}) = VTKCellTypes.VTK_LINE
cell_to_vtkcell(::Type{Line3D}) = VTKCellTypes.VTK_LINE
cell_to_vtkcell(::Type{QuadraticLine}) = VTKCellTypes.VTK_QUADRATIC_EDGE
cell_to_vtkcell(::Type{Quadrilateral}) = VTKCellTypes.VTK_QUAD
cell_to_vtkcell(:... | {"hexsha": "1977d8a692f96a4f2b53a2c5e05d904db9c3a127", "size": 4503, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Export/VTK.jl", "max_stars_repo_name": "cfgarciar/Ferrite.jl", "max_stars_repo_head_hexsha": "e36a48f253c67201e51d1dc82e3a6b83ddbf9429", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
######################################################################################
# Date: 2016/July/11
#
# Module: module_bar.py
#
# VERSION: 0.9
#
# AUTHOR: Matt Thoburn (mthoburn@ufl.edu)
# Miguel A. Ibarra (miguelib@ufl.edu)
#
# DESCRIPTION: This module contains methods to plot a bar graph in matplotlib... | {"hexsha": "18558bd9b29a2f9f9fbc213010ddf16a89d26073", "size": 5318, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/secimtools/visualManager/module_bar.py", "max_stars_repo_name": "secimTools/GalaxyTools", "max_stars_repo_head_hexsha": "a79d9f6d733c9a8c1e52b5aa8f4b7d0da79cbf6d", "max_stars_repo_licenses": [... |
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
datos = pd.read_csv('../Datos/Iris.csv')
#-- todas las columnas menos la última --
#datos2 = datos.iloc[:,0:-1]
#--Matriz de correlacion --
print(datos.corr())
sns.heatmap(datos.corr(), square=True, annot=True)
plt.figure()
... | {"hexsha": "661fccc9f18a6b0bb5185e59e16b0fd8f60dd1b6", "size": 429, "ext": "py", "lang": "Python", "max_stars_repo_path": "01_Correlacion.py", "max_stars_repo_name": "JosefinaMedina/Deep-Learning-2021-P1", "max_stars_repo_head_hexsha": "6abd77a55f065e0072a2923f0e395cb2cec11fcc", "max_stars_repo_licenses": ["Apache-2.0"... |
\section{Floats in general}
Just ignore the position of floats until that is really the last ting for you to change.
\section{Figures folder structure and formats}
By organizing your figures into folders, like
./figs/pics/\footnote{Pictures, examples, etc}, ./figs/pdf/, ./figs/pgf/, ./figs/png/, ./figs/tikz/, and add... | {"hexsha": "8ad9f905c835a34ffc1be3d779bb5e45ece0ae75", "size": 4283, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tex/figures.tex", "max_stars_repo_name": "kristianfkt/latexpythontips", "max_stars_repo_head_hexsha": "08027be052ee739beb2af270efbc6e2981f9eea1", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
using LinearAlgebra
using ArnoldiMethod: lock!
function example()
n = 10
Q = qr(rand(n, n)).Q * Matrix(I, n, n)
R = diagm(0 => 1:10) .+ triu(randn(n, n) .* 0.01, 1)
R[2,3] = 1.0
R[3,2] = -1.0
# Some Schur decomp
A = Q * R * Q'
lock!(R, Q, 1, [8,9,10])
truncate!()
@show norm(A... | {"hexsha": "67b01a143f157052c6471b5c41ba5d4fe1674a8e", "size": 352, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/restarting.jl", "max_stars_repo_name": "andreasnoack/ArnoldiMethod.jl", "max_stars_repo_head_hexsha": "d44bac4022e5e39f9fa80f6398091c41180ec5a8", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
Require Export prosa.model.schedule.limited_preemptive.
Require Export prosa.analysis.definitions.job_properties.
Require Export prosa.analysis.facts.behavior.all.
Require Export prosa.analysis.facts.model.sequential.
Require Export prosa.analysis.facts.model.ideal_schedule.
(** Throughout this file, we assume the job... | {"author": "pointoflight", "repo": "prosa", "sha": "df7246392f27f32c760022b790f8c7aca11ff215", "save_path": "github-repos/coq/pointoflight-prosa", "path": "github-repos/coq/pointoflight-prosa/prosa-df7246392f27f32c760022b790f8c7aca11ff215/analysis/facts/preemption/job/limited.v"} |
import sys
import numpy as np
import tensorflow as tf
class BaseModel:
def __init__(self, config, dtype=tf.float64):
self.config = config
self.dtype = dtype
self.graph = tf.Graph()
self._build_ds_pipeline()
self._build_graph()
def _build_ds_pipeline(self):
dim... | {"hexsha": "2d079ce89bcb73d47d889a2193428b201a11c327", "size": 2768, "ext": "py", "lang": "Python", "max_stars_repo_path": "cbfssm/model/base_model.py", "max_stars_repo_name": "silvanmelchior/CBF-SSM", "max_stars_repo_head_hexsha": "34a5300f4b9a58e945c04d6c85f6e649ec63e609", "max_stars_repo_licenses": ["Apache-2.0", "M... |
"""Data source and problem definitions for American Community Survey (ACS) Public Use Microdata Sample (PUMS)."""
import os
import numpy as np
import pandas as pd
from . import folktables
from .load_acs import load_acs
class ACSDataSource(folktables.DataSource):
"""Data source implementation for ACS PUMS data."... | {"hexsha": "4c660728b90b724d869c6fa1e05f9953859948dd", "size": 7992, "ext": "py", "lang": "Python", "max_stars_repo_path": "folktables/acs.py", "max_stars_repo_name": "mrtzh/folktables", "max_stars_repo_head_hexsha": "5dd61a1b650adbf5afdb9a2cdae76903e1017c66", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 89, ... |
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
english,
man]{apa6}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\u... | {"hexsha": "4669a87d8195825bf3f40351e4a8f01ab7160fe1", "size": 58756, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/termination.tex", "max_stars_repo_name": "Noamsarna/termination", "max_stars_repo_head_hexsha": "c9d185c3e192dfb5bb30cc5c2471df54fb30e669", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 7 18:40:37 CEST 2015
@author: Elena Cuoco
simple starting script, without the use of MNE
Thanks to @author: alexandrebarachant for his wornderful starting script
"""
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from glob i... | {"hexsha": "254e1da84c0d4e60968f0380f2c181cbbde751f1", "size": 3705, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/research-25/simple-grasp-with-sklearn.py", "max_stars_repo_name": "anonymous-authorss/DS-Pipeline", "max_stars_repo_head_hexsha": "8304adfe7c1b082ad2225d6d5abf16fd30278cd9", "max_stars_r... |
# Copyright 2014 Open Data Science Initiative and other authors. See AUTHORS.txt
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import csv
import copy
import numpy as np
import scipy.io
import datetime
import... | {"hexsha": "816903da4ff3154b4b60552a6bdeaef3dd1a09a3", "size": 88450, "ext": "py", "lang": "Python", "max_stars_repo_path": "pods/datasets.py", "max_stars_repo_name": "lawrennd/ods", "max_stars_repo_head_hexsha": "16b5b577cfa6bbae52afac29f14083eadc963687", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":... |
{-# LANGUAGE ScopedTypeVariables, BangPatterns, RecordWildCards #-}
{-| Functions used internally by the SDR.Filter module. Most of these are
not actually used but exist for benchmarking purposes to determine the
fastest filter implementation.
-}
module SDR.FilterInternal where
import Control.Monad... | {"hexsha": "2abef9d023ea44ae4ec3be8a01aad00882debd8d", "size": 19220, "ext": "hs", "lang": "Haskell", "max_stars_repo_path": "hs_sources/SDR/FilterInternal.hs", "max_stars_repo_name": "adamwalker/sdr", "max_stars_repo_head_hexsha": "c7d4d7dacb41039976e11df93adb10d3570cb8ce", "max_stars_repo_licenses": ["BSD-3-Clause"],... |
"""
EF21 with heavy ball acceleration
experiment for least squares function
"""
import numpy as np
import time
import sys
import os
import argparse
from numpy.random import normal, uniform
from sklearn.datasets import make_spd_matrix, make_sparse_spd_matrix, load_svmlight_file, dump_svmlight_file
from numpy.linalg imp... | {"hexsha": "10d8ba57774804c3ef2732c1a2264bd61bc43f56", "size": 9316, "ext": "py", "lang": "Python", "max_stars_repo_path": "Least squares (PL setting)/pl_ef21_hb.py", "max_stars_repo_name": "IgorSokoloff/ef21_b-w_experiements_source_code", "max_stars_repo_head_hexsha": "aff675bdc5622c14a691f8a59d79f9bedd909262", "max_s... |
import os, glob
import gc
import time
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
import torch.optim as optim
from PSPNet_zoo.resnet import resnet101, resnet50
from PSPNet_zoo.model import *
### Paramete... | {"hexsha": "6e4e9ed2ee4bc0c73a82fd2419d10a6eee401fa4", "size": 3126, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/PSPNet_zoo/train.py", "max_stars_repo_name": "Vinayak-VG/ModelZoo_PyPi", "max_stars_repo_head_hexsha": "e3a22ac21b1a2f0865cdc5237a32d9c9a40913d9", "max_stars_repo_licenses": ["MIT"], "max_star... |
import os
from scipy.signal import medfilt
from astrodash.preprocessing import ReadSpectrumFile, ProcessingTools, PreProcessSpectrum
from astrodash.array_tools import zero_non_overlap_part, normalise_spectrum
class CombineSnAndHost(object):
def __init__(self, snInfo, galInfo, w0, w1, nw):
self.snInfo = sn... | {"hexsha": "6229a994576cd46d8437b74babc874eceda19104", "size": 6830, "ext": "py", "lang": "Python", "max_stars_repo_path": "astrodash/combine_sn_and_host.py", "max_stars_repo_name": "FoxFortino/adfox", "max_stars_repo_head_hexsha": "6b8679b07af99418d273ae0b0bf19e043d7b590b", "max_stars_repo_licenses": ["MIT"], "max_sta... |
From stdpp Require Export coPset.
From iris.algebra Require Import gmap auth agree gset coPset.
From iris.proofmode Require Import proofmode.
From iris.base_logic.lib Require Export own.
From iris.base_logic.lib Require Import wsat.
From iris.base_logic Require Export later_credits.
From iris.prelude Require Import opt... | {"author": "amintimany", "repo": "iris", "sha": "03eaffa3b28bffc561b93f30a3ba40bab8ae1fd1", "save_path": "github-repos/coq/amintimany-iris", "path": "github-repos/coq/amintimany-iris/iris-03eaffa3b28bffc561b93f30a3ba40bab8ae1fd1/iris/base_logic/lib/fancy_updates.v"} |
"""This module implement Gaussian Factor Model using a IBP prior."""
from __future__ import division
import numpy as np
import numpy.random as nr
import os
import datetime
import scipy.io
from numbers import Number
from utils.logIBPprior import logIBP
from utils.logPX import logPX
from utils.logPA import logPA
from ut... | {"hexsha": "023bdb78c977334cf4dc7092587353cdb6a2090c", "size": 11385, "ext": "py", "lang": "Python", "max_stars_repo_path": "Competing_Algorithm/IBPFM.py", "max_stars_repo_name": "ZhiQiu976/project-Indian-Buffet-Process", "max_stars_repo_head_hexsha": "a4817550f2ca1778333066fa03ec6bb5b9cb4240", "max_stars_repo_licenses... |
[STATEMENT]
lemma finite_nempty_set_min:
assumes "xs \<noteq> {}" and "finite xs"
shows "\<exists>x. min_degree xs x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>x. min_degree xs x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<exists>x. min_degree xs x
[PROOF STEP]
have "fi... | {"llama_tokens": 3306, "file": "Query_Optimization_QueryGraph", "length": 34} |
/**
* PlatformDependentServices.cpp
*
* History:
* David Cox on 10/20/04 - Created.
* Paul Jankunas on 03/23/05 - Changed scriptingPath function to return
* a standardized Mac OS X path.
*
* Copyright 2004 MIT. All rights reserved.
*/
#include "PlatformDependentServices.h"
#include <boost/f... | {"hexsha": "3da4acc7285fa0f396031f67af27d0ed3d0ad96d", "size": 7191, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "core/Core/PlatformDependent/PlatformDependentServices.cpp", "max_stars_repo_name": "esayui/mworks", "max_stars_repo_head_hexsha": "0522e5afc1e30fdbf1e67cedd196ee50f7924499", "max_stars_repo_licenses... |
[STATEMENT]
lemma cs_when_recording_2:
shows
"\<lbrakk> i \<le> j; trace init t final;
~ has_snapshotted (S t i) p;
\<forall>k. i \<le> k \<and> k < j \<longrightarrow> ~ occurs_on (t ! k) = p;
snd (cs (S t i) cid) = Recording;
channel cid = Some (p, q) \<rbrakk>
\<Longrightarrow>... | {"llama_tokens": 49679, "file": "Chandy_Lamport_Snapshot", "length": 209} |
[STATEMENT]
lemma is_connected_set_singleton: "x \<in> V \<Longrightarrow> is_connected_set {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<in> V \<Longrightarrow> is_connected_set {x}
[PROOF STEP]
unfolding is_connected_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<in> V \<Longrightarrow> \<... | {"llama_tokens": 175, "file": "Undirected_Graph_Theory_Connectivity", "length": 2} |
# Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | {"hexsha": "4fc52fad0f01453dfab78242eccfe98d948d1e80", "size": 4628, "ext": "py", "lang": "Python", "max_stars_repo_path": "monai/transforms/transforms.py", "max_stars_repo_name": "HastingsGreer/MONAI", "max_stars_repo_head_hexsha": "5e12c5d52638b2e434e212819452775f67cbb0de", "max_stars_repo_licenses": ["Apache-2.0"], ... |
(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below *)
Require Import BuiltIn.
Require Reals.Rbasic_fun.
Require Reals.Rtrigo_def.
Require Reals.Rpower.
Require Reals.R_sqrt.
Require BuiltIn.
Require HighOrd.
Require bool.Bool.
Require int.Int.
Require int.Abs.
Require int.C... | {"author": "VladYagl", "repo": "C-library-verification", "sha": "9d28d1edaf8f3e6e23d60825f53a9893c07ee5ef", "save_path": "github-repos/coq/VladYagl-C-library-verification", "path": "github-repos/coq/VladYagl-C-library-verification/C-library-verification-9d28d1edaf8f3e6e23d60825f53a9893c07ee5ef/script_save/lemma_make_do... |
[GOAL]
α : Type u
β : Type v
γ : Type w
a✝ : α
as✝ as1 as2 as3 : List α
inst✝¹ : Inhabited α
inst✝ : Inhabited β
a : α
as : List α
⊢ length ((a :: as) {0 ↦ a✝}) = max (length (a :: as)) (0 + 1)
[PROOFSTEP]
rw [max_eq_left]
[GOAL]
α : Type u
β : Type v
γ : Type w
a✝ : α
as✝ as1 as2 as3 : List α
inst✝¹ : Inhabited α
inst... | {"mathlib_filename": "Mathlib.Data.List.Func", "llama_tokens": 22237} |
"""
Usage: import the module (see Jupyter notebooks for examples), or run from
the command line as such:
# Train a new model starting from pre-trained COCO weights
python3 camusLiteWithEva.py train --dataset=/path/to/camus/dataset --weights=coco
# Resume training a model that you had trained earli... | {"hexsha": "89fb5676c7be06e5c5a8442ac9d414e06577b946", "size": 14217, "ext": "py", "lang": "Python", "max_stars_repo_path": "samples/CAMUS/camusNoLA.py", "max_stars_repo_name": "mouradbelo/Mask_RCNN_Camus", "max_stars_repo_head_hexsha": "dccf36f8c98ed48163481118b87e77b605152945", "max_stars_repo_licenses": ["MIT"], "ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.