text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
# -*- coding: utf-8 -*-
"""
-----------------------------------------------------------------------------
Association Rules Mining : Accidents Analysis
Copyright : V2 Maestros @2015
Problem Statement
*****************
The input dataset contains information about 1000 fatal... | {"hexsha": "91d375c78c419278162581705561c49cb74567ab", "size": 2045, "ext": "py", "lang": "Python", "max_stars_repo_path": "Data Science/Applied Data science with Python/Resources-python/AssociationRulesAccidents.py", "max_stars_repo_name": "frosty110/Book_Projects", "max_stars_repo_head_hexsha": "49566d615fbfe686fc8a4... |
[STATEMENT]
lemma [transfer_rule]:
"(pcr_integer ===> pcr_integer ===> (\<longleftrightarrow>)) (dvd) (dvd)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (pcr_integer ===> pcr_integer ===> (=)) (dvd) (dvd)
[PROOF STEP]
by (unfold dvd_def) transfer_prover | {"llama_tokens": 110, "file": null, "length": 1} |
#ifndef _ENCODER_DRIVER_HPP
#define _ENCODER_DRIVER_HPP
#include "m3d_driver_lib_export.h"
#include <iostream>
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
using boost::asio::ip::tcp;
using namespace boost::asio;
using namespace b... | {"hexsha": "73117103708cf112aee38b6f5323d6a76639581f", "size": 1225, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "hpp/encoder_driver.hpp", "max_stars_repo_name": "michalpelka/m3d_unit_dr", "max_stars_repo_head_hexsha": "ecee744474bde24a4a50d4872b59a087c66ac677", "max_stars_repo_licenses": ["Unlicense"], "max_st... |
\chapter{Results}
| {"hexsha": "dab74ccff19b80b67093aeb36ad8aa79cb26a902", "size": 18, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "templates/psy_thesis/chapters/04_results.tex", "max_stars_repo_name": "bbboll/latex-get", "max_stars_repo_head_hexsha": "63362c42a8836c288536f341c881daafc2da6def", "max_stars_repo_licenses": ["MIT"], ... |
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{tcolorbox}
\usepackage{float}
\usepackage{amsfonts}
\usepackage{svg}
\date{}
\usepackage{qcircuit}
\title{\textbf{Quantum Computing: An Applied Approach}\\\vspace*{1cm}
Chapter 8 Problems: Building a Quantum Co... | {"hexsha": "210111bd136795310aee56668cd54f4d0685638f", "size": 6364, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "chapter_8/main.tex", "max_stars_repo_name": "Alekxos/qc_applied_approach", "max_stars_repo_head_hexsha": "c56ce4d1cfc9fcf0fc926e330bb28186cebdb799", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
#-------------------------------------------------------------------------------
#
# Swarm MIO_SHA_2* product file format parser - test
#
# Author: Steve Shi Chen <chenshi80@gmail.com>
#
# Original Author: Martin Paces <martin.paces@eox.at>
#----------------------------------------------------------------------------... | {"hexsha": "ad7470562973010087dda11f3c06dc7f34f31228", "size": 3977, "ext": "py", "lang": "Python", "max_stars_repo_path": "geoist/magmod/magnetic_model/tests/parser_mio.py", "max_stars_repo_name": "irxat/geoist", "max_stars_repo_head_hexsha": "658aadab8074bffcbc6b3861671d35b3012502e9", "max_stars_repo_licenses": ["MIT... |
#
# This file is part of Healpy.
#
# Healpy is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Healpy is distributed in the hope... | {"hexsha": "d2e12245134046697601a164e5dff99718bb3d2e", "size": 40646, "ext": "py", "lang": "Python", "max_stars_repo_path": "venv/lib/python3.6/site-packages/healpy/rotator.py", "max_stars_repo_name": "metu-sparg/higrid", "max_stars_repo_head_hexsha": "ebee0f35ea1712a01f3fdbaae132127ce4833baf", "max_stars_repo_licenses... |
[STATEMENT]
lemma DERIV_local_max:
fixes f :: "real \<Rightarrow> real"
assumes der: "DERIV f x :> l"
and d: "0 < d"
and le: "\<forall>y. \<bar>x - y\<bar> < d \<longrightarrow> f y \<le> f x"
shows "l = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. l = 0
[PROOF STEP]
proof (cases rule: linorder_ca... | {"llama_tokens": 2417, "file": null, "length": 28} |
# Ex. 4 - Computacao Grafica -
# Ao final do programa a matriz de transformação será mostrada no terminal
import glfw
from OpenGL.GL import *
import OpenGL.GL.shaders
import numpy as np
import vertices as vt
glfw.init()
glfw.window_hint(glfw.VISIBLE, glfw.FALSE);
window = glfw.create_window(700, 700, "Cubo", None, ... | {"hexsha": "304f360d2739898a5323364fe816c413289a3d33", "size": 4906, "ext": "py", "lang": "Python", "max_stars_repo_path": "2.Transformations/ex4.py", "max_stars_repo_name": "guisoares9/opengl-studies", "max_stars_repo_head_hexsha": "798c2d9703d39172b1fb3dc39092cd083b2065bb", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma sign_extended_iff_sign_extend:
"sign_extended n w \<longleftrightarrow> sign_extend n w = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sign_extended n w = (sign_extend n w = w)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. sign_extended n w \<Longrightarrow> sign... | {"llama_tokens": 896, "file": "Word_Lib_More_Word_Operations", "length": 6} |
#!python
# cython: language_level=3
"""
This script contains classes for a rectangular array
This script requires that `numpy` and `scipy` be installed within
the Python environment you are running this script in.
This file can be imported as a module and contains the following
class:
* RectA... | {"hexsha": "7578115f1672038c28a96223eca93e096ae71721", "size": 12573, "ext": "py", "lang": "Python", "max_stars_repo_path": "antarray/rectarray.py", "max_stars_repo_name": "rookiepeng/antarray", "max_stars_repo_head_hexsha": "4964b3a2cf8107aa0d7a26f2f02d477e5db98201", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# -------------------------------------------------------
# CSCI 561, Spring 2021
# Homework 1
# The Oregon Trail
# Author: Joseph Ko
# This module holds the different search algorithms
# -------------------------------------------------------
from collections import deque
from Node import Node
from utility import fin... | {"hexsha": "7cc3cc5d4d9b24d903faf9605358f01c99b45a1f", "size": 10446, "ext": "py", "lang": "Python", "max_stars_repo_path": "search_algorithms.py", "max_stars_repo_name": "josephko91/2d-path-finder", "max_stars_repo_head_hexsha": "50f3babd33c7ae42b7697e17ee00e593a9eea16b", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import os
import math
from multiprocessing import Process
import nltk
from nltk.grammar import Nonterminal, Production
import numpy as np
import pandas as pd
import argparse
class Grammar(object):
def __init__(self, fpath):
self.__init_grammar(fpath)
def to_idxs(self, smiles):
try:
... | {"hexsha": "fb59fe61dc07ffd5f753260f8d2f658ef43e3825", "size": 7461, "ext": "py", "lang": "Python", "max_stars_repo_path": "dglt/contrib/moses/moses/model/gvae/cvt_smiles_to_gidxs.py", "max_stars_repo_name": "uta-smile/CD-MVGNN", "max_stars_repo_head_hexsha": "b48f4cd14befed298980a83edb417ab6809f0af6", "max_stars_repo_... |
from pathlib import Path
import numpy as np
import xarray as xr
def generate_configfile(
out_path: Path,
horizontal_diffusivity: np.ndarray,
z_hd: np.ndarray,
vertical_diffusivity: np.ndarray,
z_vd: np.ndarray,
max_wave_height: float = None,
wave_mixing_depth_factor: float = None,
):
... | {"hexsha": "368b75854693f695ab9f0b07d5692eb1faed5ed6", "size": 2215, "ext": "py", "lang": "Python", "max_stars_repo_path": "ADVECTOR/examples/helpers/generate_configfile.py", "max_stars_repo_name": "john-science/ADVECTOR", "max_stars_repo_head_hexsha": "5c5ca7595c2c051f1a088b1f0e694936c3da3610", "max_stars_repo_license... |
#!/usr/bin/env python
# encoding: utf-8
r"""Calculate refinement resolutions given ratios provided"""
import argparse
import numpy as np
import topotools
def calculate_resolution(ratios, base_resolutions=[0.25,0.25],
lat_long=True,
latitude=24.0):
... | {"hexsha": "2eb4e73911f4698d574f415412b2e4289cbf86af", "size": 2731, "ext": "py", "lang": "Python", "max_stars_repo_path": "docker/src/clawpack-5.3.1/geoclaw/src/python/geoclaw/resolution.py", "max_stars_repo_name": "ian-r-rose/visualization", "max_stars_repo_head_hexsha": "ed6d9fab95eb125e7340ab3fad3ed114ed3214af", "m... |
# Module for storing the basic physics parameters. Physics class is defined here.
import numpy as np
import scipy.constants
class Physics():
'''
Physics class is the base class for Thomas-Fermi calculations. Physical quantities stored here are:
Scales:
E_scale : energy scale of the problem, all energ... | {"hexsha": "40d5bafa8c204b0a44e7ca39b7bd13f3515765cb", "size": 3769, "ext": "py", "lang": "Python", "max_stars_repo_path": "nanowire_model/physics.py", "max_stars_repo_name": "jpzwolak/quantum-ml", "max_stars_repo_head_hexsha": "aebe3496516be3bc0fc4392aaf7805ab5faf98dc", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# Copyright 2021 Huawei Technologies Co., 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 to... | {"hexsha": "9734a7747bfb6e19178522819f202b52ffbba66a", "size": 5487, "ext": "py", "lang": "Python", "max_stars_repo_path": "research/cv/textfusenet/infer/sdk/main.py", "max_stars_repo_name": "mindspore-ai/models", "max_stars_repo_head_hexsha": "9127b128e2961fd698977e918861dadfad00a44c", "max_stars_repo_licenses": ["Apa... |
import pygame
import pygame.time
import pygame.display
import pygame.event
import os
import math
import moderngl
import array
import numpy
from . import data
import OpenGL
import OpenGL.arrays
import OpenGL.arrays.vbo
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GL import shaders
#from OpenGL.arrays im... | {"hexsha": "0ba36281e07cabf7f95b5785783e33d25232ff88", "size": 814, "ext": "py", "lang": "Python", "max_stars_repo_path": "gamelib/vbo.py", "max_stars_repo_name": "yarolig/FetchQuest", "max_stars_repo_head_hexsha": "12aefdf0c83427f4806c30097a3974e41a34a8f0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
function preprocessing()
cd matconvnet;
complienn;
cd ..
end | {"author": "jiangqy", "repo": "ADSH-AAAI2018", "sha": "2e95574aaafa6ab139a142e5fb5020317384b338", "save_path": "github-repos/MATLAB/jiangqy-ADSH-AAAI2018", "path": "github-repos/MATLAB/jiangqy-ADSH-AAAI2018/ADSH-AAAI2018-2e95574aaafa6ab139a142e5fb5020317384b338/ADSH_matlab/preprocessing.m"} |
## -------->> [[file:../../nstandr.src.org::*magerman.remove.non.alphanumeric.*][magerman.remove.non.alphanumeric.*:2]]
expect_equal(c("MSLab Co. :"
, "MSLab Co.++"
, "MSLab Co.*&^") |>
magerman_remove_non_alphanumeric_at_the_end()
, c("MSLab Co.", "MSLab Co.", "MSLab ... | {"hexsha": "8e38e6d2831c092714cf2556b138793c004b0aa6", "size": 602, "ext": "r", "lang": "R", "max_stars_repo_path": "inst/tinytest/test_magerman_remove_non_alphanumeric_at_the_end.r", "max_stars_repo_name": "stasvlasov/nstandr", "max_stars_repo_head_hexsha": "2cd418ccd2d11a45b1166a5ae7a54d9590debdc9", "max_stars_repo_l... |
# -*- coding: utf8 -*-
# My imports
from __future__ import division
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline
import os
from astropy.io import fits
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
def eso_fits(hdulist):
'''A little demo utility to illu... | {"hexsha": "232ebbb01dfc9acbe486c5f1668b8acddf443620", "size": 16112, "ext": "py", "lang": "Python", "max_stars_repo_path": "FASMA/observations.py", "max_stars_repo_name": "MariaTsantaki/fasma-synthesis", "max_stars_repo_head_hexsha": "c6699325e4e81e8cc5a8b99ad9347c7e992e0bc7", "max_stars_repo_licenses": ["MIT"], "max_... |
*DECK DIPREP
SUBROUTINE DIPREP (NEQ, Y, RWORK, IA, JA, IPFLAG, F, JAC)
EXTERNAL F, JAC
INTEGER NEQ, IA, JA, IPFLAG
DOUBLE PRECISION Y, RWORK
DIMENSION NEQ(*), Y(*), RWORK(*), IA(*), JA(*)
INTEGER IOWND, IOWNS,
1 ICF, IERPJ, IERSL, JCUR, JSTART, KFLAG, L,
2 LYH, LEWT, LA... | {"hexsha": "22f40877297a55dff556c611408c7d83b10d5d84", "size": 3153, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/f2cl/packages/odepack/diprep.f", "max_stars_repo_name": "sbwhitecap/clocc-hg", "max_stars_repo_head_hexsha": "f6cf2591ceef8a3a80e04da9b414cdf60a25a90f", "max_stars_repo_licenses": ["MIT"], "ma... |
[STATEMENT]
lemma length_under_max[simp]: "length xs < max (length xs + 3) fft"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. length xs < max (length xs + 3) fft
[PROOF STEP]
by auto | {"llama_tokens": 77, "file": "Universal_Turing_Machine_Recursive", "length": 1} |
import numpy as np
import multiprocessing
from multiprocessing import Pool, Process, Array
from contextlib import closing
import glob
import time
from functools import partial
import pandas as pd
from keras.models import model_from_json
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument('... | {"hexsha": "1f7253c78524c6fbc52f9dc1db46d2f6b41b74fa", "size": 3766, "ext": "py", "lang": "Python", "max_stars_repo_path": "pd_python/Prediction_morgan_1024.py", "max_stars_repo_name": "fgentile89/D2", "max_stars_repo_head_hexsha": "52e268e939e891678fd9522966a6a5b0da1598af", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma varsPB_Un[simp]: "varsPB (\<Phi>1 \<union> \<Phi>2) = varsPB \<Phi>1 \<union> varsPB \<Phi>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. varsPB (\<Phi>1 \<union> \<Phi>2) = varsPB \<Phi>1 \<union> varsPB \<Phi>2
[PROOF STEP]
unfolding varsPB_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1.... | {"llama_tokens": 226, "file": "Sort_Encodings_TermsAndClauses", "length": 2} |
import numpy as np
import pandas as pd
import yaml
import os
import seaborn
import matplotlib.pyplot as plt
import argparse
#/Users/asmitapoddar/Documents/Oxford/Thesis/Genomics Project/Code/attention/lengths/Len60_balanced_AttLSTM[4,128,2,2]_BS32_Adam_29-07_15:59
model_name_save_dir = 'Len40_balanced_AttLSTM[4,64,2,2... | {"hexsha": "35a8634b28ff3b69506e36fb30919a6332ed3357", "size": 4796, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/visualize_attention.py", "max_stars_repo_name": "asmitapoddar/Deep-Learning-DNA-Sequences", "max_stars_repo_head_hexsha": "90bcd252485b86ab603baf967bb61dda29beb5e2", "max_stars_repo_licenses"... |
from nvidia.dali.pipeline import Pipeline
import nvidia.dali as dali
import nvidia.dali.fn as fn
import nvidia.dali.types as types
import numpy as np
import math
import os.path
import PIL.Image
from test_utils import check_batch
def init_video_data():
batch_size = 2
video_directory = os.path.join(os.environ['D... | {"hexsha": "0ee67bd5b7d989e81acf6850b5faae9982db959f", "size": 6283, "ext": "py", "lang": "Python", "max_stars_repo_path": "dali/test/python/test_operator_resize_seq.py", "max_stars_repo_name": "roclark/DALI", "max_stars_repo_head_hexsha": "e44a212d89a5449bbe7f4bae3d0f55f11a262932", "max_stars_repo_licenses": ["ECL-2.0... |
import pandas as pd
import numpy as np
#Model Variables
LAYER_HEIGHT = 100.
TOTAL_HEIGHT = 3700.
#Model Constants
HEAT_CAPACITY = 3985. * 1024.5 # J m^-3 K^-1
KAPPA = 5.5 * 10**-5 #m^2 s^-1
OCEAN_PERCENT = 0.71
def diffeqs(df, dt, fradfor, clim_sens):
"""
Differential equation for flux down.
"... | {"hexsha": "6ea3b66e592f9344371f4b771bf81605ffdccb85", "size": 1779, "ext": "py", "lang": "Python", "max_stars_repo_path": "heat_diffusion.py", "max_stars_repo_name": "hausfath/SimMod", "max_stars_repo_head_hexsha": "4f882992d94b5229a9de3542349ed30e83bae439", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
[STATEMENT]
lemma eval_Inf [simp]:
"eval (\<Sqinter>A) = \<Sqinter>(eval ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. eval (\<Sqinter> A) = \<Sqinter> (eval ` A)
[PROOF STEP]
by (simp add: Inf_pred_def) | {"llama_tokens": 96, "file": null, "length": 1} |
### A Pluto.jl notebook ###
# v0.16.4
using Markdown
using InteractiveUtils
# ╔═╡ 9b8c8d1a-481e-11eb-1b85-91264e100b12
begin
import Pkg
Pkg.activate(Base.current_project())
using ReinforcementLearning
end
# ╔═╡ 7441759c-4853-11eb-3d63-2be1f95f59fe
using Plots
# ╔═╡ 704d34fc-4859-11eb-2d95-45c4d5246b26
begin
usi... | {"hexsha": "b2500bc71e1c002db2573627eb198c81e1e01c16", "size": 20825, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "notebooks/Chapter01_Tic_Tac_Toe.jl", "max_stars_repo_name": "jie-jay/ReinforcementLearningAnIntroduction.jl", "max_stars_repo_head_hexsha": "56c34554af5c368ca870526dbecbe098212445a4", "max_stars_r... |
"""Definitions for the `MagnetarConstraints` class."""
import numpy as np
from mosfit.constants import DAY_CGS, KM_CGS, M_SUN_CGS
from mosfit.modules.constraints.constraint import Constraint
# Important: Only define one ``Module`` class per file.
class MagnetarConstraints(Constraint):
"""Magnetar constraints.
... | {"hexsha": "01fe8f466ae4b828efcdbc6b533cc31582779ed1", "size": 2314, "ext": "py", "lang": "Python", "max_stars_repo_path": "mosfit/modules/constraints/magnetar_constraints.py", "max_stars_repo_name": "bxg682/MOSFiT", "max_stars_repo_head_hexsha": "c65ab943bd0024b3d72c992c01a19f4f82956e98", "max_stars_repo_licenses": ["... |
[STATEMENT]
lemma list_ball_nth: "\<lbrakk>n < length xs; \<forall>x \<in> set xs. P x\<rbrakk> \<Longrightarrow> P(xs!n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>n < length xs; \<forall>x\<in>set xs. P x\<rbrakk> \<Longrightarrow> P (xs ! n)
[PROOF STEP]
by (auto simp add: set_conv_nth) | {"llama_tokens": 129, "file": null, "length": 1} |
# coding=utf-8
# Copyright 2021 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | {"hexsha": "072631b3b08fab9e43955587c8bd51eafbf30b68", "size": 3121, "ext": "py", "lang": "Python", "max_stars_repo_path": "trax/layers/initializers_test.py", "max_stars_repo_name": "d0rc/trax", "max_stars_repo_head_hexsha": "51010fe8c1c97ccb4b73ff50334135c894f03c71", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
# a few low-level functions that are used throughout
from __future__ import absolute_import, division, print_function # python2 compatibility
import numpy as np
import os
from scipy import interpolate
from .read_spectrum import read_carpy_fits
#=========================================================================... | {"hexsha": "02015fcb130922cc3018becb2d46943db932b8b4", "size": 4845, "ext": "py", "lang": "Python", "max_stars_repo_path": "Payne4GALAH/utils.py", "max_stars_repo_name": "tingyuansen/Payne4GALAH", "max_stars_repo_head_hexsha": "2e1ed464f011ef6d89bca864a6abddb5ad6372d4", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
setup(
name = "python_interface",
cmdclass = {"build_ext": build_ext},
ext_modules = [
Extension(name="python_interface", sources=["python_interface.pyx"],
libra... | {"hexsha": "1aee3b114eeb808c868a5087ed799292b1c82744", "size": 559, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "kipfstuhl/vectorized-eigensolver", "max_stars_repo_head_hexsha": "79aec220e9e272169cbc2e9082633613dbeb4073", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 19 20:47:14 2021
@author: vorst
"""
# Python imports
import unittest
# Third party imports
import numpy as np
from scipy.sparse import csr_matrix
# Local imports
from embedding import embed_bag, embed_all_bags, most_likely_estimator
# Globals
INSTANCE_SPACE = 2
N_POSI... | {"hexsha": "396eae7164cf8d44189e83bc75a27adaa875bd58", "size": 8034, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/pyMILES/embedding_test.py", "max_stars_repo_name": "johnvorsten/MILES", "max_stars_repo_head_hexsha": "c2f33f6a9177d5f6445bb8b4145f5f84fec5c4d8", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Author: Pierre Ablin <pierreablin@gmail.com>
# License: MIT
import numpy as np_
import autograd.numpy as np
from autograd import grad
from scipy.optimize import minimize as minimize_
def _scipy_func(objective_function, gradient, x, shapes, args=()):
optim_vars = _split(x, shapes)
obj = objective_functio... | {"hexsha": "86f6740811ec4bdc0262616ca3ed86262c3d955e", "size": 6352, "ext": "py", "lang": "Python", "max_stars_repo_path": "autoptim/autoptim.py", "max_stars_repo_name": "pierreablin/autoptim", "max_stars_repo_head_hexsha": "0b03d0f8c5b54000d679009640303fad2caf1ebf", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import cv2
import glob
import follow_line as fl
import time
import numba as nb
from ShowProcess import ShowProcess
def func_time(func):
def ft():
s = time.clock()
func()
e = time.clock()
print('use time :', e - s)
return ft()
@nb.jit
@func_time
def main():
img_in_root = 'te... | {"hexsha": "8111a2033434540c00baef8e5eb8df3c5d478524", "size": 808, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "4a5g0030/line_follow", "max_stars_repo_head_hexsha": "570e65fb62803f7f5062402a45654809b01b7aaa", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_sta... |
from landlab import RasterModelGrid, HexModelGrid
from landlab.components import ErosionDeposition, FlowAccumulator
import numpy as np
from numpy import testing
import pytest
def test_Ff_bad_vals():
"""
Test that instantiating ErosionDeposition with a F_f value > 1 throws a
ValueError.
"""
#set ... | {"hexsha": "be22e09aca2707788c31299717ade3f8991c8d8c", "size": 8018, "ext": "py", "lang": "Python", "max_stars_repo_path": "landlab/components/erosion_deposition/tests/test_general_erodep.py", "max_stars_repo_name": "sequence-dev/landlab", "max_stars_repo_head_hexsha": "a84fbf67a46de08bf8b6758bb316bff3423e746c", "max_s... |
import numpy as np
import xarray as xr
# import cartopy.crs as ccrs
# import cartopy.feature as cfeat
# from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import matplotlib.pyplot as plt
# %matplotlib inline
# 数据读取及时间平均处理
ds = xr.open_dataset("/home/kesci/input/work7931/2011010100.nc")
temp = ds... | {"hexsha": "319549a3568ff7635ed2a28a2fcc16292901aa65", "size": 1527, "ext": "py", "lang": "Python", "max_stars_repo_path": "vec2vec/exp/era5_nc_temperature_visualization_exmaple.py", "max_stars_repo_name": "wxnudt/vec2vec", "max_stars_repo_head_hexsha": "6ea46442ea4483645e3fe81e6c0f1ada980c974c", "max_stars_repo_licens... |
module Mixed
using ExtractMacro
using ..Common
using ..Interface
export GraphMixed
import ..Interface: energy, delta_energy, neighbors, update_cache!
struct GraphMixed{ET} <: SimpleGraph{ET}
N::Int
graphs::Vector{AbstractGraph}
end
"""
GraphMixed(graphs::AbstractGraph...)
A `SimpleGraph` mixing 2 or ... | {"hexsha": "7d7a73a39aca2a87df307bd87f6b518883589007", "size": 1586, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/graphs/Mixed.jl", "max_stars_repo_name": "carlobaldassi/RRRMC.jl", "max_stars_repo_head_hexsha": "5883245abb58909e73f5f297b786d38f4753773c", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
%% Example
% real time control of the KUKA iiwa 7 R 800
% Moving first joint of the robot, using a sinisoidal function
% An example script, it is used to show how to use the different
% functions of the KUKA Sunrise matlab toolbox
% First start the server on the KUKA iiwa controller
% Then run this script using Matla... | {"author": "Modi1987", "repo": "KST-Kuka-Sunrise-Toolbox", "sha": "9299bed2b46058aeb4105d7fbff6d2290ce68bba", "save_path": "github-repos/MATLAB/Modi1987-KST-Kuka-Sunrise-Toolbox", "path": "github-repos/MATLAB/Modi1987-KST-Kuka-Sunrise-Toolbox/KST-Kuka-Sunrise-Toolbox-9299bed2b46058aeb4105d7fbff6d2290ce68bba/Matlab_clie... |
[STATEMENT]
lemma has_derivative_transform_within_open:
assumes "(f has_derivative f') (at x within t)"
and "open s"
and "x \<in> s"
and "\<And>x. x\<in>s \<Longrightarrow> f x = g x"
shows "(g has_derivative f') (at x within t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (g has_derivative f') (a... | {"llama_tokens": 453, "file": null, "length": 3} |
import numpy as np
import torch
from torch.autograd import Variable
from .epo_lp import EPO_LP
from .base import Solver
from .utils import rand_unit_vectors, getNumParams, circle_points
from time import time
from datetime import timedelta
class EPO(Solver):
@property
def name(self):
return "epo"
... | {"hexsha": "f4d7c5ef81e8ea8a9d0eb6feb3032b967afc3812", "size": 4450, "ext": "py", "lang": "Python", "max_stars_repo_path": "multiMNIST/solvers/epo.py", "max_stars_repo_name": "kelvin95/EPOSearch", "max_stars_repo_head_hexsha": "020f0a8890437449dd7bb37534697aa9f71e8305", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
! This file is part of mctc-lib.
!
! 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 writi... | {"hexsha": "7e880613b655430315bc5defec46324dbc4f3c1a", "size": 4621, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "test/test_symbols.f90", "max_stars_repo_name": "loriab/mctc-lib", "max_stars_repo_head_hexsha": "908dc5e0c8690e4a9db90d2730551b1b28c9fdfe", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
[STATEMENT]
lemma ty_term_mono: "varT \<subseteq>\<^sub>m varT' \<Longrightarrow> objT \<subseteq>\<^sub>m objT' \<Longrightarrow>
ty_term varT objT \<subseteq>\<^sub>m ty_term varT' objT'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>varT \<subseteq>\<^sub>m varT'; objT \<subseteq>\<^sub>m objT'\<rbrak... | {"llama_tokens": 623, "file": "AI_Planning_Languages_Semantics_PDDL_STRIPS_Semantics", "length": 6} |
Rebol [
Title: "Run-tests"
File: %run-tests.r
Copyright: [2014 "Saphirion AG"]
Author: "Ladislav Mecir"
License: {
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/... | {"hexsha": "0d3cace333f2bd89bcec3f022ebcb1e713589403", "size": 986, "ext": "r", "lang": "R", "max_stars_repo_path": "run-tests.r", "max_stars_repo_name": "rebolsource/rebol-test", "max_stars_repo_head_hexsha": "2231ab3462c9ebf4b241ffbace7ff01c0d87cdab", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 5, "... |
# Copyright Contributors to the Tapqir project.
# SPDX-License-Identifier: Apache-2.0
import logging
from collections import OrderedDict, defaultdict
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
from matplotlib.patches import Rectangle
from scipy.io impo... | {"hexsha": "2ce6f5cb3f474386599598b18fd76c4928d3b6c0", "size": 15366, "ext": "py", "lang": "Python", "max_stars_repo_path": "tapqir/imscroll/glimpse_reader.py", "max_stars_repo_name": "gelles-brandeis/tapqir", "max_stars_repo_head_hexsha": "60da3fda1632d4309ff7d0ffeeab5940a020963a", "max_stars_repo_licenses": ["Apache-... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 11 04:50:58 2018
File Name: TDSE Infinite Square Well - Stationary
@author: Daniel Martin
"""
import numpy as np
import numpy.linalg as linalg
import matplotlib.pyplot as plt
from matplotlib import animation
from scipy import constants
plt.close("all")
#Define constants... | {"hexsha": "30af84da56217a7b73cfa70cedefd1fe340dd39f", "size": 4529, "ext": "py", "lang": "Python", "max_stars_repo_path": "TDSE Infinite Square Well - Stationary.py", "max_stars_repo_name": "PianoManDanDan/Solving-Schrodingers-Equation", "max_stars_repo_head_hexsha": "18e3ca6972d7bd38aac5827510ac0ccd941f18fd", "max_st... |
import os
from os.path import join
import random
import fnmatch
import cv2
import numpy as np
if cv2.__version__.startswith('2.3'):
raise NotImplementedError("WARNING: cv2 is version {0}, Z axis is inverted in this version and still result in incorrect results".format(cv2.__version__))
## NOTE: I removed the err... | {"hexsha": "6f4553ba3049d758207739899ac148fe27b079b5", "size": 10166, "ext": "py", "lang": "Python", "max_stars_repo_path": "boris/cam2eye_registration.py", "max_stars_repo_name": "eacooper/BerkeleyVisionStats", "max_stars_repo_head_hexsha": "39192eca0ade05f8a1473cd8032b08c2a1c19e7b", "max_stars_repo_licenses": ["MIT"]... |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# 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": "15b88fd38ec2ed6b49a440a10852d8a93bb903b5", "size": 976, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/framework/PostProcessors/TopologicalPostProcessor/Schwefel.py", "max_stars_repo_name": "rinelson456/raven", "max_stars_repo_head_hexsha": "1114246136a2f72969e75b5e99a11b35500d4eef", "max_star... |
import matplotlib.pyplot as plt
import numpy as mp
import math
import statistics
import pickle
from mcpat import *
def get_data(epochs, path):
data = defaultdict(list)
for epoch in epochs:
for key, value in epoch.find(path).data.items():
data[key].append(value)
return data
def format_values(data):
... | {"hexsha": "bbce9c4cd5e3f6a0437e5cfb99944745ae15384b", "size": 1227, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/deprecated/analysis.py", "max_stars_repo_name": "JimmyZhang12/predict-T", "max_stars_repo_head_hexsha": "8ae818b0791104de20633ce91e6d633cda7445b3", "max_stars_repo_licenses": ["MIT"], "max_... |
theory Utility_Functions
imports
Complex_Main
"HOL-Probability.Probability"
Lotteries
Preference_Profiles
begin
subsection \<open>Definition of von Neumann--Morgenstern utility functions\<close>
locale vnm_utility = finite_total_preorder_on +
fixes u :: "'a \<Rightarrow> real"
assumes utility_le_iff: "x \... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/SeLFiE/Example/afp-2020-05-16/thys/Randomised_Social_Choice/Utility_Functions.thy"} |
# Autogenerated wrapper script for SCIP_PaPILO_jll for x86_64-linux-gnu-libgfortran4-cxx03
export libscip, papilo, scip
using bliss_jll
using boost_jll
using Bzip2_jll
using CompilerSupportLibraries_jll
using GMP_jll
using Ipopt_jll
using oneTBB_jll
using Readline_jll
using Zlib_jll
JLLWrappers.@generate_wrapper_heade... | {"hexsha": "c17042b473d6027784af9d4fabca05a2e08a9207", "size": 1024, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/wrappers/x86_64-linux-gnu-libgfortran4-cxx03.jl", "max_stars_repo_name": "JuliaBinaryWrappers/SCIP_PaPILO_jll.jl", "max_stars_repo_head_hexsha": "31c36fddebf5cf43ca0cacc133a8b57b4d3caa72", "max... |
import numpy as np
BATCH_SIZE = 64
dataset_name = 'anim1'
dataset = np.load('../../TGAN_DATASET/' + dataset_name + '/full.npy')
dataset_new = dataset[0:(dataset.shape[0] // BATCH_SIZE) * BATCH_SIZE, :, :, :]
dataset_new = dataset_new.astype('float32')
dataset_shape = dataset_new.shape
print(dataset_shape)
np.save('..... | {"hexsha": "b04c775c4b44ac8dc3962570a63eeef8719c2f1a", "size": 404, "ext": "py", "lang": "Python", "max_stars_repo_path": "prepare_n_process/shaper.py", "max_stars_repo_name": "mortarsynth/droneGAN", "max_stars_repo_head_hexsha": "f7d10fb64f8bc1c6749a77b8ca77ef87358a312f", "max_stars_repo_licenses": ["MIT"], "max_stars... |
from PIL import Image, ImageDraw
import numpy as np
import math
import time
import os
class DrawMaster:
def __init__(self, name="DrawMaster",
size=(100, 100), background=(150, 130, 200)):
self.name = name
self.width, self.height = size
self.picture = Image.new(... | {"hexsha": "20a861373f1a870cbbc892dc995489ecf07f35d6", "size": 9317, "ext": "py", "lang": "Python", "max_stars_repo_path": "images/DrawMaster.py", "max_stars_repo_name": "GrzegorzKrug/Misc", "max_stars_repo_head_hexsha": "1f2141b323e1a6105b01f60b93cfe4eae48555d3", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
[STATEMENT]
lemma HC_mono: "S \<turnstile>\<^sub>H F \<Longrightarrow> S \<subseteq> T \<Longrightarrow> T \<turnstile>\<^sub>H F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>S \<turnstile>\<^sub>H F; S \<subseteq> T\<rbrakk> \<Longrightarrow> T \<turnstile>\<^sub>H F
[PROOF STEP]
by(induction rule: HC.i... | {"llama_tokens": 139, "file": "Propositional_Proof_Systems_HC", "length": 1} |
import copy
import os
from typing import Tuple, Dict, List
import numpy as np
import pandas as pd
from progressbar import progressbar as pb
from pprint import PrettyPrinter
from utils.constants import (
DATA_DIR,
INTERNAL_OUTPUT_DIR,
NOVEL_MODEL_OUTPUT_DIR,
FIGURES_OUTPUT_DIR,
CALIB_GAM_N_SPLINES,
... | {"hexsha": "6d74ff2456cfdc610d2ac61fdbad457da8af2cc4", "size": 13733, "ext": "py", "lang": "Python", "max_stars_repo_path": "13_train_production_models.py", "max_stars_repo_name": "finncatling/lap-risk", "max_stars_repo_head_hexsha": "afda480bfa42bae0ce25c12129031971e517545f", "max_stars_repo_licenses": ["MIT"], "max_s... |
(**
CoLoR, a Coq library on rewriting and termination.
See the COPYRIGHTS and LICENSE files.
- Frederic Blanqui, 2009-10-14
conversion of a TRS with unary symbols only into an SRS
*)
Set Implicit Arguments.
From CoLoR Require Import LogicUtil RelUtil SN ListUtil Srs ATrs AUnary VecUtil
EqUtil NatUtil ListMax.
... | {"author": "fblanqui", "repo": "color", "sha": "f2ef98f7d13c5d71dd2a614ed2e6721703a34532", "save_path": "github-repos/coq/fblanqui-color", "path": "github-repos/coq/fblanqui-color/color-f2ef98f7d13c5d71dd2a614ed2e6721703a34532/Conversion/String_of_ATerm.v"} |
import streamlit as st
import pandas as pd
import numpy as np
import nltk
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.pipeline import Pipeline
import joblib
nltk.download('stopwords')
st.title('Email Spam Classifier')
punctuation = ["""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""]
@st.cache
def... | {"hexsha": "145876fe6a4ccd7d0d0567455fd9608795de5c1e", "size": 1263, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "ashwinjohn3/Spam-Classifier", "max_stars_repo_head_hexsha": "cca6c0baa81bea088ccee5c63482537c58633ea9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
from tgcn.nn.gcn import GCNCheb, gcn_pool, gcn_pool_4
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import numpy as np
from load.data import load_mnist
import gcn.graph as ... | {"hexsha": "cb6ddbfb40719486775636a378fe20da0cd89c89", "size": 14278, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/pytorch_based/pytorch_mnist_gcn.py", "max_stars_repo_name": "cassianobecker/tgcn", "max_stars_repo_head_hexsha": "622ae6519abc364f092da47c9aa908eb67e25010", "max_stars_repo_licenses": ["... |
#
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# 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 ... | {"hexsha": "7a47d4b09a61e454965eb2a339f65f4fd4d5a47e", "size": 20855, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unit/test_ops.py", "max_stars_repo_name": "jperez999/NVTabular", "max_stars_repo_head_hexsha": "d089655104dfd486ec1a22985c76ef01e9fb4f56", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from scipy.io import loadmat
def remove_atlas(str):
str = str.replace('BN_Atlas_264_2mm_wkbrois.', '')
return str
#Clean up ROI names
def clean_roi_names(mats):
for i in range(len(mats)):
mats[i] = mats[i].rena... | {"hexsha": "2357d42b1d6e7bb2cc5a96014a9c4c3b9b05ca46", "size": 7776, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/processing.py", "max_stars_repo_name": "danielfrees/TBI_BrainGraph_ML", "max_stars_repo_head_hexsha": "4785b2a95af7ce0bed99cf521bab83461409ddaa", "max_stars_repo_licenses": ["Apache-2.0"],... |
function lempel_ziv_complexity(sequence)
sub_strings = Set()
n = length(sequence)
ind = 1
inc = 1
while true
if ind + inc > n
break
end
sub_str = sequence[ind : ind + inc]
if sub_str in sub_strings
inc += 1
else
push!(sub_s... | {"hexsha": "e787af2e052b5139a996ace8eb83cc280443edee", "size": 637, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/measures.jl", "max_stars_repo_name": "MartinuzziFrancesco/1dCellularAutomata.jl", "max_stars_repo_head_hexsha": "689a9f424ccff0b7d5299c6f896e2affc007341d", "max_stars_repo_licenses": ["MIT"], "m... |
import unittest
import pandas as pd
import numpy as np
import glob
import epr
import src.utils as utils
from src.ggf.detectors import SLSDetector, ATXDetector
class MyTestCase(unittest.TestCase):
# -----------------
# unit tests
# -----------------
def test_szn_interpolation(self):
path_to_... | {"hexsha": "ff00991c6d6242f4488f04a8f707afd286b9f528", "size": 7690, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tests/test_ggf.py", "max_stars_repo_name": "dnf0/kcl-globalgasflaring", "max_stars_repo_head_hexsha": "6cc27d5758d4f8bc3d941c088e1a15895b71209e", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import time
import numpy as np
import multiprocessing as multiprocess
import click
from scipy.stats import logistic as log
from scipy.stats import norm as norm
import scipy.linalg
from scipy.optimize import minimize, fsolve, root, brentq, ridder, newton, bisect
from spikes_activity_generator import generate_spikes, sp... | {"hexsha": "dc9be8952ee8e97123f46a08e642228ef884cb5a", "size": 17626, "ext": "py", "lang": "Python", "max_stars_repo_path": "EP_coupling_linear_regression.py", "max_stars_repo_name": "noashin/kinetic_ising_model_neurons", "max_stars_repo_head_hexsha": "2e775db248214a1289bc9f100125821e11bf1507", "max_stars_repo_licenses... |
import numpy as np
import theano
import theano.tensor as T
# Non Theano Implementation
k = 2 # Raising entire np array to the 2 (squaring)
A = np.array(range(10))
result = 1
for i in range(k):
result = result * A
# print("Non Theano result: ", result)
# Theano Scan Implementation
k = T.iscalar("k")
A = T.vector(... | {"hexsha": "b77e2189c38ca810258788b61714b69371703e4d", "size": 2098, "ext": "py", "lang": "Python", "max_stars_repo_path": "Machine_Learning/hmm/theano_review.py", "max_stars_repo_name": "NathanielDake/nathanieldake.github.io", "max_stars_repo_head_hexsha": "82b7013afa66328e06e51304b6af10e1ed648eb8", "max_stars_repo_li... |
abstract type AbstractWindShearModel end
"""
PowerLawWindShear(shear_exponent, ground_height)
Provides shear exponent and ground height to define wind shear curve.
Ground height may be tuned because the power law does not always hold near the ground.
# Arguments
- `shear_exponent::Float`: defines trajectory of w... | {"hexsha": "8e589970a75f5b9b891a117b715e9ab723fdee47", "size": 2582, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/wind_shear_models.jl", "max_stars_repo_name": "JJCutler/FLOWFarm.jl", "max_stars_repo_head_hexsha": "a6b28edcc048506fcb3602156662e2edfa0a8832", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
# Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | {"hexsha": "4f0cd341abb73e161a1bfd86ba80a5c44f5d7ca3", "size": 19452, "ext": "py", "lang": "Python", "max_stars_repo_path": "open_spiel/python/algorithms/lp_solver.py", "max_stars_repo_name": "alexminnaar/open_spiel", "max_stars_repo_head_hexsha": "c17a390f8a007ccc309f76cb0cfa29f06dc5d2c9", "max_stars_repo_licenses": [... |
# Copyright 2021 Tomoki Hayashi
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""GAN-based text-to-speech task."""
import argparse
import logging
from typing import Callable, Collection, Dict, List, Optional, Tuple
import numpy as np
import torch
from typeguard import check_argument_types, check_return... | {"hexsha": "1a139218b8a8624a432bfb25ee6acae1d9a0502e", "size": 13784, "ext": "py", "lang": "Python", "max_stars_repo_path": "espnet2/tasks/gan_tts.py", "max_stars_repo_name": "roshansh-cmu/espnet", "max_stars_repo_head_hexsha": "5fa6dcc4e649dc66397c629d0030d09ecef36b80", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
[STATEMENT]
lemma fermat_theorem_power_poly[simp]:
fixes a::"'a::prime_card mod_ring"
shows "[:a:] ^ CARD('a::prime_card) ^ n = [:a:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. [:a:] ^ CARD('a) ^ n = [:a:]
[PROOF STEP]
by (auto simp add: Missing_Polynomial.poly_const_pow mod_poly_less) | {"llama_tokens": 128, "file": "Berlekamp_Zassenhaus_Distinct_Degree_Factorization", "length": 1} |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
import numpy as np
import ray
from ray.rllib.agents.registry import get_agent_class
from ray.tune.trial import ExportFormat
def get_mean_action(alg, obs):
o... | {"hexsha": "e1ad5a5a9520085870895e88a59ab84b6efd48a5", "size": 4386, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/ray/rllib/tests/test_checkpoint_restore.py", "max_stars_repo_name": "FieldMrFive/ray", "max_stars_repo_head_hexsha": "a22d6ef95594a3b95fac5b2eb17f7f21be2888e8", "max_stars_repo_licenses": [... |
# ***Question 3***
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
from polyFit import *
from swap import *
from error import *
Re = np.array([0.2,2,20,200,2000,20000]) # the Re values given to us, on x axis
cD = np.array([103,13.9,2.72,0.800,0.401,0.433]) # the cD values given to us... | {"hexsha": "7e3091794df890dcb2045034306fd217c21182c4", "size": 2310, "ext": "py", "lang": "Python", "max_stars_repo_path": "ExamPrep/Shit Comp/SciComp Exam 2016/Assignments 15-16/A1Q3 loglog plots interpolate interp1d cubic spline interpolation polynomial interpl barycentric polyfit.py", "max_stars_repo_name": "FHomewo... |
# -*- coding: utf-8 -*-
"""
Image IO
========
Reading and writing images.
Module adapted by :-
author: Ed Beard
email: ejb207@cam.ac.uk
from FigureDataExtractor (<CITATION>) :-
author: Matthew Swain
email: m.swain@me.com
"""
from __future__ import absolute_import
from __future__ import division
from __future__ impo... | {"hexsha": "d11c0feb9f316bc552bda26b66a1aab8d0523c47", "size": 4635, "ext": "py", "lang": "Python", "max_stars_repo_path": "chemschematicresolver/io.py", "max_stars_repo_name": "michaelmaser/ChemSchematicResolver", "max_stars_repo_head_hexsha": "5e0fa1731f13d2495652d1a26f24fadf0c9c6289", "max_stars_repo_licenses": ["MI... |
import requests # library needed to make HTTP requests
import yaml
import pandas as pd
import numpy as np
from influxdb import InfluxDBClient, DataFrameClient
from lxml import etree # library needed to process xml files
from xml.etree import ElementTree
from datetime import datetime, time
import time
# database connec... | {"hexsha": "2f7d8c5ce84d99f0902faedd39e85ad34923c710", "size": 4873, "ext": "py", "lang": "Python", "max_stars_repo_path": "eGauge_code/Peper_project_remake.py", "max_stars_repo_name": "Azzedine-B/Peper", "max_stars_repo_head_hexsha": "321b4934a00404dc0632d2563f7d2003229be674", "max_stars_repo_licenses": ["MIT"], "max_... |
"""Implementation of the COW class."""
from scipy.stats import uniform
from scipy.integrate import quad
from scipy import linalg
import numpy as np
class Cow:
"""Produce weights using COWs."""
def __init__(self, mrange, gs, gb, Im=1, obs=None, renorm=True, verbose=True):
"""
Initialize Cow o... | {"hexsha": "a3babcdcbee7548815ef6bb615940e675757bcc8", "size": 5465, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sweights/cow.py", "max_stars_repo_name": "matthewkenzie/sweights", "max_stars_repo_head_hexsha": "4bc27261df0b93047709546c7af2e77f0aaf7732", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import pandas as pd
import numpy as np
import itertools
import sys
import warnings
from functools import partial
import statsmodels.api as sm
# import patsy
from scipy.stats import chi2_contingency
from scipy.stats.contingency import expected_freq
from scipy import stats
import fishersapi
from .tally import _dict_t... | {"hexsha": "437071db1510197bf140dd0524b868b5e4e87688", "size": 11136, "ext": "py", "lang": "Python", "max_stars_repo_path": "hierdiff/association_testing.py", "max_stars_repo_name": "kmayerb/hierdiff", "max_stars_repo_head_hexsha": "0e1c6c7ed4390b4a0ae648eeae1990044204d7d6", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# -*- coding: utf-8 -*-
"""
Sequence-to-sequence model with bi-directional encoder and the attention mechanism described in
arxiv.org/abs/1412.2007
and support to buckets.
"""
import copy
import random
import numpy
import pkg_resources
import tensorflow as tf
from tensorflow.models.rnn import seq2se... | {"hexsha": "e6bc0f4b74d96e5e7e96b5e2c6e953458be7f4bc", "size": 50790, "ext": "py", "lang": "Python", "max_stars_repo_path": "tsf_nmt/nmt_models.py", "max_stars_repo_name": "giancds/tsf_nmt", "max_stars_repo_head_hexsha": "82d6fb338ec1395159dfee154b96761750304848", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... | {"hexsha": "8bf3596c2a98a8b3cac8178858c9877a609be3a4", "size": 7427, "ext": "py", "lang": "Python", "max_stars_repo_path": "engines/embedding_models/bert/api.py", "max_stars_repo_name": "koso019003/AM-FM-PM", "max_stars_repo_head_hexsha": "bffbbc8f3c3ce82ff22235b999836bd34f63250d", "max_stars_repo_licenses": ["Apache-2... |
# finite_difference.py:
# As documented in the NRPy+ tutorial notebook:
# Tutorial-Finite_Difference_Derivatives.ipynb ,
# This module generates C kernels for numerically
# solving PDEs with finite differences.
#
# Depends primarily on: outputC.py and grid.py.
# Author: Zachariah B. Etienne
# zachetie *... | {"hexsha": "725de2fc65a3f5c5713864eb9340ba0557f66665", "size": 18107, "ext": "py", "lang": "Python", "max_stars_repo_path": "finite_difference.py", "max_stars_repo_name": "stevenrbrandt/nrpytutorial", "max_stars_repo_head_hexsha": "219af363f810cc46ea8955a9d28cf075f2252582", "max_stars_repo_licenses": ["BSD-2-Clause"], ... |
#reference :
http://onepager.togaware.com/KnitRO.pdf
page 14
#ggplot2
library(rattle) # For the weatherAUS dataset.
library(ggplot2) # To generate a density plot.
png("#21_portfolio_ggplot2_ddensity_plot.png" , width = 800, height = 600)
png("#21_ggplot2_ddensity_plot.png" , width = 480, height = 480)
cities <- c... | {"hexsha": "fb20ba69c43d4b5a4d4c67d5b0fe3452cb7732c2", "size": 537, "ext": "r", "lang": "R", "max_stars_repo_path": "OLD_GALLERY_RSCRIPT/#21_ggplot2_ddensity_plot.r", "max_stars_repo_name": "JedStephens/R-graph-gallery", "max_stars_repo_head_hexsha": "a7a65d2f66372ea3724cf6e930d3c4b209f44dad", "max_stars_repo_licenses"... |
using Documenter
using Pkg
using NahaJuliaLib
DocMeta.setdocmeta!(NahaJuliaLib, :DocTestSetup, :(using NahaJuliaLib); recursive=true)
makedocs(;
modules=[NahaJuliaLib],
authors="MarkNahabedian <naha@mit.edu> and contributors",
repo="https://github.com/MarkNahabedian/NahaJuliaLib.jl/blob/{commit}{path}#{li... | {"hexsha": "eecd21a7b2e07aaddc06674d55c81b0e904d927b", "size": 688, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/make.jl", "max_stars_repo_name": "MarkNahabedian/NahaJuliaLib.jl", "max_stars_repo_head_hexsha": "541a15f287158e7e09fda1eb515f4dc386c05eb5", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import numpy as np
import cv2
class Cusenv():
def __init__(self):
super(Cusenv,self).__init__()
self.img = []
self.prev = []
def reset(self, raw_x , raw_n):#This reset() is specific for denoising
self.img = raw_x + raw_n
self.prev = raw_x + raw_n
self.ground_truth... | {"hexsha": "94e596e8a4511e3c21983bf08cbca77844ab547a", "size": 851, "ext": "py", "lang": "Python", "max_stars_repo_path": "Environment.py", "max_stars_repo_name": "RongkaiZhang/Deep-Reinforcement-Learning-for-Image-Denoising-via-Residual-Recovery", "max_stars_repo_head_hexsha": "9a84ebc45fc6159d87316dbfa0c9ff2088dda951... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 16 08:40:09 2021
@author: Chitra Marti
Based on code from https://github.com/chrisconlon/kiltsnielsen
Goal: Read in raw Nielsen Retail Scanner files, downloadable from the
Kilts File Selection System
https://kiltsfiles.chicagobooth.edu/... | {"hexsha": "517a712cdad411793f0958f3b23316508a667398", "size": 66674, "ext": "py", "lang": "Python", "max_stars_repo_path": "kiltsreader/module.py", "max_stars_repo_name": "smgim/kiltsnielsen", "max_stars_repo_head_hexsha": "bf8a66f7765c998f8dfecf350f0c307c66889bbe", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
\documentclass{beamer}
\mode<presentation>
{
\usetheme{Madrid}
}
\usepackage{graphics, graphicx}
\usepackage{booktabs}
\usepackage{url}
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.gif}
\title{Linux Beginner Guide}
\author{Jaewoong Lee}
\institute[UNIST]
{
Ulsan National Institute of Science and Technology
\medsk... | {"hexsha": "0f93bab34e61df9d59d803a8ae6dc371ee536084", "size": 5148, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "python.tex", "max_stars_repo_name": "Fumire/PythonLecture", "max_stars_repo_head_hexsha": "e7db6741c73fb733b0a5075c1f773a6d679a0dcb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
# encoding:utf-8
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimSun'] # 指定默认字体
plt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题
N_DIMS = 4 # DIM size
DNA_SIZE = N_DIMS * 2 # DNA (real number)
DNA_BOUND = [0, 40] # solution upper and lower ... | {"hexsha": "33d2d39686a0e36732a1306ad9a9e8b25fdd5e8b", "size": 3324, "ext": "py", "lang": "Python", "max_stars_repo_path": "tutorial-contents/DimAutoLayout/MakeAndPlotDim.py", "max_stars_repo_name": "lidegao899/Evolutionary-Algorithm", "max_stars_repo_head_hexsha": "2b36038ecfe6d7bc848eb8ee72d66f9b0f5ff265", "max_stars... |
[STATEMENT]
lemma build_psimp_3:
assumes "1 < length ps" "(k, s) = widest_spread ks ps" "(l, m, r) = partition_by_median k ps"
assumes "build_dom (ks, l)" "build_dom (ks, r)"
shows "build ks ps = Node k m (build ks l) (build ks r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. build ks ps = Node k m (build ks... | {"llama_tokens": 424, "file": "KD_Tree_Build", "length": 2} |
#!/usr/bin/env python
# coding:utf-8
import torch
import numpy as np
import os
from torch import nn
from models.matching_network import MatchingNet
import torch.nn.functional as F
class HiMatchTP(nn.Module):
def __init__(self, config, label_map, graph_model, device, model_mode, graph_model_label=None):
""... | {"hexsha": "3a37ed31dec6f1baf7d540b5c14d2a3d69bbfde7", "size": 3693, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/text_feature_propagation.py", "max_stars_repo_name": "RuiBai1999/HiMatch", "max_stars_repo_head_hexsha": "199ebc6b06b3cce2b3f2298cb9e20f81c01dc7a6", "max_stars_repo_licenses": ["MIT"], "max... |
using ComradeSoss
using Test
@testset "ComradeSoss.jl" begin
# Write your tests here.
end
| {"hexsha": "b1bdc3abbeacac662ae1aab55a847b33e066ef2e", "size": 95, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "ptiede/ComradeSoss.jl", "max_stars_repo_head_hexsha": "15137764a1fc9e8cf6c9b9c3f88cb13accc18a19", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
import glob
import re
from collections import OrderedDict
from pathlib import Path
from typing import Any, List
import numpy as np
import plaidrl.torch.pytorch_util as ptu
from plaidrl.core import eval_util
from plaidrl.core.logging import append_log
from plaidrl.core.meta_rl_algorithm import MetaRLAlgorithm
from pla... | {"hexsha": "e080953752cc9e6f0db997a07a05eb61bdb8a7e6", "size": 14893, "ext": "py", "lang": "Python", "max_stars_repo_path": "plaidrl/torch/smac/launcher_util.py", "max_stars_repo_name": "charliec443/plaid-rl", "max_stars_repo_head_hexsha": "2e8fbf389af9efecd41361df80e40e0bf932056d", "max_stars_repo_licenses": ["MIT"], ... |
#!/usr/bin/env python3
from gan import GAN
from generator import Generator
from discriminator import Discriminator
from keras.layers import Input
from keras.datasets import mnist
from random import randint
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
import os
from PIL import Image
impor... | {"hexsha": "62154ce3c8ef2a6cd8f09f23c30b0be6fa8a8a0e", "size": 6034, "ext": "py", "lang": "Python", "max_stars_repo_path": "Chapter6/src/train.py", "max_stars_repo_name": "AI-Nerd/Generative-Adversarial-Networks-Cookbook", "max_stars_repo_head_hexsha": "f0285efff86a92bc800047ffa65dba60b6e43abb", "max_stars_repo_license... |
"""
AbstractDataFrame
An abstract type for which all concrete types expose an interface
for working with tabular data.
# Common methods
An `AbstractDataFrame` is a two-dimensional table with `Symbol`s or strings
for column names.
The following are normally implemented for AbstractDataFrames:
* [`describe`](@re... | {"hexsha": "5653c4ceba7e489c2b42913ee5760e055f97130c", "size": 60917, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/abstractdataframe/abstractdataframe.jl", "max_stars_repo_name": "Sov-trotter/DataFrames.jl", "max_stars_repo_head_hexsha": "3345f691fcff9c1e29ee7d9de53c59b54283b017", "max_stars_repo_licenses"... |
(* Title: HOL/Library/Sorting_Algorithms.thy
Author: Florian Haftmann, TU Muenchen
*)
theory Sorting_Algorithms
imports MainRLT Multiset Comparator
begin
section \<open>Stably sorted lists\<close>
abbreviation (input) stable_segment :: "'a comparator \<Rightarrow> 'a \<Rightarrow> 'a list \<Rightarro... | {"author": "dtraytel", "repo": "HOLRLT", "sha": "e9029da59bb3af0c835604a65308498f9696a364", "save_path": "github-repos/isabelle/dtraytel-HOLRLT", "path": "github-repos/isabelle/dtraytel-HOLRLT/HOLRLT-e9029da59bb3af0c835604a65308498f9696a364/HOLRLT/Library/Sorting_Algorithms.thy"} |
import os
import shutil
from tqdm import trange
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from gzbuilderspirals.oo import Arm
import theano
import theano.tensor as tt
import pymc3 as pm
import argparse
from sklearn.preprocessing import OrdinalEncoder
import warnings
from astropy.utils.excep... | {"hexsha": "ff6a0726f6eac791df5df0fb7342734cde8445af", "size": 13567, "ext": "py", "lang": "Python", "max_stars_repo_path": "spiral_aggregation/galaxy_pa_mc.py", "max_stars_repo_name": "tingard/Galaxy-builder-aggregation", "max_stars_repo_head_hexsha": "78fec76eeb2ab4b38e241b66fa5643e0002ba3a7", "max_stars_repo_license... |
[STATEMENT]
lemma convex_Affine: "convex (Affine X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. convex (Affine X)
[PROOF STEP]
proof (rule convexI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>x y u v. \<lbrakk>x \<in> Affine X; y \<in> Affine X; 0 \<le> u; 0 \<le> v; u + v = 1\<rbrakk> \<Longrightarr... | {"llama_tokens": 3086, "file": "Affine_Arithmetic_Affine_Form", "length": 24} |
\name{grid.boxplot}
\alias{grid.boxplot}
\title{
Draw a Single Boxplot
}
\description{
Draw a Single Boxplot
}
\usage{
grid.boxplot(value, pos, outline = TRUE, box_width = 0.6,
pch = 1, size = unit(2, "mm"), gp = gpar(fill = "#CCCCCC"),
direction = c("vertical", "horizontal"))
}
\arguments{
\item{value}{A ve... | {"hexsha": "155c164e3200a255c57cbf361774a1cd7951a5cf", "size": 941, "ext": "rd", "lang": "R", "max_stars_repo_path": "man/grid.boxplot.rd", "max_stars_repo_name": "zhongmicai/complexHeatmap", "max_stars_repo_head_hexsha": "02ad1d0a5097d21f748c4bab5f97d1505cdd8642", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import zipfile
from datetime import datetime
from pathlib import Path
from typing import Dict, Optional, Any, Union, Set
import numpy
from PIL.Image import open as pil_open, Image as pil_Image
import rasterio
import ee
from enum import Enum
import requests
from ee import ImageCollection, Geometry, Image
from ee.batc... | {"hexsha": "819e8ed6dc0519d19095dbca2657e553489fed71", "size": 3545, "ext": "py", "lang": "Python", "max_stars_repo_path": "land_mask.py", "max_stars_repo_name": "cliftbar/spectro-gee", "max_stars_repo_head_hexsha": "c1a1a129ece8438ec9146dcd3b9b70a3c24c7cf9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
""" Label Objects
This script, given a .tsv file containing video files, opens them one after
another, prompts the user to draw a bounding box around the object that will
be serving as a target in that video. The bounding boxes will be written in
the same .tsv file. If the given .tsv file already has some of the input... | {"hexsha": "1740afb7823d308ecc3abb9c937382b3c0a98d85", "size": 1979, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/motion/label_objects.py", "max_stars_repo_name": "isi-vista/adam-visual-perception", "max_stars_repo_head_hexsha": "8ad6ed883b184b5407a1bf793617b226c78b3a13", "max_stars_repo_licenses": ["... |
{-# OPTIONS --without-K #-}
module sum where
open import level using (Level; _⊔_)
open import function.core
infixr 4 _,_
infixr 2 _×_
infixr 1 _⊎_
record Σ {a b} (A : Set a) (B : A → Set b) : Set (a ⊔ b) where
constructor _,_
field
proj₁ : A
proj₂ : B proj₁
open Σ public
_×_ : {l k : Level} (A : Set l... | {"hexsha": "5e37eb1d9c791b710707b0dc6a6ac10651099ec8", "size": 1124, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "sum.agda", "max_stars_repo_name": "HoTT/M-types", "max_stars_repo_head_hexsha": "beebe176981953ab48f37de5eb74557cfc5402f4", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 27, "max... |
[STATEMENT]
lemma femptyE [elim!]: "a |\<in>| {||} \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. a |\<in>| {||} \<Longrightarrow> P
[PROOF STEP]
by simp | {"llama_tokens": 77, "file": null, "length": 1} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.