text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import math
from functools import reduce
# import pytorch_lightning as pl
import torch
from torch import nn
import torch.nn.functional as F
import random
import numpy as np
# helpers
def prob_mask_like(t, prob):
return torch.zeros_like(t).float().uniform_(0, 1) < pro... | {"hexsha": "ca25758e3390c28b097f4dda2fc61b1736a16636", "size": 7328, "ext": "py", "lang": "Python", "max_stars_repo_path": "tkitAutoMask/mask.py", "max_stars_repo_name": "napoler/tkit-automask", "max_stars_repo_head_hexsha": "ee6a85af36c971c54793d14c4e7e07c87a24bb58", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
(*
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: BSD-2-Clause
*)
theory WPBang
imports
WP
Eisbach_Tools.ProvePart
NonDetMonadVCG
begin
lemma conj_meta_forward:
"P \<and> Q \<Longrightarrow> (P \<Longrightarrow> P') \<Longrightarrow> (Q \<Longrightarrow> Q') \<Longrighta... | {"author": "seL4", "repo": "l4v", "sha": "9ba34e269008732d4f89fb7a7e32337ffdd09ff9", "save_path": "github-repos/isabelle/seL4-l4v", "path": "github-repos/isabelle/seL4-l4v/l4v-9ba34e269008732d4f89fb7a7e32337ffdd09ff9/lib/Monads/wp/WPBang.thy"} |
[STATEMENT]
lemma cong_diff_trans[trans]:
"[a = b - x] (mod n) \<Longrightarrow> [x = y] (mod n) \<Longrightarrow> [a = b - y] (mod n)"
"[a = x - b] (mod n) \<Longrightarrow> [x = y] (mod n) \<Longrightarrow> [a = y - b] (mod n)"
"[b - x = a] (mod n) \<Longrightarrow> [x = y] (mod n) \<Longrightarrow> [b - y = ... | {"llama_tokens": 642, "file": "Probabilistic_Prime_Tests_Algebraic_Auxiliaries", "length": 2} |
[STATEMENT]
lemma D_append[iff]: "\<And>A. \<D>s (es @ es') A = (\<D>s es A \<and> \<D>s es' (A \<squnion> \<A>s es))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>A. \<D>s (es @ es') A = (\<D>s es A \<and> \<D>s es' (A \<squnion> \<A>s es))
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1... | {"llama_tokens": 232, "file": "JinjaThreads_J_DefAss", "length": 2} |
import numpy as np
class Agent():
def __init__(self, lr, gamma, n_actions, n_states, eps_start, eps_end,
eps_dec):
self.lr = lr
self.gamma = gamma
self.n_actions = n_actions
self.n_states = n_states
self.epsilon = eps_start
self.eps_min = eps_end
... | {"hexsha": "43c7ef39f7952c52056013747aa798cf891602d3", "size": 1456, "ext": "py", "lang": "Python", "max_stars_repo_path": "q_learning/q_learning_agent.py", "max_stars_repo_name": "Srikanth-Kb/Deep-Q-Learning-Paper-To-Code", "max_stars_repo_head_hexsha": "0351272399847e23aa1509c04781507e5a34d3dd", "max_stars_repo_licen... |
# Source: http://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline
# http://people.wku.edu/qi.li/teaching/446/cg14_curve_surface.pdf
import numpy as np
from utils import distance
def CatmullRomSpline(P0, P1, P2, P3, nPoints=100):
"""
P0, P1, P2, and P3 should be (x,y) point pairs that define the Cat... | {"hexsha": "a3a62cced88f20b7a24320490c467244f76df642", "size": 1950, "ext": "py", "lang": "Python", "max_stars_repo_path": "catmullrom.py", "max_stars_repo_name": "andrewyang96/RacetrackGenerator", "max_stars_repo_head_hexsha": "9febabb7fb782951ab6a01b5330171f6e4c8cacf", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
""" check-controllability-and-observability.py
Example to check the controllability and the observability of a state space system.
RMM, 6 Sep 2010
"""
from __future__ import print_function
from scipy import * # Load the scipy functions
from control.matlab import * # Load the controls systems library
# Parameters ... | {"hexsha": "d20416f1f136c7ac312a3514acf1ca24915cae89", "size": 748, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/check-controllability-and-observability.py", "max_stars_repo_name": "joaoantoniocardoso/python-control", "max_stars_repo_head_hexsha": "1ab67560db5319843a2c43a20944da061011399d", "max_star... |
import numpy as np
import torch
from ..utils import common_functions as c_f
def split_half(x, dim):
d = x.shape[dim] // 2
return torch.split(x, d, dim=dim)
def num_elements_minus_diag(x):
n = x.shape[0]
return n * (n - 1)
def get_kernel_scales(low=-8, high=8, num_kernels=33, base=2.0):
return... | {"hexsha": "2628d9ac29094d6fb3c2daaf5f59ca63fe47b0a5", "size": 4108, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/pytorch_adapt/layers/utils.py", "max_stars_repo_name": "MarkusSagen/pytorch-adapt", "max_stars_repo_head_hexsha": "947b9f1b748d2078cecbf4a00c34f73108d9ecde", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
import pandas as pd
import streamlit as st
from PIL import Image
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
st.write("""
# Favorite Object detection CNN
"""
)
st.write("This is a simple web app to classify images... | {"hexsha": "0214240417ece8c13b568e43533fae0ef4efeb8e", "size": 1242, "ext": "py", "lang": "Python", "max_stars_repo_path": "streamlit_app.py", "max_stars_repo_name": "rubenwo/ml3", "max_stars_repo_head_hexsha": "aa1de2ad27c4906a6158ee82e11ba7bb10da9ce7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <iostream>
#include <sstream>
using namespace boost::archive;
std::stringstream ss;
class animal
{
public:
animal() = default;
animal(int legs) : legs_{legs} {}
int legs() const { return legs_; }
private:
friend cl... | {"hexsha": "738a7692b198122c3c07d2011ccbd5febf13d787", "size": 1193, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Example/serialization_11/main.cpp", "max_stars_repo_name": "KwangjoJeong/Boost", "max_stars_repo_head_hexsha": "29c4e2422feded66a689e3aef73086c5cf95b6fe", "max_stars_repo_licenses": ["MIT"], "max_st... |
using MechanicalSketch
import MechanicalSketch: foil_spline_local
import MechanicalSketch: text, circle, Turtle, Pencolor, Penwidth, Forward, Turn
import MechanicalSketch: HueShift, O, sethue, finish, EM, WI, background, empty_figure
let
empty_figure(filename = joinpath(@__DIR__, "test_1.png"));
background("mid... | {"hexsha": "02f1685ea67d8290c9d3740913d695faf8457beb", "size": 1006, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_1.jl", "max_stars_repo_name": "hustf/MechanicalSketch.jl", "max_stars_repo_head_hexsha": "162102d6ccbb5a25911b0a36074295832c7d858e", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import importlib
import numpy as np
import torch
import torch.nn as nn
from torchvision import models
class CILRSModel(nn.Module):
def __init__(
self,
backbone='resnet18',
pretrained=True,
normalize=True,
num_branch=6,
speed_dim=1,
embedding_dim=512,
... | {"hexsha": "a7b6a248c08212d00b95df80a54c2e4f8a3ed3b2", "size": 3405, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/models/cilrs_model.py", "max_stars_repo_name": "L-Net-1992/DI-drive", "max_stars_repo_head_hexsha": "cc7f47bedbf60922acbcf3a5f77fc8e274df62cf", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
import numpy as np
import cv2 as cv
import glob
import math
import random
from matplotlib import pyplot as plt
# from scipy.optimize import leastsq
from skspatial.objects import Plane, Points
from skspatial.plotting import plot_3d
#-------------------------#
# HOUGH LINES BUNDLER #
#-------------------------#
cla... | {"hexsha": "8ac342bb29cd3544b763f7b79e06e6e8cab74f60", "size": 13867, "ext": "py", "lang": "Python", "max_stars_repo_path": "proj1/extrinsic.py", "max_stars_repo_name": "EduRibeiro00/feup-vcom", "max_stars_repo_head_hexsha": "d856cd2c260c72df7c5b85191f54e241b8efdc7e", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
directory = '../../model'
reward_his_path1 = os.path.join(directory, 'history_loss-400.pkl')
#reward_his_path2 = os.path.join(directory, 'plot_wgan_gp.pkl')
#reward_his_path3 = os.path.join(directory, 'plot_wgan.pkl')
def plot():
reward_hi... | {"hexsha": "47e330987570429be93d3bd73daa326a3269eb67", "size": 735, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/util/plot.py", "max_stars_repo_name": "samirsahoo007/Conditional-SeqGAN-Tensorflow", "max_stars_repo_head_hexsha": "3610e606e845ebf40ac8a832aa5d5ca16fbf9013", "max_stars_repo_licenses": ["MIT"]... |
theory Prelude_ListNoNumbers__E5
imports "$HETS_ISABELLE_LIB/MainHC"
uses "$HETS_ISABELLE_LIB/prelude"
begin
setup "Header.initialize
[\"Comp1\", \"IdDef\", \"FlipDef\", \"FstDef\", \"SndDef\",
\"CurryDef\", \"UncurryDef\", \"NotFalse\", \"NotTrue\",
\"AndFalse\", \"AndTrue\", \"AndSym\", \"OrDe... | {"author": "glaubersp", "repo": "HasCASL-Library_Source", "sha": "be605b06acfc124d8e88829cc931a1148ea30460", "save_path": "github-repos/isabelle/glaubersp-HasCASL-Library_Source", "path": "github-repos/isabelle/glaubersp-HasCASL-Library_Source/HasCASL-Library_Source-be605b06acfc124d8e88829cc931a1148ea30460/Prelude.Stri... |
import shutil
from pathlib import Path
import pickle
import tensorflow as tf
import os
import numpy as np
from models.PositiveLearningElkan.pu_learning import PULogisticRegressionSK
from models.model_base import DetektorModel
from project_paths import ProjectPaths
from evaluations.area_roc import ROC, plot_roc
from m... | {"hexsha": "c53c47749eeb2bfb06815053c1a35256fab19c1c", "size": 14780, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_files/single_train.py", "max_stars_repo_name": "sfvnDTU/deep_detektor", "max_stars_repo_head_hexsha": "3413b805b1d108480358a3f50ec5bb18b1d6845b", "max_stars_repo_licenses": ["MIT"], "max_star... |
import numpy as np
from typing import Tuple
from typing import Union
from typing import Sequence
class ReplayBuffer: # todo maybe do more clean in the future
def __init__(self, max_size: int, input_shape: Union[Sequence[int], int], num_actions: int):
self.memory_counter = 0
self.memory_size = in... | {"hexsha": "9433bb919fedea7b26fd489b90f8328304f2c439", "size": 1693, "ext": "py", "lang": "Python", "max_stars_repo_path": "soft_actor_critic/memory.py", "max_stars_repo_name": "thomashirtz/pytorch-soft-actor-critic", "max_stars_repo_head_hexsha": "501810da3c8d470f74b646e7b822b07378edc8be", "max_stars_repo_licenses": [... |
'''
Takes in video_list as input, which consist of paths to jpg files of all testing video.
Returns result stored in json file(a list of dictionaries):
Element can be original clip features or mean feature of a video
'''
import os
import sys
import json
import subprocess
import numpy as np
import torch
from torch impor... | {"hexsha": "cd34911e9bfca3da1cccf2346cfe755b8e5a3077", "size": 3003, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "MYusha/video-classification-3d-cnn-pytorch", "max_stars_repo_head_hexsha": "12e317c65df5306235da6bf2e0d872babbe5cf65", "max_stars_repo_licenses": ["MIT"], "max_st... |
function process_reload_hash(request::HTTP.Request, state::HandlerState)
reload_tuple = (
reloadHash = state.reload.hash,
hard = state.reload.hard,
packages = keys(state.cache.resources.files),
files = state.reload.changed_assets
)
state.reload.hard = false
state.reload.c... | {"hexsha": "38952c1c51bffa1435b273db3c0b03c51ae59115", "size": 447, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/handler/processors/reload_hash.jl", "max_stars_repo_name": "waralex/Dash.jl", "max_stars_repo_head_hexsha": "f0606e07d2479fd8b5be1da4a6a59656e24acfa3", "max_stars_repo_licenses": ["MIT"], "max_s... |
include("tools.jl")
include("loadFiles.jl")
xf = XLSX.open_empty_template()
# Testing class matches
#counter = 1
# Iterate over all classes:
classFile = "/Users/cfranken/GDrive/work/Caltech/OptionRepWork/TA2021/GPSClassList_2021.xlsx"
tabs = ["Division", "Geology", "Geophysics", "Geobiology", "Geochemistry", "Pl... | {"hexsha": "918a2ccdd7484a78cc10f3652e3f33924ce0cec6", "size": 2036, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "performAnalysis_v2.jl", "max_stars_repo_name": "cfranken/TA-matching", "max_stars_repo_head_hexsha": "d7bce40f21b22b9297edc5c40f872293cb71add2", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
c
subroutine kalman(F,dta,Y,p,it,w,v,x,xt,imax,m,atime,stn)
c
c*********************************************************************
c
c Routine to apply Kalman Filter to a set of obs for QC purposes.
c
c Original: John McGinley, NOAA/FSL Spring 1998
c Changes:
c 21 Aug 1998 Peter Stamus,... | {"hexsha": "29e5114f0ec1f9fe9d76ac6c2abe96ee1943466e", "size": 5952, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/ingest/sfc_qc/kalman.f", "max_stars_repo_name": "maxinye/laps-mirror", "max_stars_repo_head_hexsha": "b3f7c08273299a9e19b2187f96bd3eee6e0aa01b", "max_stars_repo_licenses": ["Intel", "Unlicense... |
# step3_train.py
"""Use projected data to learn reduced-order models via Tikhonov-regularized
Operator Inference with regularization hyperparameter selection.
Examples
--------
## --single: train and save a single ROM for a given λ1, λ2.
# Use 10,000 projected snapshots to learn a ROM of dimension r = 24
# with regul... | {"hexsha": "35062e8dc83b2ff6ae5561f6440004791fa5f823", "size": 22476, "ext": "py", "lang": "Python", "max_stars_repo_path": "step3_train.py", "max_stars_repo_name": "shanemcq18/ROM-OpInf-Combustion-2D", "max_stars_repo_head_hexsha": "73a99bd7ebbfb6d071c4cd150d17b6291b7d1dd0", "max_stars_repo_licenses": ["MIT"], "max_st... |
# This program is designed to implement the Trapezoid Rule for numerical integration
from __future__ import division
import numpy as np
def Tz(f, a, b, n, args):
# Inputs:
# f - the function being integrated
# a - lower integration limit
# b - upper integration limit
# n - the number of "bins" to integrate over
... | {"hexsha": "02c140d4a0c11c0a0121e03b13cf4fff17e2b958", "size": 2078, "ext": "py", "lang": "Python", "max_stars_repo_path": "integration/trapezoid.py", "max_stars_repo_name": "anna-elsa/solvers", "max_stars_repo_head_hexsha": "25e4f00db447fde3461b477aa7247d65c6cdf27b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import numpy as np
from pySDC.core.Problem import ptype
from pySDC.implementations.datatype_classes.particles import particles, fields, acceleration
class planewave_single(ptype):
"""
Example implementing a single particle spiraling in a trap
"""
def __init__(self, cparams, dtype_u=particles, dtype... | {"hexsha": "f76d99fc7f0d426183b63f7169e565fb1319b868", "size": 4465, "ext": "py", "lang": "Python", "max_stars_repo_path": "pySDC/playgrounds/Boris/spiraling_particle_ProblemClass.py", "max_stars_repo_name": "janEbert/pySDC", "max_stars_repo_head_hexsha": "167d78c4118bc3a5a446ec973fe65fb35db94471", "max_stars_repo_lice... |
"""
formulagrader.py
"""
from __future__ import print_function, division, absolute_import, unicode_literals
from numbers import Number
import numpy as np
import six
from voluptuous import Schema, Required, Any, All, Invalid, Length
from mitxgraders.comparers import equality_comparer
from mitxgraders.sampling import sc... | {"hexsha": "ae6bdddbbaec01fc3c7317610c068e37fb7068bb", "size": 18939, "ext": "py", "lang": "Python", "max_stars_repo_path": "python_lib/mitxgraders/formulagrader/formulagrader.py", "max_stars_repo_name": "haharay/python_lib", "max_stars_repo_head_hexsha": "8acfc634ceb1943da5163c81b79bad126b27212f", "max_stars_repo_lice... |
function F = diff(F, dim, n)
%DIFF Componentwise derivative of a DISKFUNV.
% DIFF(F) is the derivative of each component of F in
% x-direction.
%
% DIFF(F, DIM) is the first derivative of F along the
% dimension DIM.
% DIM = 1 (default) is the derivative in the x-direction.
% DIM = 2 is the derivative... | {"author": "chebfun", "repo": "chebfun", "sha": "8c49396a55e46ddd57a1d108c6a8f32e37536d54", "save_path": "github-repos/MATLAB/chebfun-chebfun", "path": "github-repos/MATLAB/chebfun-chebfun/chebfun-8c49396a55e46ddd57a1d108c6a8f32e37536d54/@diskfunv/diff.m"} |
[STATEMENT]
lemma spr_sim_r:
"sim_r SPR.MC spr_simMC spr_sim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sim_r SPR.MC spr_simMC spr_sim
[PROOF STEP]
proof(rule sim_rI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>a u v'. \<lbrakk>u \<in> worlds SPR.MC; (spr_sim u, v') \<in> relations spr_simMC a\<rb... | {"llama_tokens": 6967, "file": "KBPs_SPRViewNonDet", "length": 42} |
"""
This program implements the DC power flow as a linear program
"""
from pulp import *
import numpy as np
import pandas as pd
from scipy.sparse import hstack as hstack_s, vstack as vstack_s
from GridCal.Engine import *
class AcOPf:
def __init__(self, circuit: MultiCircuit, voltage_band=0.1):
"""
... | {"hexsha": "f814719e3763efba2c359a135d19a864304bd5e4", "size": 20336, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/research/opf/ac_opf.py", "max_stars_repo_name": "mzy2240/GridCal", "max_stars_repo_head_hexsha": "0352f0e9ce09a9c037722bf2f2afc0a31ccd2880", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
# The random pools in pool_info were created by uniformly randomly sampling from
# all images in a particular split. Sometimes this means the list of 100 images
# in a random pool contains the root image itself. In order to avoid that, this
# script simply moves the duplicate to the back of the list.
import pickle as p... | {"hexsha": "20dfe6e0f5a9a0638aaa384dee7fd218f7f10a2c", "size": 1368, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/filter_pool_info.py", "max_stars_repo_name": "soumye/dialog_without_dialog", "max_stars_repo_head_hexsha": "9f95d6fb457659f9007445d9036b94e639bddd8b", "max_stars_repo_licenses": ["MIT"], "ma... |
(*
Copyright 2022 ZhengPu Shi
This file is part of CoqExt. It is distributed under the MIT
"expat license". You should have recieved a LICENSE file with it.
purpose : Basic configuration (Library, Notations, Warning, etc.)
author : ZhengPu Shi
date : 2022.06
remark :
1. Basic libraries ... | {"author": "zhengpushi", "repo": "CoqMatrix", "sha": "28fa5f96e38a07659cfd373e09b0e75c24c22bfd", "save_path": "github-repos/coq/zhengpushi-CoqMatrix", "path": "github-repos/coq/zhengpushi-CoqMatrix/CoqMatrix-28fa5f96e38a07659cfd373e09b0e75c24c22bfd/CoqMatrix/CoqExt/BasicConfig.v"} |
[STATEMENT]
lemma mapl_G_comp: "mapl_G l1 l2 \<circ> mapl_G l1' l2' = mapl_G (l1 \<circ> l1') (l2 \<circ> l2')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. mapl_G l1 l2 \<circ> mapl_G l1' l2' = mapl_G (l1 \<circ> l1') (l2 \<circ> l2')
[PROOF STEP]
unfolding mapl_G_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):... | {"llama_tokens": 485, "file": "BNF_CC_Axiomatised_BNF_CC", "length": 5} |
(*===========================================================================
Specification logic -- step-indexed and with hidden frames
This is a step-indexed version of the specification logic defined in Chapter
3 of Krishnaswami's thesis, which is adapted from Birkedal et al.
A specification S is a ... | {"author": "jbj", "repo": "x86proved", "sha": "d314fa6d23c064a2be4bf686ac7da16a591fda01", "save_path": "github-repos/coq/jbj-x86proved", "path": "github-repos/coq/jbj-x86proved/x86proved-d314fa6d23c064a2be4bf686ac7da16a591fda01/src/spec.v"} |
using Documenter, Jack
makedocs(;
modules=[Jack],
format=Documenter.HTML(),
pages=[
"Home" => "index.md",
],
repo="https://github.com/TsuMakoto/Jack.jl/blob/{commit}{path}#L{line}",
sitename="Jack.jl",
authors="TsuMakoto",
assets=String[],
)
deploydocs(;
repo="github.com/Ts... | {"hexsha": "84283f8b3b1e2079ce15ccecbce8e1091fbbfc3d", "size": 340, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/make.jl", "max_stars_repo_name": "TsuMakoto/Jack.jl", "max_stars_repo_head_hexsha": "73c9d9c0827de93ec603b881d59aba5e1ce4dd15", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
%\section{Quickstart Guide}
% The quickstart guide should explain in simple terms and with examples
% how a user is supposed to achieve the most common usecases. E.g. how
% to submit and cancel a job, how to receive a job's output. How to
% create a grid file, move it around, locate it, and delete it. How to
% mon... | {"hexsha": "7eddcbc4173faa7b99c8bbb79d1ab47cafe1ab35", "size": 35844, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "users-guide/WMS/quickstart.tex", "max_stars_repo_name": "italiangrid/wms", "max_stars_repo_head_hexsha": "5b2adda72ba13cf2a85ec488894c2024e155a4b5", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
# This file is part of the scanning-squid package.
#
# Copyright (c) 2018 Logan Bishop-Van Horn
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | {"hexsha": "54d867f360fa0cef49ca3613476cb23aec493301", "size": 12347, "ext": "py", "lang": "Python", "max_stars_repo_path": "scanning-squid/plots.py", "max_stars_repo_name": "moler-group/scanning-squid", "max_stars_repo_head_hexsha": "32a61e8f8f4f6671f04e583752e361cb00276188", "max_stars_repo_licenses": ["MIT"], "max_s... |
import logging
import os
import pickle
from glob import glob
import librosa
import numpy as np
from tqdm import tqdm
from utils import parallel_function
logger = logging.getLogger(__name__)
SENTENCE_ID = 'sentence_id'
SPEAKER_ID = 'speaker_id'
FILENAME = 'filename'
def find_files(directory, pattern='**/*.wav'):
... | {"hexsha": "7da509d1d6919873877849a54d641baa90222700", "size": 7297, "ext": "py", "lang": "Python", "max_stars_repo_path": "audio_reader.py", "max_stars_repo_name": "mrjj/deep-speaker", "max_stars_repo_head_hexsha": "68703d8d3090d5036b77b475d7ac75e5ef9cc8ec", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
[STATEMENT]
lemma ipurge_tr_rev_aux_first [rule_format]:
"ipurge_tr_rev_aux I D U xs = x # ws \<longrightarrow>
(\<exists>ys zs. xs = ys @ x # zs \<and>
ipurge_tr_rev_aux I D (sources_aux I D U (x # zs)) ys = [] \<and>
(\<exists>v \<in> sources_aux I D U zs. (D x, v) \<in> I))"
[PROOF STATE]
proof (prove)
go... | {"llama_tokens": 8000, "file": "Noninterference_Ipurge_Unwinding_IpurgeUnwinding", "length": 39} |
# This file creates a dataset with the labels and backgrounds that are provided
# Import libraries
import numpy as np
import cv2, os, math, random
from glob import glob
from PIL import Image
## Define all parameters for the dataset manipulation
copies_in_train = 7000
copies_in_val = 3000
desired_width = 300
desired_h... | {"hexsha": "11fd05c76e32bfd0accdc9d76abf5ac9ea92297b", "size": 7759, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/generate-data.py", "max_stars_repo_name": "CUFCTL/dlbd-ci", "max_stars_repo_head_hexsha": "7d0b040e730f01e79cb749fa55361b32456c5175", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
from abc import abstractmethod
import numpy as np
from quara.loss_function.loss_function import LossFunction, LossFunctionOption
from quara.protocol.qtomography.standard.standard_qtomography import StandardQTomography
class MinimizationResult:
def __init__(self, value: np.ndarray, computation_time: flo... | {"hexsha": "0b4cbb1f59a854ddf0ace91a30226884d473d765", "size": 8522, "ext": "py", "lang": "Python", "max_stars_repo_path": "quara/minimization_algorithm/minimization_algorithm.py", "max_stars_repo_name": "tknrsgym/quara", "max_stars_repo_head_hexsha": "8f3337af83cdd02bb85632bb1e297902b1fff8fb", "max_stars_repo_licenses... |
////////////////////////////////////////////////////////////////////////////////
// Name: vi.cpp
// Purpose: Implementation of class wex::vi
// http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html
// Author: Anton van Wezenbeek
// Copyright: (c) 2020-2022 Anton van Wezenbeek
//////////... | {"hexsha": "8d7d78a030f7767fbff19c60f4a82ae270574fde", "size": 20184, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/vi/vi.cpp", "max_stars_repo_name": "antonvw/wxExtension", "max_stars_repo_head_hexsha": "d5523346cf0b1dbd45fd20dc33bf8d679299676c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 9.0, "... |
using RecipesBase
export McmcSampler, SnfMcmcOutput
struct McmcSampler{T<:McmcMove}
move::T
output::McmcOutputParameters
function McmcSampler(
move::T;
desired_samples::Int=1000, burn_in::Int=0, lag::Int=1
) where {T<:McmcMove}
output = McmcOutputParameters(desired_samples, ... | {"hexsha": "b2e7b461929971f2804098e141c2f19b6760fa5c", "size": 2120, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Graph Models/SNF/Samplers/SNF_model_sampler.jl", "max_stars_repo_name": "gmbolt/InteractionNetworkModels.jl", "max_stars_repo_head_hexsha": "bdea22adf934ca60185e68ca47d7396fb1069f94", "max_star... |
[STATEMENT]
lemma dg_Rel_Obj_iff: "x \<in>\<^sub>\<circ> dg_Rel \<alpha>\<lparr>Obj\<rparr> \<longleftrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (x \<in>\<^sub>\<circ> dg_Rel \<alpha>\<lparr>Obj\<rparr>) = (x \<in>\<^sub>\<circ> Vset \<alpha>)
[PROOF STEP]
unfoldi... | {"llama_tokens": 206, "file": "CZH_Foundations_czh_digraphs_CZH_DG_Rel", "length": 2} |
import numpy as np
from sklearn.model_selection import ParameterGrid, ParameterSampler
from recpy.metrics import roc_auc, precision, recall, map, ndcg, rr
from recpy.utils.data_utils import df_to_csr
from recpy.utils.split import k_fold_cv
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(
l... | {"hexsha": "1a0e90c5d32b321846548d4e4bd8ba3c9ab6f989", "size": 8102, "ext": "py", "lang": "Python", "max_stars_repo_path": "RecPy/recpy/utils/tuning.py", "max_stars_repo_name": "Helma-T/recsys-course-2016-pub", "max_stars_repo_head_hexsha": "28bea50e211137f03c39ec97566510ba331946c9", "max_stars_repo_licenses": ["MIT"],... |
"""
This file contains helper functions for quantitative evaluations reported in the paper
"""
import os
import sys
import numpy as np
import torch
from progressbar import ProgressBar
from chamfer_distance import ChamferDistance
from data import PartNetDataset, PartNetShapeDiffDataset
import utils
def compute_re... | {"hexsha": "ce6d4c98de6a6f3b5aeb88ae5d50684edbcd957b", "size": 10924, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/eval_utils.py", "max_stars_repo_name": "daerduoCarey/structedit", "max_stars_repo_head_hexsha": "79c4b076ade9975b9d3a68dbea5b6ab42a9001e7", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
using Test
using NeXLMatrixCorrection
#@testset "XPhi" begin
@testset "Mg in Al at 25 keV" begin
# See Figure 1 of Merlet 1994
m, cxr, e0, toa = mat"Al", n"Mg K-L3", 25.0e3, deg2rad(40.0)
xp = matrixcorrection(XPhi, m, inner(cxr), e0)
@test isapprox(NeXLMatrixCorrection.ϕ0(xp), 1.4... | {"hexsha": "850108e5516180c7e0db63e8f64f87f64b5176c7", "size": 1676, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/xphi.jl", "max_stars_repo_name": "NicholasWMRitchie/NeXLMatrixCorrection", "max_stars_repo_head_hexsha": "601f6e42880fd97b4bfdbeb5a0ee8d1364b6041b", "max_stars_repo_licenses": ["Unlicense"], "... |
import tensorflow as tf
# import tensorflow_text as text
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
import pandas as pd
import numpy as np
import json
import tensorflow_datasets as tfds
import pickle
from nltk.tokenize import WordPunctToke... | {"hexsha": "29fd00836e9b36268a2297b1bd1b6d349dc3f018", "size": 6159, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/features/build.py", "max_stars_repo_name": "jmstevens/aesopbot", "max_stars_repo_head_hexsha": "24c148e3b56820d2df81574c01eb2d023356f9dd", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import os
os.environ['QT_QPA_PLATFORM']='offscreen'
import gc
import sys
import time
import logging
import argparse
import matplotlib.colors
import numpy as np
import pandas as pd
from Bio import Phylo
from itertools import filterfalse
from ete3 import Tree
from GetConfig import getConfig
'''
Description:
This modul... | {"hexsha": "96762ff09603864ccffbe4ae4e9d4714de420a4b", "size": 36666, "ext": "py", "lang": "Python", "max_stars_repo_path": "LineageTracker/PhyloHaplogroup.py", "max_stars_repo_name": "Shuhua-Group/Y-LineageTracker", "max_stars_repo_head_hexsha": "82b14c74be95ef2d4d929ce20bf7436869f163ea", "max_stars_repo_licenses": ["... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.ndimage
def plotData(X, y):
# Find Indices of Positive and Negative Examples
pos = np.where(y == 1)
neg = np.where(y == 0)
plt.scatter(X[pos,0], X[pos,1], c='b', label='1')
plt.scatter(X[neg,0], X[neg,1], c='r', label='0')
plt.lege... | {"hexsha": "8f861eb1d8b523c08a38db2402612376b221328a", "size": 1485, "ext": "py", "lang": "Python", "max_stars_repo_path": "ML2020_HW3/utils.py", "max_stars_repo_name": "chongwen8/Machine-Learning-Courseworks", "max_stars_repo_head_hexsha": "374210f0b77cfa166f2270cae6cce7fdd4ed62c0", "max_stars_repo_licenses": ["MIT"],... |
# -*- coding: utf-8 -*-
from vispy.scene.node import Node
from vispy.testing import (requires_application, TestingCanvas,
run_tests_if_main, raises)
from vispy.visuals.transforms import STTransform
import numpy as np
class EventCheck(object):
def __init__(self, emitter):
self._e... | {"hexsha": "69ddb7bd32411d28a8cd8739bde86256b77e65eb", "size": 5004, "ext": "py", "lang": "Python", "max_stars_repo_path": "vispy/scene/tests/test_node.py", "max_stars_repo_name": "hmaarrfk/vispy", "max_stars_repo_head_hexsha": "7f3f6f60c8462bb8a3a8fa03344a2e6990b86eb2", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
import Serialization
function stack(io::IO,msg::Vector{UInt8})
frontbytes = reinterpret(UInt8,Int16[length(msg)])
item = UInt8[frontbytes...,msg...]
write(io,item)
end
function unstack(io::IO)
sizebytes = [read(io,UInt8),read(io,UInt8)]
size = reinterpret(Int16,sizebytes)[1]
msg = UInt8[]... | {"hexsha": "b08974352d0d972a1730b84387964b321b32e02a", "size": 876, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "research/stacking.jl", "max_stars_repo_name": "PeaceFounder/PeaceVote.jl", "max_stars_repo_head_hexsha": "f02f208cd673957ad626c8dfa64b24173f80842f", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 7 18:52:58 2022
@author: Analabha Roy
"""
import numpy as np
def GEPP(A, b, doPP=True):
'''
Gaussian elimination with partial pivoting.
input: A is an n x n numpy matrix
b is an n x 1 numpy array
output: x is the solut... | {"hexsha": "3404ca054f38b5897531caef9a120bae6c9d1956", "size": 2661, "ext": "py", "lang": "Python", "max_stars_repo_path": "03-Computational_Linear_Algebra/gauss_method_ex.py", "max_stars_repo_name": "hariseldon99/msph402b", "max_stars_repo_head_hexsha": "20d2df0ca7c7216c504669ea1495a84de1b217d5", "max_stars_repo_licen... |
import numpy as np
from numpy_groupies import aggregate
import sys
sys.path.append("python")
from SurfStatEdg import *
def py_SurfStatSmooth(Y, surf, FWHM):
"""Smooths surface data by repeatedly averaging over edges.
Parameters
----------
Y : numpy array of shape (n,v) or (n,v,k)
surface data,... | {"hexsha": "772ad215db3e72bf15d0100370c1edbc7ad474de", "size": 2281, "ext": "py", "lang": "Python", "max_stars_repo_path": "surfstat/python/SurfStatSmooth.py", "max_stars_repo_name": "rudimeier/BrainStat", "max_stars_repo_head_hexsha": "a5ef474ffd70300ecf5fa464fff4a41e71f4b7a1", "max_stars_repo_licenses": ["BSD-3-Claus... |
[STATEMENT]
lemma fo_nmlzd_mono: "Inl -` set xs \<subseteq> AD \<Longrightarrow> fo_nmlzd AD' xs \<Longrightarrow> fo_nmlzd AD xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>Inl -` set xs \<subseteq> AD; fo_nmlzd AD' xs\<rbrakk> \<Longrightarrow> fo_nmlzd AD xs
[PROOF STEP]
by (auto simp: fo_nmlzd_def) | {"llama_tokens": 133, "file": "Eval_FO_Ailamazyan", "length": 1} |
''' A toy example of playing against rule-based bot on Wizard with trick predictions.
'''
import numpy as np
import rlcard
from rlcard import models
from rlcard.agents import RandomAgent
import torch
import os
import argparse
import random
def run_example(args):
# Make environment
config = {
'env':... | {"hexsha": "ac4e867f7211be8b865111af6ff5cbc75b236b8c", "size": 4582, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/human/run_wizard_human_trickpred.py", "max_stars_repo_name": "MagnusWagner/rlcard", "max_stars_repo_head_hexsha": "1a3aaef76e78968ebc68eb5b92e57be4709f7e38", "max_stars_repo_licenses": ["... |
import logging
import pymc3 as pm
import theano.tensor as tt
from theano.compile.ops import as_op
import numpy as np
from scipy import stats
logger = logging.getLogger('root')
def add_exp_uniform_normal_t_model(hierarchical_model):
"""
A student-t model with normal, uniform, exp priors for mu, sigma, nu para... | {"hexsha": "3864d571d4e42dfd812037cee90f81a271e704e3", "size": 1770, "ext": "py", "lang": "Python", "max_stars_repo_path": "HyBayes/models/metric_model.py", "max_stars_repo_name": "allenai/HyBayes", "max_stars_repo_head_hexsha": "9ac1b923953f471f104a4312499d007a676edc92", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
(*********************************************************)
(* Formal Proof of the Tic-Tac-Toe's Perfect Strategy *)
(* Author: Shuangquan Feng *)
(* Date: Apr 29. 2018 *)
(*********************************************************)
(* Tic-Tac-Toe' fir... | {"author": "fsq", "repo": "CS386L-Programming-Language", "sha": "2a4e01bba8dbee34d5ccc60b104ce831ff69ace1", "save_path": "github-repos/coq/fsq-CS386L-Programming-Language", "path": "github-repos/coq/fsq-CS386L-Programming-Language/CS386L-Programming-Language-2a4e01bba8dbee34d5ccc60b104ce831ff69ace1/tic-tac-toe/tic-tac-... |
import copy
import datetime
import logging
logger = logging.getLogger(__file__)
import os
import os.path
import statistics as stt
import sys
import time
from collections import namedtuple
from itertools import chain
from pprint import pprint
from colorama import init, deinit, reinit, Fore, Style
init()
deinit()
import... | {"hexsha": "d36d1350a18f26a22464a88fef4dc930c61c8d47", "size": 30553, "ext": "py", "lang": "Python", "max_stars_repo_path": "drling/core.py", "max_stars_repo_name": "DavidDB33/dearling", "max_stars_repo_head_hexsha": "90ee28366f4c233939eb9c72995e7b1df23835e8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "... |
# TOPIC: Australian Tax Office - Tax Return Sample for Year 2013-14
# CATEGORY: Age
# TITLE: Australian Tax Return Income by Age Group (3D, Log)
# AUTHOR: George Paw
# DATE: November 2017
import sys
import os
import pandas as pd
import plotly.graph_objs as go
import plotly
import numpy as np
#custom imports
import A... | {"hexsha": "8ea99bd5210ed864b05f76cab51f7947f13df5ee", "size": 4284, "ext": "py", "lang": "Python", "max_stars_repo_path": "ATO_Analysis/ATO_AG_4.py", "max_stars_repo_name": "gpaw789/ATO_Analysis", "max_stars_repo_head_hexsha": "d3d3b9bd73953491d2cb3b2c9083eabc18c2190c", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import argparse
import copy
import math
import numpy as np
import pygame
from pygame.locals import *
from timeit import default_timer as timer
import traceback
import os
from minos.lib import common
from minos.config.sim_args import parse_sim_args
from minos.lib.Simulator import Simulator
from minos.lib.util.ActionTrac... | {"hexsha": "31d2ab166c0f2ba83dc6cfcec737e8fabd37f864", "size": 26783, "ext": "py", "lang": "Python", "max_stars_repo_path": "MINOS_Navigation.py", "max_stars_repo_name": "ans-qureshi/SLAM-Recovery", "max_stars_repo_head_hexsha": "18337d886d4027cd4b485b50bc7ac32e6e74c4d5", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
% Default to the notebook output style
% Inherit from the specified cell style.
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
% Nicer default font (+ math font) than Computer Modern for most use cases
\usepackage{mathpazo}
% Basic figure setup, ... | {"hexsha": "004de569047bda31ca15f4418d2d7b4f0f9cb3a7", "size": 27086, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "notebook.tex", "max_stars_repo_name": "NaveenVunnam/Behavioral-Colning", "max_stars_repo_head_hexsha": "4f1735e7b1452e96258f2ce36dba1e9b4aac25b9", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
"""
gen_ref_dirs(dimension, n_paritions)
Generates Das and Dennis's structured reference points. `dimension` could be
the number of objective functions in multi-objective functions.
"""
function gen_ref_dirs(dimension, n_paritions)
return gen_weights(dimension, n_paritions)
end
function gen_weights(a, b)
... | {"hexsha": "754445ed657a57aa15948df7c404c2b28053f3ea", "size": 1874, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/common/multi-objective-functions.jl", "max_stars_repo_name": "jmejia8/Metaheuristics.jl", "max_stars_repo_head_hexsha": "c6a7cc2e076df31a69741f31852da27354e9ab42", "max_stars_repo_licenses": ["... |
[STATEMENT]
lemma not_refTE:
"\<lbrakk> \<not>is_refT T; T = Void \<or> T = Boolean \<or> T = Integer \<Longrightarrow> Q \<rbrakk> \<Longrightarrow> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>\<not> is_refT T; T = Void \<or> T = Boolean \<or> T = Integer \<Longrightarrow> Q\<rbrakk> \<Longrightarr... | {"llama_tokens": 146, "file": "CoreC++_Type", "length": 1} |
[STATEMENT]
lemma [simp]:
"(binop_LessThan v1 v2 = Some va) \<longleftrightarrow>
(\<exists>i1 i2. v1 = Intg i1 \<and> v2 = Intg i2 \<and> va = Inl (Bool (i1 <s i2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (binop_LessThan v1 v2 = \<lfloor>va\<rfloor>) = (\<exists>i1 i2. v1 = Intg i1 \<and> v2 = Intg i... | {"llama_tokens": 199, "file": "JinjaThreads_Common_BinOp", "length": 1} |
import matplotlib.pyplot as plt
import numpy as np
# Trial function for adding vertical arrows to
def f(x):
return np.sin(2*x)
x = np.linspace(0,10,1000)
y = f(x)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x,y, 'k', lw=2)
ax.set_ylim(-3,3)
def add_force(F, x1):
"""Add a vertical force arrow F pixe... | {"hexsha": "be9629a04a5eb4d5c9a82200ae812b912e29e829", "size": 553, "ext": "py", "lang": "Python", "max_stars_repo_path": "develop/matplotlib/arrow02.py", "max_stars_repo_name": "atmelino/PAT8", "max_stars_repo_head_hexsha": "b83b5ff8453017e4a7bec8e47b1a3a7619fffe53", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
#include <boost/process/error.hpp>
| {"hexsha": "b3f1feadc8347f83d1d7f2da0433ac6ab4d95c89", "size": 35, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_process_error.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0"], "max... |
[STATEMENT]
lemma arrE [elim]:
assumes "arr f"
and "f \<noteq> null \<Longrightarrow> natural_transformation A B (Dom f) (Cod f) (Map f) \<Longrightarrow> T"
shows T
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. T
[PROOF STEP]
using assms arr_char null_char
[PROOF STATE]
proof (prove)
using this:
arr f
... | {"llama_tokens": 311, "file": "Category3_FunctorCategory", "length": 2} |
[STATEMENT]
lemma expands_to_root_neg:
assumes "n > 0" "trimmed_neg F" "basis_wf basis" "(f expands_to F) basis"
shows "((\<lambda>x. root n (f x)) expands_to
-powr_expansion False (-F) (inverse (real n))) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ((\<lambda>x. root n (f x)) expands_t... | {"llama_tokens": 604, "file": null, "length": 5} |
import enum
import numpy as np
from controller.controller_enum import DiscreteControls
# Clear threshold
CLEAR = 0.45
# Outputs the action
def create_action(mask):
third_length = mask.shape[1] // 3
left_available = np.sum(mask[:, :third_length])
center_available = np.sum(mask[:, third_length:(2*third_lengt... | {"hexsha": "60a2b62c04c15cf351a4d65a5b462f075bd5f2bc", "size": 795, "ext": "py", "lang": "Python", "max_stars_repo_path": "planning/fishbrain.py", "max_stars_repo_name": "ElanHR/marys-lamb", "max_stars_repo_head_hexsha": "e55be63a3193737fcc793a3bcc678e6b18151eb2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
#pylint:disable=no-member
import cv2 as cv
import numpy as np
img = cv.imread('/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/park.jpg')
cv.imshow('Park', img)
blank = np.zeros(img.shape[:2], dtype='uint8')
b,g,r = cv.split(img)
blue = cv.merge([b,blank,blank])
green = cv.me... | {"hexsha": "f42d249c395d0f7fbc4975792e75c9653e6b054f", "size": 586, "ext": "py", "lang": "Python", "max_stars_repo_path": "Section2_Advanced/splitmerge.py", "max_stars_repo_name": "NeeharikaDva/opencv_course", "max_stars_repo_head_hexsha": "234515ab59a1228c8dfd3c69f310dbc1d86c6089", "max_stars_repo_licenses": ["MIT"], ... |
Require Import Crypto.Specific.Framework.SynthesisFramework.
Require Import Crypto.Specific.solinas64_2e129m25_3limbs.CurveParameters.
Module P <: PrePackage.
Definition package : Tag.Context.
Proof. make_Synthesis_package curve extra_prove_mul_eq extra_prove_square_eq. Defined.
End P.
Module Export S := PackageS... | {"author": "anonymous-code-submission-01", "repo": "sp2019-54-code", "sha": "8867f5bed0821415ec99f593b1d61f715ed4f789", "save_path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code", "path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code/sp2019-54-code-8867f5bed0821415ec99f593b1d61f715ed4f7... |
C %W% %G%
C****************************************************************
C
C File: rebldzon.f
C
C Purpose: Routine to rebuild acznam() using zone hashing
C
c Return code: n = 0 : Success
c N > 0 : Error
c
C Author: Walt Powell Date: 21 May 1996
C Called by: clnuppti.f
C
C**... | {"hexsha": "d36f4904810e22a492777513b2730f2feb32dead", "size": 1098, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ipf/rebldzon.f", "max_stars_repo_name": "mbheinen/bpa-ipf-tsp", "max_stars_repo_head_hexsha": "bf07dd456bb7d40046c37f06bcd36b7207fa6d90", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14,... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import numpy
import torch
def convert_to_distributed_tensor(tensor):
... | {"hexsha": "f483a5958f3b2a057b0c74a3ff04fadaea018bcb", "size": 4803, "ext": "py", "lang": "Python", "max_stars_repo_path": "torchelastic/distributed/collectives.py", "max_stars_repo_name": "aashnamsft/elastic", "max_stars_repo_head_hexsha": "5372d6acaf07d130ab0f0ccaf52958a7fde88902", "max_stars_repo_licenses": ["BSD-3-... |
open import Formalization.PredicateLogic.Signature
module Formalization.PredicateLogic.Syntax.NegativeTranslations (𝔏 : Signature) where
open Signature(𝔏)
open import Data.ListSized
import Lvl
open import Formalization.PredicateLogic.Syntax (𝔏)
open import Functional using (_∘_ ; _∘₂_ ; swap)
open import Nume... | {"hexsha": "152b54cda5eb7edcc26862aadbb58857ab2d4b99", "size": 1606, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Formalization/PredicateLogic/Syntax/NegativeTranslations.agda", "max_stars_repo_name": "Lolirofle/stuff-in-agda", "max_stars_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_sta... |
{-# OPTIONS --safe --without-K #-}
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl; trans; sym; cong)
open import Relation.Nullary using (_because_; ofʸ; ofⁿ)
open import Data.Unit using (⊤; tt)
open import Data.Empty using (⊥; ⊥-elim)
open import Data.Nat.Base
open import Data.Bool.Base using... | {"hexsha": "da22d67718e8ed9e50a7adf8db2d3e0f7411b8f7", "size": 5963, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "src/PiCalculus/Semantics.agda", "max_stars_repo_name": "guilhermehas/typing-linear-pi", "max_stars_repo_head_hexsha": "0fc3cf6bcc0cd07d4511dbe98149ac44e6a38b1a", "max_stars_repo_licenses": ["MIT"]... |
# Copyright 2021 Toyota Research Institute. All rights reserved.
import itertools
import json
import math
import os
import warnings
from collections import OrderedDict
from functools import partial
import numpy as np
import pandas as pd
from pyquaternion import Quaternion
from tqdm import tqdm
import numba
from dete... | {"hexsha": "224cb3c6a5a616de139d9e4392db1982a12feb09", "size": 44553, "ext": "py", "lang": "Python", "max_stars_repo_path": "tridet/evaluators/kitti_3d_evaluator.py", "max_stars_repo_name": "flipson/dd3d", "max_stars_repo_head_hexsha": "86d8660c29612b79836dad9b6c39972ac2ca1557", "max_stars_repo_licenses": ["MIT"], "max... |
"""
Tests module hierarchy
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
__version__ = "$Revision$"
from copy import copy, deepcopy
import importlib
import unittest
import numpy
impor... | {"hexsha": "784c9e703916a71a3c4e1d3a2c8a0fda76cf47a1", "size": 13811, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/pyto/segmentation/test/test_hierarchy.py", "max_stars_repo_name": "anmartinezs/pyseg_system", "max_stars_repo_head_hexsha": "5bb07c7901062452a34b73f376057cabc15a13c3", "max_stars_repo_licens... |
import os
import numpy as np
import tensorflow as tf
from tensorflow.keras.applications.resnet50 import ResNet50, decode_predictions, preprocess_input
from tensorflow.keras.preprocessing.image import load_img, img_to_array
import matplotlib.pyplot as plt
model = ResNet50(include_top=True, weights="imagenet")
model.tra... | {"hexsha": "2ac713aeee0ed4a5e6ac1a690eac300ee7bf1d41", "size": 1501, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/main.py", "max_stars_repo_name": "rish-16/FGSM-Attacks", "max_stars_repo_head_hexsha": "edd084895565f3519e0b8e00c5806f7fa6f50142", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "ma... |
import matplotlib
import numpy as np
import datetime
def polyfit(dates, levels, p):
x = matplotlib.dates.date2num(dates)
d0 = x[0]
x-= d0
y = levels
p_coeff = np.polyfit(x, y, p)
poly = np.poly1d(p_coeff)
return poly, d0
def severity(stations):
severe = []
moderate = []
low... | {"hexsha": "b0abca3934c11376dc18b206584baf9dd86aef2e", "size": 1114, "ext": "py", "lang": "Python", "max_stars_repo_path": "floodsystem/analysis.py", "max_stars_repo_name": "AyanShoaib/flood-warning-project-72", "max_stars_repo_head_hexsha": "84a9b24ad6d22b177d3d5d7c4a1c780ea7d48949", "max_stars_repo_licenses": ["MIT"]... |
[STATEMENT]
lemma n_meet_L_below:
"n(x) \<sqinter> L \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. n x \<sqinter> L \<le> x
[PROOF STEP]
by (meson inf.coboundedI1 inf.coboundedI2 le_supI2 sup.cobounded1 top_right_mult_increasing n_less_eq_char) | {"llama_tokens": 122, "file": "Correctness_Algebras_N_Algebras", "length": 1} |
using DifferentialEquations, LinearAlgebra, Plots; pyplot()
k, b, M = 1.2, 0.3, 2.0
A = [0 1;
-k/M -b/M]
initX = [8., 0.0]
tEnd = 50.0
tRange = 0:0.1:tEnd
manualSol = [exp(A*t)*initX for t in tRange]
linearRHS(x,Amat,t) = Amat*x
prob = ODEProblem(linearRHS, initX, (0,tEnd), A)
sol = solve(prob)
p1 = plot(first... | {"hexsha": "fbafddeda37ec3baca0923de0ba1116cb2162bd9", "size": 959, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "10_chapter/springMass.jl", "max_stars_repo_name": "Yoshinobu-Ishizaki/StatsWithJuliaBook", "max_stars_repo_head_hexsha": "4c704e96d87b91e680122a6b6fa2d2083c70ea88", "max_stars_repo_licenses": ["MIT"... |
Require Import Coq.ZArith.ZArith.
Require Import Crypto.Arithmetic.PrimeFieldTheorems.
Require Import Crypto.Specific.montgomery64_2e256m2e32m977_4limbs.Synthesis.
Local Open Scope Z_scope.
(* TODO : change this to field once field isomorphism happens *)
Definition nonzero :
{ nonzero : feBW_small -> BoundedWord.Bou... | {"author": "anonymous-code-submission-01", "repo": "sp2019-54-code", "sha": "8867f5bed0821415ec99f593b1d61f715ed4f789", "save_path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code", "path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code/sp2019-54-code-8867f5bed0821415ec99f593b1d61f715ed4f7... |
import os
import numpy as np
import flopy
from ci_framework import base_test_dir, FlopyTestSetup
base_dir = base_test_dir(__file__, rel_path="temp", verbose=True)
exe_names = {"mf6": "mf6", "mp7": "mp7"}
run = True
for key in exe_names.keys():
v = flopy.which(exe_names[key])
if v is None:
run = False... | {"hexsha": "0acd615fc693358b46d22975eca48cecab7e07b6", "size": 16515, "ext": "py", "lang": "Python", "max_stars_repo_path": "autotest/t058_test_mp7.py", "max_stars_repo_name": "scottrp/flopy", "max_stars_repo_head_hexsha": "af10ab377f48b41f00842cc2bfa08e8b4fc36a62", "max_stars_repo_licenses": ["CC0-1.0", "BSD-3-Clause"... |
"""
{This script carries out an MCMC analysis to parametrize the ECO SMHM}
"""
# Libs
from cosmo_utils.utils import work_paths as cwpaths
from chainconsumer import ChainConsumer
import matplotlib.pyplot as plt
from matplotlib import rc
import pandas as pd
import numpy as np
__author__ = '{Mehnaaz Asad}'
dict_of_pat... | {"hexsha": "6f643355995ac3a25294568933a6cbb0263e1599", "size": 12112, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/mcmc/colour/cornerplot_colour.py", "max_stars_repo_name": "MehnaazAsad/RESOLVE_Statistics", "max_stars_repo_head_hexsha": "a7bdcc896ca2c51ab3417c46f07efe8c16825597", "max_stars_repo_licenses"... |
[STATEMENT]
lemma nat_power_eq':
assumes "a \<notin> carrier R"
shows "nat_power n a = undefined"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. nat_power n a = undefined
[PROOF STEP]
by (simp add: assms nat_power_def) | {"llama_tokens": 89, "file": "Padic_Ints_Function_Ring", "length": 1} |
[STATEMENT]
lemma sup_least_classes1:
"c \<le> e \<Longrightarrow> d \<le> e \<Longrightarrow> c \<squnion> d \<le> e"
for c d e :: classes1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>c \<le> e; d \<le> e\<rbrakk> \<Longrightarrow> c \<squnion> d \<le> e
[PROOF STEP]
by (induct c; induct d;
au... | {"llama_tokens": 157, "file": "Safe_OCL_OCL_Examples", "length": 1} |
from logging import getLogger
import numpy
import pandas
from rdkit import Chem
from tqdm import tqdm
from chainer_chemistry.dataset.parsers.base_parser import BaseFileParser
from chainer_chemistry.dataset.preprocessors.common import MolFeatureExtractionError # NOQA
from chainer_chemistry.dataset.preprocessors.mol_p... | {"hexsha": "2e7c664db33269da534d07c1c3ce4bd5951dca27", "size": 7350, "ext": "py", "lang": "Python", "max_stars_repo_path": "chainer_chemistry/dataset/parsers/csv_file_parser.py", "max_stars_repo_name": "zhenghangCN/chainer-chemistry", "max_stars_repo_head_hexsha": "dcda27f2fdbf8ce1d626835e73f1c2ceb8ec9886", "max_stars_... |
# coding=utf-8
from hielen2.source import CloudSource, ActionSchema, GeoInfoSchema
from hielen2.utils import LocalFile, ColorMap, Style, FTPPath
from hielen2.ext.source_rawsource import Source as RawSource
import hielen2.api.features as featman
from hielen2.mapmanager import Multiraster
from hielen2.cloudmanager impo... | {"hexsha": "d6a86c90b7bfcc5dd12a75ec8786bc68e2c76b8e", "size": 15678, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/hielen2/ext/source_tinsar/tin.py", "max_stars_repo_name": "fantamodeman/hielen2", "max_stars_repo_head_hexsha": "b1b249f4bd7609b3977777f663ae242adf69cfe2", "max_stars_repo_licenses": ["MIT"],... |
#
# A Job Shop Scheduling OpenAI Gym Environment
#
# Inspired by: https://developers.google.com/optimization/scheduling/job_shop
# Author: Lisa Ong, NUS/ISS
#
import gym
from gym import spaces
import numpy as np
class TaskList:
"""Used to track the state of tasks in a Job Shop Environment
"""
def __init__ (self... | {"hexsha": "77d3ef0343cc22cc88efe0d535f9734f9b728430", "size": 12252, "ext": "py", "lang": "Python", "max_stars_repo_path": "day4/rl/gym-jobshop/gym_jobshop/envs/jobshop_env.py", "max_stars_repo_name": "lisaong/diec", "max_stars_repo_head_hexsha": "f22fd0880ca7808975de70a9259be77a29c6e176", "max_stars_repo_licenses": [... |
#!/usr/bin/env python
#coding=utf-8
"""
severities.py: the set of arrays for severity measures.
"""
__author__ = "Francisco Maria Calisto"
__maintainer__ = "Francisco Maria Calisto"
__email__ = "francisco.calisto@tecnico.ulisboa.pt"
__license__ = "MIT"
__version__ = "1.0.0"
__status__ = "Deve... | {"hexsha": "15666ce6da1f0791da513824bc1d7896fb488378", "size": 1713, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/structures/severities.py", "max_stars_repo_name": "mida-project/sa-uta7-recall-precision", "max_stars_repo_head_hexsha": "295e0409c1967d488f792c0287ffa50522c73145", "max_stars_repo_licenses": ... |
function MultivariateSummaryStatistics(arg0::jint)
return MultivariateSummaryStatistics((jint,), arg0)
end
function MultivariateSummaryStatistics(arg0::jint, arg1::jboolean)
return MultivariateSummaryStatistics((jint, jboolean), arg0, arg1)
end
function add_value(obj::MultivariateSummaryStatistics, arg0::Vect... | {"hexsha": "5a65d66874e4cd95a8164f4357862d8d98a3a5a3", "size": 2123, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "gen/HipparchusWrapper/StatWrapper/DescriptiveWrapper/multivariate_summary_statistics.jl", "max_stars_repo_name": "JuliaAstrodynamics/Orekit.jl", "max_stars_repo_head_hexsha": "e2dd3d8b2085dcbb1d2c7... |
[STATEMENT]
lemma finite_fold_lderiv: "finite {fold (\<lambda>a r. \<guillemotleft>lderiv a r\<guillemotright>) w \<guillemotleft>s\<guillemotright> |w. True}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. finite {fold (\<lambda>a r. \<guillemotleft>lderiv a r\<guillemotright>) w \<guillemotleft>s\<guillemotright> ... | {"llama_tokens": 387, "file": "MSO_Regex_Equivalence_Pi_Derivatives", "length": 3} |
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
file0 = open('log/log_train.txt', 'rt')
file1 = open('log1/log_train.txt', 'rt')
file2 = open('log2/log_train.txt', 'rt')
file3 = open('log3/log_train.txt', 'rt')
y_file0 = [[], [], []]
y_file1 = [[], [], []]
y_file2 = [[], [], []]
y_file3 = [[... | {"hexsha": "ce34de539f361b0a2069bb0ab4bdfa3b9b217758", "size": 4210, "ext": "py", "lang": "Python", "max_stars_repo_path": "plt.py", "max_stars_repo_name": "xiangz201/cpointnet", "max_stars_repo_head_hexsha": "99492c8ae8a8df51932457f1fc69960f912e88de", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s... |
import numpy as np
def feature_centroid(molecule, atom_indxs, conformer_idx):
"""
Get the 3D coordinates of the centroid of a feature that encompasses more than
one atom. This could be aromatic, hydrophobic, negative and positive features
Parameters
----------
molecule : r... | {"hexsha": "bca90230eee3ce654b49833ebbed90a91cfb24d5", "size": 1165, "ext": "py", "lang": "Python", "max_stars_repo_path": "openpharmacophore/utils/centroid.py", "max_stars_repo_name": "dprada/OpenPharmacophore", "max_stars_repo_head_hexsha": "bfcf4bdafd586b27a48fd5d1f13614707b5e55a8", "max_stars_repo_licenses": ["MIT"... |
/**
* Copyright (c) 2011-2017 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program 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 Lic... | {"hexsha": "4bcc29bd6b193c5dc6afa2a071c9ee9d708475c7", "size": 3917, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "3rdparty/libbitcoin/src/config/parser.cpp", "max_stars_repo_name": "anatolse/beam", "max_stars_repo_head_hexsha": "43c4ce0011598641d9cdeffbfdee66fde0a49730", "max_stars_repo_licenses": ["Apache-2.0"... |
from flask import Flask, request
from flask_cors import CORS, \
cross_origin # ติดตั้งตัวนี้เพิ่มเพื่อให้สามารถเรียกใช้งานผ่านจากภายนอกได้ กรณีคนละ network
import joblib
import numpy as np
app = Flask(__name__)
CORS(app)
@app.route('/') # เพิ่ม route หรือ วิธีการในการเรียก
@cross_origin()
def helloworld():
... | {"hexsha": "44bf011dbb34a42e290670eb48068c243fd1eadb", "size": 1622, "ext": "py", "lang": "Python", "max_stars_repo_path": "App.py", "max_stars_repo_name": "atthana/flask_machine_learning_as_service", "max_stars_repo_head_hexsha": "1f556fddb59b018b07de4ed8c6951669281a8514", "max_stars_repo_licenses": ["MIT"], "max_star... |
"""
I/O for Tecplot ASCII data format, cf.
<http://paulbourke.net/dataformats/tp/>.
"""
import logging
import numpy
from ..__about__ import __version__ as version
from .._exceptions import ReadError, WriteError
from .._files import open_file
from .._helpers import register
from .._mesh import Mesh
zone_key_to_type =... | {"hexsha": "91759b008da5414c0e9ca93bbe490395abe79984", "size": 13916, "ext": "py", "lang": "Python", "max_stars_repo_path": "meshio/tecplot/_tecplot.py", "max_stars_repo_name": "c-abird/meshio", "max_stars_repo_head_hexsha": "21301c3c5df3b196c60bea0cf71f27736f9a337e", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# Copyright (c) 2019 Microsoft Corporation
# Distributed under the MIT software license
import pytest
import numpy as np
import pandas as pd
from .. import gen_feat_val_list, gen_name_from_class
from .. import reverse_map, unify_data, unify_vector
@pytest.fixture
def fixture_feat_val_list():
return [("race", 3),... | {"hexsha": "3ca27351cbfa03765683b9f0bc322a2c2b6a0902", "size": 1976, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/interpret-core/interpret/utils/test/test_utils.py", "max_stars_repo_name": "prateekiiest/interpret", "max_stars_repo_head_hexsha": "b5530a587251a77516ab443037fc37f71708564c", "max_stars_rep... |
import random
import numpy as np
import torch
def fix_seeds():
torch.manual_seed(0)
torch.cuda.manual_seed(0)
np.random.seed(0)
random.seed(0)
torch.backends.cudnn.deterministic = True
| {"hexsha": "e0b5c695a214978e899ad0c504efd164ba156d37", "size": 208, "ext": "py", "lang": "Python", "max_stars_repo_path": "divnoising/analysis/randomness.py", "max_stars_repo_name": "ashesh-0/DivNoising", "max_stars_repo_head_hexsha": "45a4d3f04041887bcc6a748e15c74520521c003a", "max_stars_repo_licenses": ["BSD-3-Clause... |
import os
import numpy as np
import torch as T
import torch.nn as nn
import torch.optim as optim
from torch.distributions.categorical import Categorical
from models import Agent
import json
import pickle
class PPOMemory:
def __init__(self, batch_size):
self.states = []
self.probs = []
self.... | {"hexsha": "5538d177b7f94098ea79d24d71b67f8160823a54", "size": 7639, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/policy_gradient/policygradient.py", "max_stars_repo_name": "paultheron-X/INF581-Trading-agent", "max_stars_repo_head_hexsha": "2bff32c027507cd4e1ccda9d3b79325ef8977481", "max_stars_repo_lic... |
using Distributed
using Random
using Logging
workers = 8
if nprocs() <= workers
addprocs(workers + 1 - nprocs())
end
@everywhere include("models/Vibron.jl")
@everywhere include("modules/ClassicalDynamics.jl")
@everywhere disable_logging(Logging.Info)
""" Calculates Poincaré sections with Lyapunov exponents for... | {"hexsha": "4b8a3442b40cc0a79792368a42f21d9741596c2c", "size": 3380, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "VibronMap.jl", "max_stars_repo_name": "PavelStransky/ClassicalDynamics", "max_stars_repo_head_hexsha": "967338a7a64282bf68f1e9be1a829b0d657cc0d8", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.