text stringlengths 0 27.1M | meta dict |
|---|---|
\documentclass[useAMS,usenatbib,referee]{biom}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[colorlinks=true, citecolor = blue]{hyperref} % hyperlinks
\usepackage{multirow, amssymb, amsmath, graphicx, arydshln, url}
\usepackage[T1]{fontenc}
\usepackage{natbib}
\author{Jon... | {
"alphanum_fraction": 0.7205519719,
"author": null,
"avg_line_length": 145.4513064133,
"converted": null,
"ext": "tex",
"file": null,
"hexsha": "19a7c7bb291c90db22b611093d65cfd4f6f75708",
"include": null,
"lang": "TeX",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import numpy as np
# import pandas as pd
def read_data():
with open ('input.txt') as f:
data = f.readlines()
return [int(d.strip()) for d in data[0].split(',')]
def write_data(data):
with open('output.txt','w') as f:
for d in data:
f.write(str(d)+'\n')
###
from collections import Counter, defaultdict
d... | {
"alphanum_fraction": 0.6047619048,
"author": null,
"avg_line_length": 12.5373134328,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "b25a0e45ab80478af8d491d721c1cfb48298f214",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
(*
Copyright 2014 Cornell University
This file is part of VPrl (the Verified Nuprl project).
VPrl 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 3 of the License, or
(at your option)... | {
"alphanum_fraction": null,
"author": "vrahli",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_date... |
[STATEMENT]
lemma bcontfun\<^sub>N:
fixes f::"('a::topological_space \<Rightarrow> 'b::real_normed_vector)"
shows "eNorm bcontfun\<^sub>N f = (if f \<in> bcontfun then norm(Bcontfun f) else (\<infinity>::ennreal))"
"Norm bcontfun\<^sub>N f = (if f \<in> bcontfun then norm(Bcontfun f) else 0)"
"defec... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Lp_Functional_Spaces",
"hexsha": null,
"include": null,
"lang": null,
"length": 45,
"llama_tokens": 6604,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_ev... |
\chapter{Likelihood functions}
| {
"alphanum_fraction": 0.7878787879,
"author": null,
"avg_line_length": 8.25,
"converted": null,
"ext": "tex",
"file": null,
"hexsha": "631ddeec531dc6974b3a5628285a6698665b2277",
"include": null,
"lang": "TeX",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": ... |
module ReactiveMPModelsAutoregressiveTest
using Test, InteractiveUtils
using Rocket, ReactiveMP, GraphPPL, Distributions
using BenchmarkTools, Random, Plots, Dates, LinearAlgebra, StableRNGs
## Model definition
## -------------------------------------------- ##
@model [ default_factorisation = MeanField() ] function ... | {
"alphanum_fraction": 0.551393413,
"author": null,
"avg_line_length": 36.1176470588,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "bd4922a74b0c113ecc70e94b36472b911f3c0a57",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
from azureml.contrib.services.aml_request import AMLRequest, rawhttp
from azureml.contrib.services.aml_response import AMLResponse
from azureml.core.model import Model
import torch
from unet import UNet
from collections import OrderedDict
import numpy as np
from PIL import Image
from torchvision import transforms
imp... | {
"alphanum_fraction": 0.6654244306,
"author": null,
"avg_line_length": 25.6914893617,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "8e7bf7baea79ed6468ddffecb44a796822bf04a3",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
# general-purpose data munging funcs
def deleteCols(df, cols):
df.drop(cols, inplace=True, axis=1)
def renameColAtIdx(df, idx, newName):
df.columns.values[idx] = newName
def stripColNames(df, chars=None):
df.rename(columns=lambda x: x.strip(chars), inplace=True)
def sortColsByName... | {
"alphanum_fraction": 0.6797124601,
"author": null,
"avg_line_length": 25.04,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "c2f15de48ad5f4878f5007402e9859568a8eb502",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count... |
Set Implicit Arguments.
Require Import Morphisms Lia List.
From Undecidability.HOU Require Import calculus.calculus.
Import ListNotations ArsInstances.
(* * Conservativity *)
Section Constants.
(* ** Constant Operations *)
Section ConstantsOfTerm.
Context {X: Const}.
Implicit Types (s t: exp X).
Fix... | {
"alphanum_fraction": null,
"author": "uds-psl",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_dat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append('build')
import cv2 as cv
import numpy as np
import bing
binger = bing.BING('build/ObjectnessTrainedModel', 2, 8, 2)
img = cv.imread('sample.jpg')
canvas = np.zeros((img.shape[0], img.shape[1]), dtype=np.float32)
bbox = binger.objectness(img)... | {
"alphanum_fraction": 0.6448412698,
"author": null,
"avg_line_length": 21,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "2c4af865c26cda33e4611d38cd11c24ae21a20b2",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": ... |
SUBROUTINE HCLPNL ( xllf, yllf, xurf, yurf, iret )
C************************************************************************
C* HCLPNL - GN *
C* *
C* This subroutine will clear a particular sub-region of the screen. *
C* *
C* HCLPNL ( XLLF, YLLF, XURF, YURF, IRET ) *
C* *
C* Input ... | {
"alphanum_fraction": 0.4538198404,
"author": null,
"avg_line_length": 31.3214285714,
"converted": null,
"ext": "f",
"file": null,
"hexsha": "a905229a28327cf2445b56dc4d87ad7008ad2da4",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
(** First step of a splitter refinement; indexed representation, and handle all rules with at most one nonterminal; leave a reflective goal *)
Require Import Coq.Strings.String.
Require Import Fiat.Common.List.ListFacts.
Require Import Fiat.ADTNotation.BuildADT Fiat.ADTNotation.BuildADTSig.
Require Import Fiat.ADT.Comp... | {
"alphanum_fraction": null,
"author": "mit-plv",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_dat... |
(** * Stlc: The Simply Typed Lambda-Calculus *)
Add LoadPath "~/src/stlc_coq/".
Require Export SfLib.
Module STLC.
(* Types *)
Inductive ty : Type :=
| TBool : ty
| TNat : ty
| TArrow : ty -> ty -> ty.
(* Terms *)
Inductive tm : Type :=
| tvar : id -> tm
| tapp : tm -> tm -> tm
| tabs : id -> ty ->... | {
"alphanum_fraction": null,
"author": "mulias",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_date... |
import beluga
import cloudpickle as pickle
import copy
import logging
from math import isclose
import numpy as np
from beluga.numeric.bvp_solvers import BaseAlgorithm, BVPResult
from beluga.numeric.ivp_solvers import Propagator, reconstruct
from beluga.numeric.data_classes.Trajectory import Trajectory
from beluga.util... | {
"alphanum_fraction": 0.5402645136,
"author": null,
"avg_line_length": 41.49125,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "936485807d36304e59012009443a9cf613d1e9aa",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_co... |
/-
Copyright (c) 2014 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Leonardo de Moura
! This file was ported from Lean 3 source module data.set.basic
! leanprover-community/mathlib commit 75608affb24b4f48699fbcd38f227827f7793771
! Please... | {
"alphanum_fraction": null,
"author": "leanprover-community",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sys
# The following code is adapted from colour_predict_hint.py of this exercise.
OUTPUT_TEMPLATE = (
'The score of the selected model is: {model_score:g}'
)
def main():
monthly_data_labelled = pd.read_csv(sys.argv[1])
month... | {
"alphanum_fraction": 0.7184610796,
"author": null,
"avg_line_length": 40.3975903614,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "80a2ebdead09322b68b1a48a15d2543c94a46bf8",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
from collections import OrderedDict
import os
import numpy as np
import torch
import random
import string
import random
import time
import cv2
from pathlib import Path
TUTILS_DEBUG = True
TUTILS_INFO = True
TUTILS_WARNING = True
def p(*s,end="\n", **kargs ):
if TUTILS_INFO:
print("[Trans Info] ", s, kar... | {
"alphanum_fraction": 0.5794712286,
"author": null,
"avg_line_length": 24.9224806202,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "4ab442d9d76249698c042466d861b80d71e34970",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
// Copyright (c) 2014-2018 The Bitcoin Core developers
// Copyright (c) 2017-2020 The LitecoinZ Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <key_io.h>
#include <base58.h>
#include <bech32.h>
#includ... | {
"alphanum_fraction": 0.6434357875,
"author": null,
"avg_line_length": 38.1545454545,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "1b5b4a4174f9aa7fa2307d43167e910e9e348cec",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
# -*- coding: utf-8 -*-
"""
>>> from pycm import *
>>> import os
>>> import json
>>> import numpy as np
>>> y_test = np.array([600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200])
>>> y_pred = np.array([100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100,... | {
"alphanum_fraction": 0.3923435457,
"author": null,
"avg_line_length": 69.8134920635,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "0a1bfa92caaec4fa605865e63129300af71d8dd9",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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 ... | {
"alphanum_fraction": 0.5571362301,
"author": null,
"avg_line_length": 37.1666666667,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "cdc4829448c54ddb4ce23db0a831e882d4778d27",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Test to find CNN accuracy, precision, and recall
By: Austin Schwinn, Jérémie Blanchard, and Oussama Bouldjedri.
MLDM Master's Year 2
Fall Semester 2017
"""
import sys
import argparse
import numpy as np
from PIL import Image
import requests
from io import BytesIO
imp... | {
"alphanum_fraction": 0.6173811983,
"author": null,
"avg_line_length": 29.0037453184,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "366052ebf7aa0948aad5d6a7bc6cc146b248c4fc",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#!/usr/bin/python
'''
Note:
The repeated use of CvBridge (instead of using make_image_msg and get_image_msg in the classes)
is intentional, to avoid the use of a global cvbridge, and to avoid reinstantiating a CvBrige for each use.
'''
import rospy
import numpy as np
from os import path
from cv_bridge import C... | {
"alphanum_fraction": 0.6675289834,
"author": null,
"avg_line_length": 43.6694560669,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "4d3d01bf36e2121ab2560058a1dd5a33c85cc95c",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
{-|
Copyright : (C) 2019, Google Inc.
License : BSD2 (see the file LICENSE)
Maintainer : Christiaan Baaij <christiaan.baaij@gmail.com>
-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wno-orphans #-}
-- {-# OPTIONS_GHC -ddump-splices #-}
module Clash.Class.AutoReg.Instances where
import ... | {
"alphanum_fraction": 0.6734258271,
"author": null,
"avg_line_length": 32.3103448276,
"converted": null,
"ext": "hs",
"file": null,
"hexsha": "910b2bf1ad47edd6eb784d8684bcdfdcb134bc35",
"include": null,
"lang": "Haskell",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fo... |
! Fortran code for computing response spectra.
! Originial version is writting by: Leonardo Ramirez-Guzman
! The code base is tailored for F2py.
!
subroutine max_osc_response(acc, npts, dt, period, csi, max_disp, &
max_vel, max_acc)
implicit none
integer, intent(in) :: npts
real, intent(in) :: acc(np... | {
"alphanum_fraction": 0.5533223954,
"author": null,
"avg_line_length": 25.1340206186,
"converted": null,
"ext": "f95",
"file": null,
"hexsha": "a729ded4fccd7ae7e800fae9a3f79c3035a11854",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_f... |
using DiffEqFlux, Flux
abstract type AffineSystem <: Ode end
""" dxdt = Ax + Bu + ν
AffineOde """
struct AffineOde{FU,F2} <: AffineSystem
state_dim::Int
input_dim::Int
paramsum::Int
index_dict::Dict{String,UnitRange{Int}}
σ_u::FU
initial_params::F2
function AffineOde(
state_dim... | {
"alphanum_fraction": 0.5725090431,
"author": null,
"avg_line_length": 26.6754385965,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "7014484ae0361629c0d34c4ad96728bc9df47af9",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
"""
Structures and functions for the EXPLICIT POMDPs.jl interface of the Pricing MDP
"""
"""
Enumerates all states for MDP
"""
function generate_states(pp::PMDPProblem)::AbstractArray{<:State}
c_it = Iterators.product([0:cᵣ for cᵣ in pp.c₀]...)
s_it = Iterators.product(c_it, 1:selling_period_end(pp), ... | {
"alphanum_fraction": 0.6478902954,
"author": null,
"avg_line_length": 34.1007194245,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "75834024487645d99ef0e53eeb2b4edf185daa0d",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import numpy as np
from scipy.optimize import minimize
import scipy.io as sio
from scipy.sparse import csc_matrix
from scipy.sparse import eye as sparseid
from numba import njit, prange
import h5py
rm = [] # Radon transform matrix
rm_transp = [] # Transposed Radon transform matrix
y = [] # projection values
... | {
"alphanum_fraction": 0.5023892905,
"author": null,
"avg_line_length": 48.7937710438,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "faeb87b94d209b43eeb6d40182b28c5c6a20a979",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
C
C
*$ 2) High-Level Map System Routines Access Catalogue, Stack and Data
* ------------------------------------------------------------------
C
C
*+ map_enqdef
subroutine map_enqdef(imap,status)
C ----------------------------------
C
C Enquire the default map
C
C Returned:
C Default map
integer... | {
"alphanum_fraction": 0.519524618,
"author": null,
"avg_line_length": 19.6333333333,
"converted": null,
"ext": "f",
"file": null,
"hexsha": "2576c6ed8cdd8e653803060c80f65f1c27a1fb24",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import logging
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from .base import *
from .column_selection import FEATURE_PATTERN, TARGET_PATTERN, get_columns_by_pattern
logger = logging.getLogger(__name__)
# Fully connected neural network with one ... | {
"alphanum_fraction": 0.6329741379,
"author": null,
"avg_line_length": 35.6923076923,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "3ff05e3227999003e14cfbbbf7a65dd2e6fa681a",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
PROGRAM test_timer
!
! This program tests the timer class.
!
! Record of revisions:
! Date Programmer Description of change
! ==== ========== =====================
! 12/27/06 S. J. Chapman Original code
!
USE timer_class ! Import timer clas... | {
"alphanum_fraction": 0.5065616798,
"author": null,
"avg_line_length": 23.8125,
"converted": null,
"ext": "f90",
"file": null,
"hexsha": "c67afc1ff830af136c176147f27a23f11752a253",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_c... |
import pandas as pd
import numpy as np
def stratified_sample_df(df, col, n_samples,sampled='stratified',random_state=1):
# n = min(n_samples, df[col].value_counts().min())
# df_ = df.groupby(col).apply(lambda x: x.sample(n))
# df_.index = df_.index.droplevel(0)
#df.sample(n=n_samples, weights=col, ran... | {
"alphanum_fraction": 0.5311948677,
"author": null,
"avg_line_length": 36.0404624277,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "251671167b5deb2c3848a44bb2301f6eb92dfd8d",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#ifdef GSL_FOUND
#include <gsl/gsl_integration.h>
#endif
#include "core_allvars.h"
#include "core_init.h"
#include "core_mymalloc.h"
#include "core_cool_fu... | {
"alphanum_fraction": 0.689810471,
"author": null,
"avg_line_length": 31.1637426901,
"converted": null,
"ext": "c",
"file": null,
"hexsha": "c12b90728245858026c266c7cddd3ef1905a4120",
"include": null,
"lang": "C",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_coun... |
"""
AdaptiveExtrapolationD
This module is implementing an
adaptive extrapolation of the explicit midpoint rule according to Deuflhard.
"""
module AdaptiveExtrapolationD
"""
(Δ,Δx,statisitic) = (mySolver::solver)(f::Function, x₀::Vector{T}, t₀::S, tEnd::S; <options>)
where {T<:Number,S<:AbstractFlo... | {
"alphanum_fraction": 0.6167438854,
"author": null,
"avg_line_length": 45.9455445545,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "3bc7f8ec5d023f17edf9ed266fca0db369075f8f",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2021 Scipp contributors (https://github.com/scipp)
# @author Simon Heybrock, Neil Vaytet
import re
from copy import deepcopy
from contextlib import contextmanager
import uuid
import warnings
import numpy as np
import scipp as sc
import os
@contextmanager
def ru... | {
"alphanum_fraction": 0.591924456,
"author": null,
"avg_line_length": 39.912,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "890f803787012e72b70dbae9cf35ad9e6fdbe070",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count... |
[STATEMENT]
lemma integral_bigo:
fixes f g g' :: "real \<Rightarrow> real"
assumes "f \<in> O(g')" and "filterlim g at_top at_top"
assumes "\<And>a' x. a \<le> a' \<Longrightarrow> a' \<le> x \<Longrightarrow> f integrable_on {a'..x}"
assumes deriv: "\<And>x. x \<ge> a \<Longrightarrow> (g has_field_derivative ... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Prime_Number_Theorem_Prime_Number_Theorem_Library",
"hexsha": null,
"include": null,
"lang": null,
"length": 62,
"llama_tokens": 7108,
"mathlib_filename": null,
"max_forks_count": nul... |
#
# Author: Yijun Zhang
#
import cv2
import math
import numpy as np
import skvideo.io as sv
cap = sv.VideoCapture('czy1.mp4')
out = sv.VideoWriter('czy_other.mp4', 'H264', 30.0, (640, 480), True)
print out.open()
ret, frame2 = cap.read()
current_frame = frame2
## extract background
fgbg = cv2.createBackgroundSubtrac... | {
"alphanum_fraction": 0.6122672508,
"author": null,
"avg_line_length": 26.8529411765,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "165af07aded3a5cac04f7161a25d64acbeb15beb",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
(*
#####################################################
### PLEASE DO NOT DISTRIBUTE SOLUTIONS PUBLICLY ###
#####################################################
*)
Require Import Coq.Strings.Ascii.
Require Import Coq.Lists.List.
Import ListNotations.
Open Scope char_scope.
Definition rule ... | {
"alphanum_fraction": null,
"author": "mansi0312",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_d... |
import datetime
#import dill
import numpy as np
import pandas as pd
import time
from imblearn.over_sampling import SMOTE
from sklearn.decomposition import PCA
from sklearn.feature_selection import RFE
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
import plotly.g... | {
"alphanum_fraction": 0.6307716065,
"author": null,
"avg_line_length": 35.8431734317,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "dd6e53d31a44424db536be49bc55f2bd3e3bd92f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
import cv2
import Tkinter as Tk
from tkFileDialog import askopenfilename
root = Tk.Tk()
root.withdraw()
filepath = askopenfilename(initialdir = r'D:\02TestData\ImgData')
path = r'D:\1612vision\Lg\LGSample_blue\Mapping_Image\testImage\310x310_F7_center_13000x15800y_min2000max30000.bmp'
img = cv2.im... | {
"alphanum_fraction": 0.7552897884,
"author": null,
"avg_line_length": 26.512195122,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "9ec5ed05aeba9c74604adf492278d12816f5d7e9",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import glob
import io
import os
import sys
from statsmodels.compat.testing import SkipTest, example
try:
import pytest
import jupyter_client
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor
except ImportError:
raise SkipTest('Required packages not available')
KNOWN_FAILURES... | {
"alphanum_fraction": 0.6797427653,
"author": null,
"avg_line_length": 27.7678571429,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "58f269bcd8a3e3d8230286f8993da49340b8d51a",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 17 20:04:03 2019
@author: Wenbin Yao
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
from matplotlib import cm
#define the global variable
UnitX = 0.5 #every segment's length
UnitTime = 0... | {
"alphanum_fraction": 0.5834028673,
"author": null,
"avg_line_length": 43.9433333333,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "0010c33b0b8b1242b7c9930c25b815ca5a7964c5",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
from functools import reduce
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from IPython.display import display
from scipy.stats import linregress
class CovidDataViz(object):
"""
A class to make plots from processed COVID-19 and World Bank data.
"""
def __init__(self, path='... | {
"alphanum_fraction": 0.5119228818,
"author": null,
"avg_line_length": 27,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "85aa4a86be8407a7339bdd81ecf7f914f76953e0",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": ... |
import tensorflow as tf
import numpy as np
import datetime as dt
def get_batch(X, Xn, size):
a = np.random.choice(len(X), size, replace=False)
return X[a], Xn[a]
# A denoising autoencoder is pretty much the same architecture as a normal autoencoder. The input is noised up,
# and cost function tries to denois... | {
"alphanum_fraction": 0.5973673214,
"author": null,
"avg_line_length": 45.580952381,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "264c6e0345da8a7ad846fd5b57931c7102110bd6",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
run.year <- 2017
post.season.fram.db <- "./fram db/Final pre and post databases/FramVS2-PSC-Coho-Backwards-thru2016.mdb"
post.season.run.name <- ""
post.season.tamm <- "./fram db/TAMM_Files_Postseason/.xlsx"
post.season.tamm.fishery.ref <- "./data/TammFisheryQueetsRef.csv"
post.season.tamm.esc.ref <- "./data/T... | {
"alphanum_fraction": 0.7441520468,
"author": null,
"avg_line_length": 48.8571428571,
"converted": null,
"ext": "r",
"file": null,
"hexsha": "688077c12c1204a7e2238ac773d13e2bfcd35d72",
"include": null,
"lang": "R",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_cou... |
import json
import urllib
import numpy as np
API = 'http://ec2-52-11-11-89.us-west-2.compute.amazonaws.com/challenge17/api.py'
def get_blocked_videos(api=API):
api_url = '{}?action=get_blocked'.format(api)
req = urllib.request.Request(api_url)
response = urllib.request.urlopen(req)
return json.loads(... | {
"alphanum_fraction": 0.6609022556,
"author": null,
"avg_line_length": 35,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "07a9327cab4874e558cf500bdd8709544610d005",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": ... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | {
"alphanum_fraction": 0.6292845843,
"author": null,
"avg_line_length": 35.55625,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "98e2653399608039a59579d013cba58bca985ad3",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_co... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import rospy
import sys
import time
from numpy import *
import roslib.packages
from sensor_msgs.msg import *
from geometry_msgs.msg import *
cnow = time.ctime()
cnvtime = time.strptime(cnow)
ex_time = time.strftime("%Y%m%d %H%M",cnvtime)
file_path = roslib.packages.get_pkg_d... | {
"alphanum_fraction": 0.7225806452,
"author": null,
"avg_line_length": 21.796875,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "764f6ff60eca3c040e765171dc01b1851fbc74c3",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_c... |
import numpy as np
import math
import keras
from game2048.agents import ExpectiMaxAgent as TestAgent
from game2048.expectimax import board_to_move
import random
from game2048.game import Game
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Flatten,BatchNormalization,Input
fr... | {
"alphanum_fraction": 0.6933027673,
"author": null,
"avg_line_length": 31.4793814433,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "9ead8512f30754580cad1634ec3a6685c4859e05",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
(*-------------------------------------------*
| CSP-Prover on Isabelle2005 |
| February 2006 |
| April 2006 (modified) |
| March 2007 (modified) |
| ... | {
"alphanum_fraction": null,
"author": "yoshinao-isobe",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_... |
import pandas as pd
import numpy as np
import os
import pathlib as path
def load(p: path.Path):
raw_data = np.loadtxt(str(p.absolute()),delimiter=',')
label = raw_data[:, 0].astype(int)
data = raw_data[:, 1:]
# print(label[:5], data[:5, :10])
return label, data
def loadd(p: path.Path):
data ... | {
"alphanum_fraction": 0.6506291636,
"author": null,
"avg_line_length": 27.02,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "0d90737195ada2948cffb1f09b87849ac5a399d3",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count... |
"""
Copyright 2013 Steven Diamond, Eric Chu
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | {
"alphanum_fraction": 0.6027811366,
"author": null,
"avg_line_length": 36.1530054645,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "a3783311e25e699a26776b3840b4e95d17cfcfcd",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
/**
* Copyright (C) 2017 MongoDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be usef... | {
"alphanum_fraction": 0.6772188327,
"author": null,
"avg_line_length": 44.3214285714,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "626ae556d186bf9f911ee16f93ed59cd1ae65c0e",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as pl
import bluebell as bb
import bluebell.plot as bbplot
from scipy.interpolate import interp2d
from scipy.optimize import curve_fit
def show_mu_C(name, mu, C):
print(''.join(['%20s']+['%16.8f']*5) % (name, mu[0], mu[1], C[0,0], C[0,1], C[1,1]))... | {
"alphanum_fraction": 0.5575569358,
"author": null,
"avg_line_length": 26.6850828729,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "ecc31824b9209d95e43678e442177644863de2a7",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# -*- coding: utf-8 -*-
import random
import logging
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from tests.test_base import BaseTest
from mabwiser.mab import MAB, LearningPolicy, NeighborhoodPolicy
from mabwiser.simulator import Simulator
logging.disable(logging.CRITICAL... | {
"alphanum_fraction": 0.4699289503,
"author": null,
"avg_line_length": 46.6236391913,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "86150640ba5d0b649e014a11b803a3e6b56e3935",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% UMB-CS114-2015F: Introduction to Programming in Java
% Copyright 2015 Pejman Ghorbanzade <pejman@ghorbanzade.com>
% Creative Commons Attribution-ShareAlike 4.0 International License
% More info: https://github.com/ghorbanzade/UMB-CS114-2015F
%%%%%... | {
"alphanum_fraction": 0.6187788256,
"author": null,
"avg_line_length": 29.2293762575,
"converted": null,
"ext": "tex",
"file": null,
"hexsha": "d6eb10d395d094e04b5cdf77f4c723dc9196475b",
"include": null,
"lang": "TeX",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
(* *********************************************************************)
(* *)
(* The Compcert verified compiler *)
(* *)
(* Xavier Leroy... | {
"alphanum_fraction": null,
"author": "academic-archive",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_even... |
import copy
import numpy as np
from nltk.translate.bleu_score import corpus_bleu
from nltk.tokenize import word_tokenize
def rouge_helper_prepare_results(m, p, r, f):
return '\t{}:\t{}: {:5.2f}\t{}: {:5.2f}\t{}: {:5.2f}'.format(m, 'P', 100.0 * p, 'R', 100.0 * r, 'F1', 100.0 * f)
def remove_sub_strings(predicte... | {
"alphanum_fraction": 0.6627772791,
"author": null,
"avg_line_length": 61.2486910995,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "f3d3ed53dcdf19420dbac4d784ee70499ac7a559",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | {
"alphanum_fraction": 0.676819407,
"author": null,
"avg_line_length": 31.7094017094,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "dfb454725e87898537082b69b2c7f34286bff0a6",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
include("euler/euler.jl")
using .Numbers: get_digits
function compute(n::Float64)::Int
bouncy = 0
i = 1
while bouncy / i < n
i += 1
digits = get_digits(i)
sorted_digits = sort(digits)
if !(digits == sorted_digits || digits == reverse(sorted_digits)) bouncy += 1 end
end
... | {
"alphanum_fraction": 0.5982142857,
"author": null,
"avg_line_length": 22.4,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "96e413ac6405af5ca7f5bf2a095564edafdd8d94",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count":... |
#****************************************************************************
# Molecular Dynamics Potentials (MDP)
# CESMIX-MIT Project
#
# Contributing authors: Ngoc-Cuong Nguyen (cuongng@mit.edu, exapde@gmail.com)
#********************... | {
"alphanum_fraction": 0.5986973948,
"author": null,
"avg_line_length": 31.1875,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "1a40998fa452197aa604c88a33813c21dfb4b770",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_coun... |
"""
@author: David Diaz Vico
@license: MIT
"""
import numpy as np
from sacred import Experiment, Ingredient
from sklearn.model_selection import cross_validate, PredefinedSplit
def experiment(dataset, estimator):
"""Prepare a Scikit-learn experiment as a Sacred experiment.
Prepare a Scikit-learn... | {
"alphanum_fraction": 0.5642802156,
"author": null,
"avg_line_length": 38.97,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "60605759e7ca596a4af31f8a1a2e7eace6144ef7",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count... |
\lab{Conjugate-Gradient}{Conjugate-Gradient}
\objective{Learn about the Conjugate-Gradient Algorithm and its Uses}
\section*{Descent Algorithms and the Conjugate-Gradient Method}
There are many possibilities for solving a linear system of equations, each method with its own set of pros and cons. In this lab, we
will e... | {
"alphanum_fraction": 0.7398941171,
"author": null,
"avg_line_length": 51.1670886076,
"converted": null,
"ext": "tex",
"file": null,
"hexsha": "3e9c446d51decdb780c2b633e3c289a7e688aaef",
"include": null,
"lang": "TeX",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
#!/usr/bin/env python
from matplotlib import use as mpl_use
mpl_use('Agg')
import matplotlib.pyplot as plt
import torch
from multiprocessing import cpu_count
import torch.optim as optim
import torch.nn.functional as F
import torch.multiprocessing as mp
import numpy as np
from torch.autograd import Variable
import pyxi... | {
"alphanum_fraction": 0.6014302741,
"author": null,
"avg_line_length": 26.7197452229,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1ef7056a9be56fe2be268b172a622ec9e4608f71",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
from __future__ import print_function
import deepchem as dc
import numpy as np
import tensorflow as tf
from sklearn.metrics import accuracy_score
# Load the data.
tasks, datasets, transformers = dc.molnet.load_toxcast()
(train_dataset, valid_dataset, test_dataset) = datasets
x = train_dataset.X
y = train_dataset.y
w... | {
"alphanum_fraction": 0.711753477,
"author": null,
"avg_line_length": 30.8151260504,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1623e3084a9c9730f0655d4f8477668b898b5c0c",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import os
from typing import Dict, List
import numpy as np
import torch
import pickle
from overrides import overrides
from datasets.document_dataset_base import DocumentDatasetBase
from services.arguments.ocr_quality_arguments_service import OCRQualityArgumentsService
from services.log_service import LogService
from ... | {
"alphanum_fraction": 0.723709369,
"author": null,
"avg_line_length": 35.4576271186,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1c5db524d5517468ee1f6a60ecbedaa4b2a8006f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
"""
Create multiple viewers from the same script
"""
import numpy as np
from skimage import data
import napari
with napari.gui_qt():
# add the image
photographer = data.camera()
viewer_a = napari.view_image(photographer, name='photographer')
# add the image in a new viewer window
astronaut = dat... | {
"alphanum_fraction": 0.7223427332,
"author": null,
"avg_line_length": 24.2631578947,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "70b2c63213206cab4d884fc829134c9615060de8",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""This file can be used to create a new python file that will return
the dictionary of Lebedev quadratures."""
import numpy as np
import sys
def createdict():
"""Create a dictionary based on the quadrature files stored in data/"""
orders = [
3,
5,
7,
9,
11,
13,... | {
"alphanum_fraction": 0.4842857143,
"author": null,
"avg_line_length": 20.5882352941,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "34cfdbc1d789c6b36efe8bb479ac085391fb5eca",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy
import data_algebra
from data_algebra.data_ops import *
import data_algebra.test_util
def test_simple_expr_1():
d_orig = data_algebra.default_data_model.pd.DataFrame({"x": [1.0, 2.0, -3.0, 4.0]})
d = d_orig.copy()
ops = describe_table(d, table_name="d").extend(
{
"z": "x... | {
"alphanum_fraction": 0.5684340321,
"author": null,
"avg_line_length": 27.0333333333,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "cde7c83fd7dcca10996340f09dd92f48894a05eb",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma vector_space_pair_with[explicit_ab_group_add]:
"vector_space_pair s1 s2 \<longleftrightarrow> vector_space_pair_on_with UNIV UNIV (+) (-) uminus 0 s1 (+) (-) uminus 0 s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. vector_space_pair s1 s2 = vector_space_pair_on_with UNIV UNIV (+) (-) uminus (... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 217,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime": n... |
#!/usr/bin/env python
# coding: utf-8
# In[Load Packages]:
# Basic code for Artificial Neural Network for tensorflow lite
# September 2021
# adapted from Alzahra Hamdan (August 2021)
# load tensorflow and keras
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import models, layers, optimize... | {
"alphanum_fraction": 0.6708169115,
"author": null,
"avg_line_length": 33.0295857988,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "c6fb742cd8b3de429badaff422c543f2aff0d225",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# Mass Maps From Mass-Luminosity Inference Posterior
In this notebook we start to explore the potential of using a mass-luminosity relation posterior to refine mass maps.
Content:
- [Math](#Math)
- [Imports, Constants, Utils, Data](#Imports,-Constants,-Utils,-Data)
- [Probability Functions](#Probability-Functions)
-... | {
"alphanum_fraction": 0.903767575,
"author": null,
"avg_line_length": 293.2169811321,
"converted": true,
"ext": "ipynb",
"file": null,
"hexsha": "c9c84f045d7357dc237216cb26b7bb1889131558",
"include": null,
"lang": "Jupyter Notebook",
"length": null,
"llama_tokens": null,
"mathlib_filename": nul... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # S_El... | {
"alphanum_fraction": 0.6892230576,
"author": null,
"avg_line_length": 33.5294117647,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "857ec3e8d453b84c667b15295a1392e1a6b82ec5",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
import shutil
import pickle as pkl
import argparse
import tensorflow as tf
from tensorflow.contrib.layers.python.layers import batch_norm as batch_norm
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.pyplot a... | {
"alphanum_fraction": 0.6439045743,
"author": null,
"avg_line_length": 35.4186046512,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "db9fbf0ddbbc9207c256faa5661ef3ee0911e866",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
import pickle
import random
import numpy as np
from tqdm import tqdm
import tensorflow as tf
import tensorflow_probability as tfp
from models.gazeflow import Glow
class GazeFlow:
def __init__(self, hparams):
self.hparams = hparams
self.input_shape = [
self.hparams.images_w... | {
"alphanum_fraction": 0.635443038,
"author": null,
"avg_line_length": 34.0517241379,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "c2fe563cb4fab74bfa502062d912a2a58b01d7fd",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE... | {
"alphanum_fraction": 0.671475804,
"author": null,
"avg_line_length": 30.2454545455,
"converted": null,
"ext": "cxx",
"file": null,
"hexsha": "873b924a640a39132a9a9b64b42934fa37a6e530",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_... |
import scipy as sp
import numpy as np
from scipy import sparse
import matplotlib.pyplot as plt
from features import (
team_answer_estimation,
create_test_prediction,
)
from utils import (
add_dim,
)
class ProbaRegression:
def __init__(
self,
init_weights=None,
epochs=1e4... | {
"alphanum_fraction": 0.4705395907,
"author": null,
"avg_line_length": 27.3276836158,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "af3d386415f4c661dd42a07a5a1e82ee8fd19425",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#####################################################################
# Description: Calculates the time statistics of the network devices
#####################################################################
import json
import csv
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
id = 8448 # t... | {
"alphanum_fraction": 0.6326164875,
"author": null,
"avg_line_length": 33.6724137931,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "54ec9c3f6ca7cd0d4dc7287cc37c2cf0338d90c9",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#!/usr/bin/env python3
import argparse
import random
import numpy as np
from tqdm import tqdm
import torch
from data import train_selector, test_selector1, load_images
from neural_net import Ensemble
np.random.seed(0)
torch.manual_seed(0)
parser = argparse.ArgumentParser(description="Siamese network training on CPU... | {
"alphanum_fraction": 0.6921862668,
"author": null,
"avg_line_length": 33.6371681416,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "e2002b3c0ca056128ff91805300f0b86946e7938",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
from sklearn.neighbors import KernelDensity
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
def gaussian_kernel(x, y, h):
return 1/(2*np.pi*h*h)**0.5 * np.exp(-((x-y)**2).sum(axis=-1)/2/h/h)
class NaiveKDE():
def __init__(self, kernel_func=gaussian_kernel, ... | {
"alphanum_fraction": 0.5640495868,
"author": null,
"avg_line_length": 27.3962264151,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "d333dcb9b349852dcf8cd0ec925f8f373d196052",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 27 15:27:51 2021
@author: aschauer
"""
import os
import logging
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from cv_results_database import get_cv_results_as_df
import plotting_utils as pu
import scoring_utils as scu
fro... | {
"alphanum_fraction": 0.6462845011,
"author": null,
"avg_line_length": 33.1690140845,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "2a1a82659edb70b88c5f2e6047770eac55713eea",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import cv2
import numpy as np
import argparse
frameWidth = 640
frameHeight = 480
# For figures
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", help = "path to the image")
args = vars(ap.parse_args())
# For videos
# cap = cv2.VideoCapture(0)
# cap.set(3, frameWidth)
# cap.set(4, frameHeight)
def em... | {
"alphanum_fraction": 0.6017308046,
"author": null,
"avg_line_length": 36.2066666667,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1bac210b97d768a7b43a3816352c4f50354b55ec",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import tensorflow as tf
import numpy as np
from scipy import special
from nb_vae import NegativeBinomialVAE
class NegativeBinomialVAEb(NegativeBinomialVAE):
def _log_likelihood(self, h_r, h_p):
temp = tf.exp(-tf.multiply(tf.exp(h_r), tf.log(tf.exp(h_p) + 1)))
temp = tf.clip_by_value(temp, 1e-5... | {
"alphanum_fraction": 0.6489533011,
"author": null,
"avg_line_length": 20.0322580645,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "aa092ad105718ddeda5327ac7ffc9f28452ba5b1",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# This script extracts smaller images from the 1000x1000 dataset images
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import cleaner
from imageio import imread
import matplotlib.pyplot as plt
import numpy as np
from PIL... | {
"alphanum_fraction": 0.5401099943,
"author": null,
"avg_line_length": 37.9352517986,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "3154e3cdf7ee92e3b1b1eda40eda3e52371b4003",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# code was based on https://github.com/swz30/MPRNet
# Users should be careful about adopting these functions in any commercial matters.
# https://github.com/swz30/MPRNet/blob/main/LICENSE.md
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from ...modules.init import kaiming_n... | {
"alphanum_fraction": 0.515240449,
"author": null,
"avg_line_length": 37.7126213592,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "9be802a19b437805a3ca0e988b9591d37dceda8f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
SUBROUTINE SWAP_STRING(ISTAT)
!=======================================================================
! LATEST CORRECTION BY
!
! PURPOSE
! Swap strings in the slave file
!
! PROGRAMMED BY: bjorn.melhus@akersolutions.com
! CREATED......: 10.05.2021
!=====================================... | {
"alphanum_fraction": 0.5400898012,
"author": null,
"avg_line_length": 36.2558139535,
"converted": null,
"ext": "f90",
"file": null,
"hexsha": "10aaaeb3ce49e6b23c390dab6f17284c599038ac",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_f... |
import logging
import cmapPy.pandasGEXpress.setup_GCToo_logger as setup_logger
import numpy
logger = logging.getLogger(setup_logger.LOGGER_NAME)
def fast_cov(x, y=None):
"""calculate the covariance matrix for the columns of x (MxN), or optionally, the covariance matrix between the
columns of x and and the c... | {
"alphanum_fraction": 0.6519524618,
"author": null,
"avg_line_length": 29.45,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "955caadc08cb09e1a9a39a771c2927cfb8a6101c",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count... |
[STATEMENT]
lemma dg_Funct_is_arrI:
assumes "\<NN> : \<FF> \<mapsto>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>t\<^sub>m\<^bsub>\<alpha>\<^esub> \<BB>"
shows "ntcf_arrow \<NN> : cf_map \<FF> \<mapsto>\<^bsub>dg_Funct \<alpha> \<AA> \<BB>\<^esub> cf_map \<GG>"
[P... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "CZH_Elementary_Categories_czh_ecategories_CZH_DG_FUNCT",
"hexsha": null,
"include": null,
"lang": null,
"length": 10,
"llama_tokens": 1688,
"mathlib_filename": null,
"max_forks_count"... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2014 Jonathan F. Donges
# Author: Jonathan F. Donges <donges@pik-potsdam.de>
# URL: <http://www.pik-potsdam.de/members/donges/software>
"""
Performs recurrence analysis of an ensemble of time series generated by the
COPRA algorithm corresponding to a single proxy record.
... | {
"alphanum_fraction": 0.6560915924,
"author": null,
"avg_line_length": 31.6952908587,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "c04e00833334a76795e9250c806a5436b613a879",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import cv2
import numpy as np
import math
import scipy.ndimage
def frequest(im, orientim, kernel_size, minWaveLength, maxWaveLength):
#bir parmak izi resminin kucuk bir blogu iCindeki sırt frekansini tahmin etme işlevi
#bir tepe frekansi bulunamazsa veya min ve maks ile belirlenen sinirlar dahilinde bulunamazs... | {
"alphanum_fraction": 0.7283372365,
"author": null,
"avg_line_length": 66.9803921569,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "35fba72956ada341642635dcef4fe65a04478c66",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
using CreditApprovalStub
using Test
@testset "CreditApprovalStub.jl" begin
# stubs
check_background_success(first_name, last_name) = true
check_background_failure(first_name, last_name) = false
# testing
let first_name = "John", last_name = "Doe", email = "jdoe@julia-is-awesome.com"
@test open_account(first_name... | {
"alphanum_fraction": 0.7791164659,
"author": null,
"avg_line_length": 29.2941176471,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "8f6a09c67484184c41859d12116a9dc267137ff1",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
From Test Require Import tactic.
Section FOFProblem.
Variable Universe : Set.
Variable UniverseElement : Universe.
Variable wd_ : Universe -> Universe -> Prop.
Variable col_ : Universe -> Universe -> Universe -> Prop.
Variable col_swap1_1 : (forall A B C : Universe, (col_ A B C -> col_ B A C)).
Variable col_swap2_... | {
"alphanum_fraction": null,
"author": "janicicpredrag",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_... |
import itertools
import numpy as np
import matplotlib.pyplot as plt
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues):
"""
This function prints and plots the confusion matrix.
Normalization can be applied by setting `normalize=True`.
"""
if normali... | {
"alphanum_fraction": 0.5586436909,
"author": null,
"avg_line_length": 26.4558823529,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "768e1903fb88a5833224b7c3677ac58bac1f58e8",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.constants import golden
mpl.rc("text", usetex=True)
mpl.rc("font", family="serif")
x = np.array([0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1])
t = np.array([1.15, 0.84, 0.39, 0.14, 0, 0.56, 1.16, 1.05, 1.45, 2.39, 1.86])
de... | {
"alphanum_fraction": 0.5725456125,
"author": null,
"avg_line_length": 18.564516129,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "352450113ee6df437dd1da7b3707d1eab5e98b0d",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
from __future__ import absolute_import, print_function, division
import zipfile
import os
import shutil
import warnings
import glob
import itertools
from six.moves import urllib
import numpy as np
from scipy.io import loadmat
from natsort import natsorted
import dill
from pkg_resources import resource_string
from PIL... | {
"alphanum_fraction": 0.6289094547,
"author": null,
"avg_line_length": 42.0829800121,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "12dd5740b714efd00010135e4ddd301afc2172a3",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import torch
import numpy as np
def align_loss(x, y, alpha=2):
return (x - y).norm(p=2, dim=1).pow(alpha).mean()
def uniform_loss(x, t=2):
return torch.pdist(x, p=2).pow(2).mul(-t).exp().mean().log()
def CCA_loss(H1, H2, outdim_size, use_all_singular_values=False):
r1 = 1e-3
r2 = 1e-3
eps = 1... | {
"alphanum_fraction": 0.599448149,
"author": null,
"avg_line_length": 36.2416666667,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "000705a9e45e8ca912d80344cd3aa76fa9fcdcb4",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
[STATEMENT]
lemma mtx_nonzero_bid_eq:
assumes "R\<subseteq>Id"
assumes "(a, a') \<in> Id \<rightarrow> R"
shows "mtx_nonzero a = mtx_nonzero a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. mtx_nonzero a = mtx_nonzero a'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> Id... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Refine_Imperative_HOL_IICF_Impl_IICF_Array_Matrix",
"hexsha": null,
"include": null,
"lang": null,
"length": 4,
"llama_tokens": 361,
"mathlib_filename": null,
"max_forks_count": null,... |
import numpy as np
import unittest
from numpy.testing import *
from src.tabular.policies import TabularQPolicy, Qdict2array
from src.tabular.TD import QLearning
from src.envs.dummy_envs import *
class TestQLearning(unittest.TestCase):
def setUp(self):
self.env = ChainEnv(6)
self.env_multi = Grid... | {
"alphanum_fraction": 0.5025342119,
"author": null,
"avg_line_length": 38.6862745098,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "417d38f25ba028d47a7473d1a3a03960e389e1ad",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import matplotlib.pyplot as plt
from plotters.line_plotter import LinesPlotter
import numpy as np
# lee un resultado que contiene tres campos
plotter = LinesPlotter.load_data('examples/data_small.npy',
['reward', 'steps', 'end_state'])
# grafica el campo reward asignando la etiqueta r... | {
"alphanum_fraction": 0.7148148148,
"author": null,
"avg_line_length": 31.7647058824,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "77b2a279a6b3a968055ed9c788298df2cbd34dad",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
Load LFindLoad.
From lfind Require Import LFind.
From QuickChick Require Import QuickChick.
From adtind Require Import goal4.
Derive Show for natural.
Derive Arbitrary for natural.
Instance Dec_Eq_natural : Dec_Eq natural.
Proof. dec_eq. Qed.
Derive Show for lst.
... | {
"alphanum_fraction": null,
"author": "yalhessi",
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_da... |
export AbstractHook,
ComposedHook,
EmptyHook,
StepsPerEpisode,
RewardsPerEpisode,
TotalRewardPerEpisode,
TotalBatchRewardPerEpisode,
CumulativeReward,
TimePerStep,
DoEveryNEpisode,
DoEveryNStep
"""
A hook is called at different stage duiring a [`run`](@ref) to allow users to inj... | {
"alphanum_fraction": 0.6744186047,
"author": null,
"avg_line_length": 24.4054054054,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "1df46eae4d3ffaa725fc5482d145ec3992249502",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.