text stringlengths 0 27.1M | meta dict |
|---|---|
import abc
import math
import os
from concurrent.futures.process import ProcessPoolExecutor
from typing import Tuple, Union
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds
from emp_uncertainty.case_studies.case_study import ClassificationCaseStudy
IMAGENET_CORRUPTION_TYPES = [
'gaus... | {
"alphanum_fraction": 0.640381822,
"author": null,
"avg_line_length": 37.3565891473,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "90770a05dc81538813119bc1988d76d398c72920",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import unittest
import numpy as np
from ocgis.util.helpers import iter_array
class Test(unittest.TestCase):
def test_iter_array(self):
values = np.random.rand(2,2,4,4)
mask = np.random.random_integers(0,1,values.shape)
values = np.ma.array(values,mask=mask)
for idx in iter_array(v... | {
"alphanum_fraction": 0.6812030075,
"author": null,
"avg_line_length": 33.25,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "fb78edc81525b2d36d422484eeb47a84895f74e4",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count... |
program test_below
use simsphere_mod, only: nlvls, frveg, otemp, tt, tg, heat, rnet, kappa, &
xfun, del, dzeta, ptime, wmax, w2g, wgg, eq
use mod_testing, only: assert, initialize_tests, report_tests
implicit none
logical, dimension(:), allocatable :: tests
logical :: test_failed
... | {
"alphanum_fraction": 0.6123348018,
"author": null,
"avg_line_length": 25.2222222222,
"converted": null,
"ext": "f90",
"file": null,
"hexsha": "7167c5e3c1c9ac27e4bd1a664e598dea9756fdae",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_f... |
[STATEMENT]
lemma harm_aux_ineq_1:
fixes k :: real
assumes "k > 1"
shows "1 / k < ln (1 + 1 / (k - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
have "k-1 > 0" \<o... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Gauss_Sums_Polya_Vinogradov",
"hexsha": null,
"include": null,
"lang": null,
"length": 30,
"llama_tokens": 2468,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_f... |
# Machine Learning/Data Science Precourse Work
import numpy as np
# ###
# LAMBDA SCHOOL
# ###
# MIT LICENSE
# ###
# Free example function definition
# This function passes one of the 11 tests contained inside of test.py. Write the rest, defined in README.md, here, and execute python test.py to test. Passing this preco... | {
"alphanum_fraction": 0.657480315,
"author": null,
"avg_line_length": 18.4727272727,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "3866a65165804c09e3af909c03808897b62d1b5e",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import ast
import os
import joblib
import json
import datetime
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from bgp.rl.rlkit_platform import simulate_policy, get_best_itr
from bgp.rl import reward_functions
BGP_DIR = '/bgp/dir'
def process_filename(file, splitlast):
"""
Extract... | {
"alphanum_fraction": 0.5948258837,
"author": null,
"avg_line_length": 44.8112094395,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "82b4af5972d1ec23a724f1dc57e4839803769541",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
module TestDatumStorage
using Mimi
using Test
comp_first = 2003
comp_last = 2008
@defcomp foo begin
v = Variable(index = [time])
function run_timestep(p, v, d, ts)
# implement "short component" via time checking
if TimestepValue(comp_first) <= ts <= TimestepValue(comp_last)
v.v[ts... | {
"alphanum_fraction": 0.5570755775,
"author": null,
"avg_line_length": 27.524691358,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "c1eb0be0b926af20f83de143218f740462cfa9ac",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
[STATEMENT]
lemma points_in_long_chain:
assumes "[f\<leadsto>Q|x..y..z]"
shows "x\<in>Q" and "y\<in>Q" and "z\<in>Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<in> Q &&& y \<in> Q &&& z \<in> Q
[PROOF STEP]
using points_in_chain finite_long_chain_with_def assms
[PROOF STATE]
proof (prove)
using this:
[?f... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Schutz_Spacetime_Minkowski",
"hexsha": null,
"include": null,
"lang": null,
"length": 2,
"llama_tokens": 315,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_fork... |
import numpy as np
from symfit import parameters, variables, log, Fit, Model
from sympy import *
import os
class CaseModels():
def __init__(self, csv_medium_door, csv_medium_open, csv_low_01, csv_low_02):
self.csv_medium_door = csv_medium_door
self.csv_medium_open = csv_medium_open
self.csv... | {
"alphanum_fraction": 0.6290042215,
"author": null,
"avg_line_length": 38.7211538462,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "280662eb0cf1d30090832cf9d28fce5006edc630",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
abstract type Command end
"""
Operation lazily executed, for example recorded in a [`CommandRecord`](@ref).
"""
abstract type LazyOperation <: Command end
"""
Operation that sets rendering state for invoking further operations, but which does not do any work by itself.
"""
abstract type StateCommand <: Command end
"... | {
"alphanum_fraction": 0.7014136306,
"author": null,
"avg_line_length": 37.0255319149,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "6db80f533b258beefb998ef38ef496cc26c7616e",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
# Reference: https://github.com/tianlinyang/DKVMN
import json
import numpy as np
import torch
import torch.nn as nn
# import torch.nn.init
# Utils
def varible(tensor, device):
return torch.autograd.Variable(tensor).to(device)
# def to_scalar(var):
# return var.view(-1).data.tolist()[0]
# def save_checkp... | {
"alphanum_fraction": 0.6219936049,
"author": null,
"avg_line_length": 41.9416909621,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "0058921db74d18a51cb097f4cb9629b6261aff24",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# -*- utf-8 -*-
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
def img_endecoding():
image_raw_data = tf.gfile.FastGFile("backGround.jpg", 'rb').read()
img_data = tf.image.decode_jpeg(image_raw_data)
print(type(img_data.eval()))
print(img_data.eval().ndim)
print(img_d... | {
"alphanum_fraction": 0.6803545586,
"author": null,
"avg_line_length": 36.6092715232,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "6b86b1ce4a0853e8a8e9de2bf6ac673d2d42f86c",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
\input{permve-ntnu-latex-assignment.tex}
\usepackage{float}
\title{
\normalfont \normalsize
\textsc{Norwegian University of Science and Technology\\IT3105 -- Artificial Intelligence Programming}
\horrule{0.5pt} \\[0.4cm]
\huge Module 2:\\Combining Constraint-Satisfaction Problem-Solving with Best-First
Search\\
\ho... | {
"alphanum_fraction": 0.7980309039,
"author": null,
"avg_line_length": 104.4714285714,
"converted": null,
"ext": "tex",
"file": null,
"hexsha": "0d9f8a068f24a21cc1f78bbe3080e71681d110c7",
"include": null,
"lang": "TeX",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import albumentations as A
from torchvision import transforms
import numpy as np
from drishtypy.data.data_utils import find_stats
from albumentations.pytorch import ToTensor
import cv2
'''
# A.Resize(input_size,input_size),
# A.CoarseDropout(max_holes=1,max_height=16,max_width=16,min_holes=None,min_height=4,min_width=4... | {
"alphanum_fraction": 0.704135737,
"author": null,
"avg_line_length": 36.9803921569,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "2ef85d1b555ed7bbb635a7da328c26082e37437b",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import os
import sys
import numpy as np
import tensorflow as tf
from tensorflow.python.keras.utils import losses_utils
'''
These are custom Loss functions
'''
class MultiTaskLoss(tf.keras.losses.Loss):
def __init__(self, loss_num=2,
scale_factor = 0.01,
lam = 0.00001,
... | {
"alphanum_fraction": 0.5718243819,
"author": null,
"avg_line_length": 44.6857142857,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "56ab0de2866bb417cd9f512978588747fe02618b",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""
Contains functions to run likelihood modules.
"""
import glob
import os.path
import time
import warnings
import numpy as np
import like_cl_gauss as like_g
import like_cl_wishart as like_w
import posteriors
def run_like_cl_wishart(grid_dir, varied_params, save_path, n_zbin, obs_pos_pos_dir, obs_she_she_dir, obs... | {
"alphanum_fraction": 0.6626938541,
"author": null,
"avg_line_length": 49.3201133144,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "d70409d4b2434ebd8951bb380daea49aad01cd3e",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""Test the timeseries divider transformer."""
import numpy as np
import numpy.testing as nt
import pandas as pd
import pandas.testing as pt
import pytest
import src.preprocessing as pp
import src.preprocessing.divide_dataset as dd
def test_it_raises_wrong_date_col():
l = 1000
t = 750
s = 250
with ... | {
"alphanum_fraction": 0.6925704526,
"author": null,
"avg_line_length": 26.6136363636,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "bcf9c8357f9f884dedf6e34c7b20425655b8bf54",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2003 RiskMap srl
Copyright (C) 2015 CompatibL
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you ca... | {
"alphanum_fraction": 0.5098116634,
"author": null,
"avg_line_length": 33.5456953642,
"converted": null,
"ext": "hpp",
"file": null,
"hexsha": "5e9a18907e307634d54bb320dcaf35d03e437db9",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
/-
Copyright (c) 2019 Kevin Kappelmann. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kevin Kappelmann
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.algebra.continued_fractions.basic
import Mathlib.PostPort
universes u_1
namespace Ma... | {
"alphanum_fraction": null,
"author": "AurelienSaue",
"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_ma... |
"""
image generated by each "observation"
"""
import numpy as np
import matplotlib.pyplot as plt
class image():
def __init__(self,w,h):
self.width = w
self.height = h
self.image = np.zeros(shape=(self.height,self.width))
def add_random_noise(self):... | {
"alphanum_fraction": 0.4970149254,
"author": null,
"avg_line_length": 12.1818181818,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "5425032907c594d33990d18aadd2083f535046ad",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
from scipy.integrate import odeint
from matplotlib import pyplot as plt
def dx_MAPK(x,t,a=1000,k=150,d=150,l=0):
KKK = x[0]
E1 = x[1]
KKK_E1 = x[2]
KKKP = x[3]
E2 = x[4]
KKKP_E2 = x[5]
KK = x[6]
KK_KKKP = x[7]
KKP = x[8]
KKPase = x[9]
KKP_KKPase = x[10]
... | {
"alphanum_fraction": 0.556749921,
"author": null,
"avg_line_length": 25.304,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "4769fb0e7c78b186223a3806cbe892f68c695f9c",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count... |
# -*- coding: utf-8 -*-
import numpy as np
IPART = 2
class LightMatrix:
def __init__(self):
self.maxrows = 100
self.maxcols = 100
self.lights = np.zeros( (self.maxrows,self.maxcols), dtype=int)
def readCurrentState(self, myfilename):
with open(myfilename) as data... | {
"alphanum_fraction": 0.4844387755,
"author": null,
"avg_line_length": 34.0869565217,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "6d96819d4654c4caf838c142151ae5fff8255a9f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
#######################################################################
# # ClusterFit class
class ClusterFit:
"""
container class for fitting PCA, clustering
"""
def __init__(self,
data, # could be deaths/cases, raw/adjusted
Npca = 10,
... | {
"alphanum_fraction": 0.5735889819,
"author": null,
"avg_line_length": 47.4743589744,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "3e896f3a776fcd560e7d95ef287263507cac1b45",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#!/usr/bin/env python
# CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu>
# unit tests for librosa.filters
#
# This test suite verifies that librosa core routines match (numerically) the output
# of various DPWE matlab implementations on a broad range of input parameters.
#
# All test data is generated... | {
"alphanum_fraction": 0.6316634752,
"author": null,
"avg_line_length": 28.6530973451,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "d4add1475bc08cdcb7bb43debf073199a4737f0b",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii, fits
import math
from importlib import reload
import multiprocessing as mp
import os
from tqdm import tqdm
import numpy.ma as ma
from scipy.interpolate import interp1d
from ..lib import plots
from scipy.optimize import leastsq
from .sort_n... | {
"alphanum_fraction": 0.6301002646,
"author": null,
"avg_line_length": 39.1869031378,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1d1071c4a9b2c4886fa373e74d9d471cc81f3097",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy.testing as npt
import torch
import espaloma as esp
from espaloma.utils.geometry import (
_sample_four_particle_torsion_scan,
_timemachine_signed_torsion_angle,
)
def test_dihedral_vectors():
import espaloma as esp
distribution = torch.distributions.normal.Normal(
loc=torch.zeros... | {
"alphanum_fraction": 0.6313364055,
"author": null,
"avg_line_length": 24.5660377358,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "444b35b04f16bac967c4be718d1ea887e7b2f884",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import random
import numpy as np
class Dataset:
"""
A mapping from column names to immutable arrays of equal length.
"""
def __init__(self, **data):
self._data = {}
self._length = None
super().__init__()
for column, data in data.items():
self[... | {
"alphanum_fraction": 0.5430769231,
"author": null,
"avg_line_length": 31.5533980583,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "b890ea8f1dfb10602452f7f081689d7b823747de",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
import numpy as np
import pretty_midi
import torch
import dataprocess
import matplotlib.pyplot as plt
import dataprocess
# Directory to load processed midi files
processed_dir = 'processed_midi_files\\'
# Directory to load processed event files
processed_events_dir = 'processed_event_indices_files/'
# Number... | {
"alphanum_fraction": 0.7249079017,
"author": null,
"avg_line_length": 31.896882494,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "c2d3d5f7f007334c053da5ed55e457466e722d66",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
from pathlib import Path
import warnings
import cv2
import numpy as np
from PIL import Image
import torch
from .colormap import voc_colormap
class ToneLabel:
def __init__(self, label: np.ndarray, ignore: set = {0}) -> None:
assert label.dtype == np.uint8
self.data = label
self.ignore = i... | {
"alphanum_fraction": 0.5605209047,
"author": null,
"avg_line_length": 32.7130044843,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "e99aca3f19d3a0ffaa9c93ffee19207e481707c2",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
import itertools
import pytest
import numpy as np
from rbc.errors import UnsupportedError, HeavyDBServerError
from rbc.tests import heavydb_fixture, assert_equal
from rbc.typesystem import Type
rbc_heavydb = pytest.importorskip('rbc.heavydb')
available_version, reason = rbc_heavydb.is_available()
# Throw an... | {
"alphanum_fraction": 0.5541629086,
"author": null,
"avg_line_length": 36.8304696449,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "a707f335af0b8a14ad84261224620361b31fc9ec",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma fold_is_None: "x=None \<longleftrightarrow> is_None x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (x = None) = is_None x
[PROOF STEP]
by (cases x) auto | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Automatic_Refinement_Autoref_Bindings_HOL",
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 76,
"mathlib_filename": null,
"max_forks_count": null,
"max_f... |
@safetestset "REM" begin
using GlobalMatchingModels, Statistics, Test, Random
using Distributions
probe = [6,1,1,3];
memory = [0 2; 1 2; 0 1; 3 0];
model = REM(;memory, g=.40, c=.70)
activations = compute_activations(model, probe)
@test activations ≈ [10.5802,.18450] atol = 1e-4
prob =... | {
"alphanum_fraction": 0.5681570338,
"author": null,
"avg_line_length": 28.65625,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "31d3b1b3d2020452728334cb311e5475cb0aa8cf",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_cou... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 19 13:31:01 2011
@author: -
"""
import DejaVu2 as DejaVu
from DejaVu2.Spheres import GLUSpheres
try :
from DejaVu2 import hyperballs
hyperballsFound = True
except :
hyperballsFound = False
if hyperballsFound:
from DejaVu2.hyperballs.AtomAndBondGLSL i... | {
"alphanum_fraction": 0.5414300736,
"author": null,
"avg_line_length": 38.6585365854,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "595c5070fd98cada08f686bd47fbe108612c2059",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma ospec_alt: "ospec m P = (case m of None \<Rightarrow> False | Some x \<Rightarrow> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ospec m P = (case m of None \<Rightarrow> False | Some x \<Rightarrow> P x)
[PROOF STEP]
by (auto split: option.splits) | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "ROBDD_Option_Helpers",
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 101,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_even... |
from __future__ import division
import sys
sys.path.append("GenAnalysis/tools/")
import macroeco_distributions as md
import macroecotools as mt
import feasible_functions as ff
import predRADs
import mete
import pln
import cloud
import numpy as np
def getPredRADs(N, S, Nmax):
PRED = []
# Predicted ... | {
"alphanum_fraction": 0.5973220118,
"author": null,
"avg_line_length": 31.8958333333,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "8b8f6068c2d5098b6dafdc835f7c47163bbd45cf",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""
Copyright (C) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | {
"alphanum_fraction": 0.6228148442,
"author": null,
"avg_line_length": 47.1355140187,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "dbfc556cea9df7ec556026cd15ea74a1c9e12bed",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
Subroutine chkout(l, t, tmin, nc)
Implicit Double Precision (A-H, O-Z)
Parameter (maxptn=400001)
Common /prec2/gx(maxptn), gy(maxptn), gz(maxptn), ft(maxptn), px(maxptn), py(maxptn), pz(maxptn), e(maxptn), xmass(maxptn), ityp(maxptn)
Save
m1 = 11
m2 = 11
m3 = 11
Call chkcel(l, m1, m2, m3, t, tmin, nc)
... | {
"alphanum_fraction": 0.5680580762,
"author": null,
"avg_line_length": 29,
"converted": null,
"ext": "f90",
"file": null,
"hexsha": "8e8759233ff4d09fbcd1d5467ac34b05c40b6fb9",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count"... |
# Lint as: python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | {
"alphanum_fraction": 0.6789973018,
"author": null,
"avg_line_length": 33.6920821114,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "4afa039b32d67b7d992edb9e2604a5df58af757e",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
export plot_atom
export plot_atom!
export plot_graphene
@recipe function f(g::Vector{T}) where T<:AbstractGPrimitive
get_x.(g), get_y.(g)
end
function plot_atom!(plt, g::Vector{T}; kw...) where T<:AbstractGPrimitive
atoms = filter(isatom, g)
bonds = filter(isbond, g)
polygons = filter(is... | {
"alphanum_fraction": 0.6314403911,
"author": null,
"avg_line_length": 32.4268292683,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "c5babb36b74d4f358664cd42589a7a3f26e00ac1",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import numpy as np
from learning import IRL_helper # get the Reinforcement learner
from playing import play # get the RL Test agent, gives out feature expectations after 2000 frames
from nn import neural_net # construct the nn and send to playing
BEHAVIOR = 'bumping' # yellow/brown/red/bumping
FRAMES = 100000 # numb... | {
"alphanum_fraction": 0.6178115016,
"author": null,
"avg_line_length": 42.9257142857,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "d9b4dbfc3a7d9cce0bebf747f1f15c915ce3368d",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""In this instantiation of the online AdWords problem, the #variables becomes
n*m*(#slots)*
"""
import random
import numpy as np
import pulp as pl
import configs
from src.data_utils import create_data_vars
from src.pulp_utils import optimize_lp
# SLOTS = 3
# GAMMA = 0.99
np.random.seed(256)
def calc_slot_discoun... | {
"alphanum_fraction": 0.5365102374,
"author": null,
"avg_line_length": 27.664160401,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "b048421f966b39da33771d135e80a49b90e9691a",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
#MIT License
# This software has been heavily inspired from: JetsonHacks YouTube videos, examples and GitHub Code
# Please refer to : https://github.com/jetsonhacks/gpuGraphTX
# Modifications to include instant bar graphs and also CPU average usage history
# by: Walther Carballo Hernandez
# Please refer to: https://g... | {
"alphanum_fraction": 0.7256097561,
"author": null,
"avg_line_length": 35.2911392405,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "025c8982d9f018b5cc6261e612e9304b7a671ca7",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
using UnPack
using ..Fields: sweep
using ..Fields: pre_post_colons
#####
##### fft!
#####
dct3D!(f, dir::Int) =
dct3D!(f, Val(dir), Radix2Type())
function dct3D!(f, ::Val{dim}, fft_type::FFTType=Radix2Type()) where {dim}
@unpack Ipre, Ipost = pre_post_colons(f, dim)
for i in 1:size(f, dim)
fv = @... | {
"alphanum_fraction": 0.5867052023,
"author": null,
"avg_line_length": 22.3225806452,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "e41dc4db4228d35e2af0cb4675ba906747ecf2e8",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
'''
*****************************************************************************************
*
* ===============================================
* Nirikshak Bot (NB) Theme (eYRC 2020-21)
* ===============================================
*
* This script is to implement T... | {
"alphanum_fraction": 0.5420124246,
"author": null,
"avg_line_length": 40.5386029412,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "e192bb4145c390bfb354fa3ce61530df483b26b0",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# Copyright 2013 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# 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 requi... | {
"alphanum_fraction": 0.6245202989,
"author": null,
"avg_line_length": 30.4676923077,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "71ac8422d992953bdaf989e663681e8c1c0ad1df",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os, sys
import numpy as np
import imageio
import json
import random
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm, trange
import matplotlib.pyplot as plt
from models.sampler import StratifiedSampler, Import... | {
"alphanum_fraction": 0.7480376766,
"author": null,
"avg_line_length": 32.6666666667,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "e0b1028366c5e47a45602de67d777758b2c6922f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
const FT = Float64
import SciMLBase: step!
using OrdinaryDiffEq
using OrdinaryDiffEq: ODEProblem, solve, SSPRK33, savevalues!, Euler
using LinearAlgebra
using ClimaCore
# pending PR merge:
# import Pkg; Pkg.add(url="https://github.com/CliMA/ClimaCore.jl",rev="sb/online-sphere-remap", subdir = "lib/ClimaCoreTempestRema... | {
"alphanum_fraction": 0.7479423868,
"author": null,
"avg_line_length": 32.4,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "44bdf6df8a3db3944ebb994a0f5460b17eb38993",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count":... |
module Periodize
using Cubature: hcubature
using Cuba
using JSON
using Mea.Green
II = [1.0 + 0.0im 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0]
function buildmodelvec(finsE::String, finparams::String)
params = JSON.parsefile(finparams)
t = 1.0
tp = params["tp"][1]
... | {
"alphanum_fraction": 0.6102437688,
"author": null,
"avg_line_length": 28.9761904762,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "8e204be75489e6739a64f60214bfc9d05fb9e5d6",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import pdb
import torch
import numpy as np
import time
from tools.utils import Progbar,AverageMeter
from matplotlib import pyplot as plt
from scipy.integrate import simps
def predict_set(nets, dataloader, runtime_params):
run_type = runtime_params['run_type']
#net = net.eval()
progbar = Progbar(len(datalo... | {
"alphanum_fraction": 0.6504424779,
"author": null,
"avg_line_length": 39.2040816327,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "eb060b2473fdc3a2526e2579cb65771873a89c41",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
from typing import Dict, List, Tuple
import torch
from torch.utils.data.dataset import Dataset as torchDataset
import numpy as np
import copy
def shuffle(experiences, orders=None):
st_size = experiences.shape
batch_size = st_size[0]
nbr_distractors_po = st_size[1]
perms = []
shuffled_experiences =... | {
"alphanum_fraction": 0.5893566322,
"author": null,
"avg_line_length": 46.6296296296,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "06a8c1171b06a088d166de75775589964c991f62",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# -*- coding: utf-8 -*-
r"""
Checks for FES
"""
from . import CythonFeature, PythonModule
TEST_CODE = """
# disutils: libraries=fes
from libc.stdint cimport uint64_t
cdef extern from "<fes_interface.h>":
ctypedef int (*solution_callback_t)(void *, uint64_t)
void exhaustive_search_wrapper(int n, int n_eqs, in... | {
"alphanum_fraction": 0.6448979592,
"author": null,
"avg_line_length": 26.9230769231,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "fe7c60df85b3b458338f3598e87b3690dde86e89",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
// Copyright 2017, 2018 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
#include <boost/hash2/fnv1a.hpp>
#include <boost/hash2/siphash.hpp>
#include <boost/hash2/xxhash.hpp>
#include <boost/hash2/spooky2.hpp>
#include <boost/hash2/md5.hpp>
#include <boost/hash2/sha1.hpp>
#include <boost/has... | {
"alphanum_fraction": 0.6275951557,
"author": null,
"avg_line_length": 27.5238095238,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "bd7a7d30b7e9e290c7b7bac1bd093db49ad1cb23",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
#!/usr/bin/env
# -*- coding: utf-8 -*-
"""
@author: ludvigolsen
"""
import pandas as pd
import numpy as np
import warnings
from utipy.utils.convert_to_df import convert_to_df
def polynomializer(data, degree=2, suffix='_poly', exclude=[], copy=True):
"""
Creates polymonial features.
Adds suffix with info... | {
"alphanum_fraction": 0.5937948865,
"author": null,
"avg_line_length": 27.4094488189,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "fac884fe9f941e6c6161b420de7d18734b5b9e60",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import argparse
import os
import h5py
import numpy as np
import scipy
import scipy.io.wavfile
im... | {
"alphanum_fraction": 0.5522655008,
"author": null,
"avg_line_length": 37,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "7ec972e2d6ae3f3db6d5f7f27dd6ec1d9739a87d",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": ... |
import numpy as np
from binning import rebin
from expandimage import expand_image
def div_free_solution(mag, scale, mirror=0, no_ring=0):
"""Double precision version of the routine suggested by B. J. LaBonte. It calculates the solution
a satisfying the gauge conditions of Chae (2001) by means of the fast Four... | {
"alphanum_fraction": 0.5273390036,
"author": null,
"avg_line_length": 30.8625,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "6395fd209a695f6b18fcb7e6047ef1cfdf7d9b0d",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_cou... |
# -*- coding: utf-8 -*-
"""TF2.0 ANN Regression
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1XDvj0pjF_Sc1SVSbAw6zv1RcnLlqOo2u
"""
# Commented out IPython magic to ensure Python compatibility.
# Install TensorFlow
from mpl_toolkits.mplot3d import A... | {
"alphanum_fraction": 0.6804177546,
"author": null,
"avg_line_length": 24.8701298701,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "07943181f72284d7cd1603dfec174adbf0b04af4",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma observable2_equiv_observable: "observable2 ob P = observable ob P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. observable2 ob P = observable ob P
[PROOF STEP]
by (unfold observable_def observable2_def) (auto) | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Key_Agreement_Strong_Adversaries_Refinement",
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 81,
"mathlib_filename": null,
"max_forks_count": null,
"max... |
using Test
using GraphIO.EdgeList
using GraphIO.EdgeList: IntEdgeListFormat
@testset "EdgeList" begin
for g in values(digraphs)
readback_test(EdgeListFormat(), g)
readback_test(IntEdgeListFormat(), g)
end
end
| {
"alphanum_fraction": 0.7276595745,
"author": null,
"avg_line_length": 19.5833333333,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "d4fb0b80cfdc28917802af959cb1b8beb9c3cb29",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
# -*- coding: utf-8 -*-
# ==========================================================================
#
# Copyright 2018-2019 Remi Cresson (IRSTEA)
# Copyright 2020 Remi Cresson (INRAE)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | {
"alphanum_fraction": 0.6649484536,
"author": null,
"avg_line_length": 37.8536585366,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "fe4c5deaedb4095275f7161143a23ad968b10392",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
from abc import ABC, abstractmethod
import cv2
import numpy as np
import pandas as pd
from skimage.draw import line as raster_line
from .suite import Suite, project_points, compute_pose_error
# delete me
import matplotlib.pyplot as plt
def compute_3d_coordinates(oc, pts, model):
if not len(pts):
return... | {
"alphanum_fraction": 0.5314480741,
"author": null,
"avg_line_length": 34.1021377672,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "7b772d5d721e31fea6c83206c3a9cd5fdde1ebcf",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
export Astrobee2D
mutable struct Astrobee2D{T<:AbstractFloat} <: Robot
mass::T
J::T
Jinv::T
n_thrusters::Int
s::T
r::T
hard_limit_vel::T
hard_limit_accel::T
hard_limit_ω::T
hard_limit_α::T
btCollisionObject
xb::Vector{T}
Jcollision
end
function Astrobee2D{T}() where T
n_thrusters = 12
s... | {
"alphanum_fraction": 0.7113620325,
"author": null,
"avg_line_length": 29.5208333333,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "5120fac29ea9a003423f9cc58ea4e953f8d08da5",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
[STATEMENT]
lemma lzipWith_simps [simp]:
"lzipWith\<cdot>f\<cdot>(x :@ xs)\<cdot>(y :@ ys) = f\<cdot>x\<cdot>y :@ lzipWith\<cdot>f\<cdot>xs\<cdot>ys"
"lzipWith\<cdot>f\<cdot>(x :@ xs)\<cdot>lnil = lnil"
"lzipWith\<cdot>f\<cdot>lnil\<cdot>(y :@ ys) = lnil"
"lzipWith\<cdot>f\<cdot>lnil\<cdot>lnil = lnil"
[PROOF S... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "WorkerWrapper_LList",
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 314,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event... |
#pragma once
#include "iparam.h"
#include "iparamlist.h"
#include "iflag.h"
#include "iarg.h"
#include "iarglist.h"
#include "icommand.h"
#include "optioninfo.h"
#include "format.h"
#include <sfun/string_utils.h>
#include <cmdlime/usageinfoformat.h>
#include <gsl/gsl>
#include <utility>
#include <vector>
#include <memo... | {
"alphanum_fraction": 0.5743567692,
"author": null,
"avg_line_length": 35.5038167939,
"converted": null,
"ext": "h",
"file": null,
"hexsha": "d9c6b6d0a0ef1923fa425eda5cbc14f36cffcb2f",
"include": null,
"lang": "C",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_cou... |
[STATEMENT]
lemma inline1_in_sub_gpvs:
assumes "Inr (out, callee', rpv') \<in> set_spmf (inline1 callee gpv s)"
and "(x, s') \<in> results_gpv \<I>' (callee' input)"
and "input \<in> responses_\<I> \<I>' out"
and "\<I> \<turnstile>g gpv \<surd>"
shows "rpv' x \<in> sub_gpvs \<I> gpv"
[PROOF STATE]
proof (prov... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "CryptHOL_Generative_Probabilistic_Value",
"hexsha": null,
"include": null,
"lang": null,
"length": 60,
"llama_tokens": 21765,
"mathlib_filename": null,
"max_forks_count": null,
"max... |
abstract type AbstractZXDiagram{T, P} end
Graphs.nv(zxd::AbstractZXDiagram) = throw(MethodError(Graphs.nv, zxd))
Graphs.ne(zxd::AbstractZXDiagram) = throw(MethodError(Graphs.ne, zxd))
Graphs.degree(zxd::AbstractZXDiagram, v) = throw(MethodError(Graphs.degree, (zxd, v)))
Graphs.indegree(zxd::AbstractZXDiagram, v) = thr... | {
"alphanum_fraction": 0.7655867971,
"author": null,
"avg_line_length": 79.8048780488,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "90fa516ac2d097230cf486f2320004bf71c476e4",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
[STATEMENT]
lemma (*equal_union: *)
"(X = Y \<union> Z) = (Y \<subseteq> X \<and> Z \<subseteq> X \<and> (\<forall>V. Y \<subseteq> V \<and> Z \<subseteq> V \<longrightarrow> X \<subseteq> V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (X = Y \<union> Z) = (Y \<subseteq> X \<and> Z \<subseteq> X \<and> (\<fo... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": 94,
"llama_tokens": 15158,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime"... |
import argparse
import copy
import ctgan
import lightgbm as lgbm
import logging
import multiprocessing as mp
import numpy as np
import os
import pandas as pd
import pathlib
import yaml
from contextlib import redirect_stdout, redirect_stderr
from dataclasses import dataclass, field
from itertools import product
from sk... | {
"alphanum_fraction": 0.6790624712,
"author": null,
"avg_line_length": 32.0147710487,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "148768d65adfd791543059fb146f5ce7ad26ff2f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import pandas as pd
import numpy as np
from vincenty import vincenty
from datetime import date, timedelta, datetime
import pytz
import math
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
import boto3
from io import StringIO
def report_generator(aws_acc... | {
"alphanum_fraction": 0.6389282213,
"author": null,
"avg_line_length": 40.9866071429,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "95614ae404aed647f78faafa9f8670db7b30365b",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 Sylko Olzscher
*
*/
#include "test-mbus-001.h"
#include <iostream>
#include <fstream>
#include <boost/test/unit_test.hpp>
#include <smf/mbus/defs.h>
namespace node
{
bool test_mbus_001()
{
// 0x0442
BOOST_CHECK_EQUAL(sml::encode_id("ABB"), 0x0442);
BO... | {
"alphanum_fraction": 0.6641975309,
"author": null,
"avg_line_length": 16.2,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "d2e17f6dd166b256e751c10b2276988369063385",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": ... |
//==============================================================================
// Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI
// Copyright 2012 - 2014 MetaScale SAS
//
// Distributed under the Boost Softw... | {
"alphanum_fraction": 0.5672696439,
"author": null,
"avg_line_length": 39.3111111111,
"converted": null,
"ext": "hpp",
"file": null,
"hexsha": "dc626ef2c30516ed92bfa5f73034c241ea93534d",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
# coding=utf-8
# Copyright 2022 HyperBO Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | {
"alphanum_fraction": 0.6748909282,
"author": null,
"avg_line_length": 35.1693121693,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "6e8156415acfdf49e7609e675c97a2de761d93e0",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import collections
import os
import sys
import random
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as sio
import torch
from PIL import Image, ImageMath
from torch.utils import data
from main import get_data_path
from torchvision.transforms import Compose, Normalize, Resize, ToTensor
sys.path.ap... | {
"alphanum_fraction": 0.5517571746,
"author": null,
"avg_line_length": 39.3876500858,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "a5da45ac0ce5fd4a11d776202e2904f232bf9986",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
import cv2
import math
from .pattern import bit_pattern_31
factorPI = (float)(np.pi/180.)
class OrbExtractor(object):
#ORB检测Oriented FAST关键点时选取的图像块边长,
#即计算质心时选取的图像块区域边长
HALF_PATCH_SIZE = 15
PATCH_SIZE = 31
EDGE_THRESHOLD = 19
W = 30 #grid size, unit pixel
def __init__(self):
self... | {
"alphanum_fraction": 0.6357886146,
"author": null,
"avg_line_length": 37.0352644836,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "9cb329efed7ffb83f2e234056e044cf8613ca68d",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma signed_take_bit_0 [simp]:
\<open>signed_take_bit 0 a = - (a mod 2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. signed_take_bit 0 a = - (a mod (2::'a))
[PROOF STEP]
by (simp add: bit_0 signed_take_bit_def odd_iff_mod_2_eq_one) | {
"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": 119,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime": n... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import unittest
import numpy as np
import bcolz
import h5py
import zarr
import pytest
from allel import GenotypeArray, HaplotypeArray, AlleleCountsArray, VariantTable, \
GenotypeVector, GenotypeAlleleCountsArray, GenotypeAl... | {
"alphanum_fraction": 0.6471825264,
"author": null,
"avg_line_length": 32.2388289676,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "86ee77133371724678d7e634cf3218121c392e42",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import tensorflow
import argparse
import requests
import json
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument(
'--image_path',
type=str,
default='~/Downloads/pic_temp/555.jpg',
help='path of image'
)
parser.add_argument(
'--label_file',
type=str,
default='/tmp/ou... | {
"alphanum_fraction": 0.7324503311,
"author": null,
"avg_line_length": 29.0384615385,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "6d3e8af5fa9219373097430bb9a63ead7fad27fd",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma Nonce_notin_initState [iff]: "Nonce N \<notin> parts (initState B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Nonce N \<notin> parts (initState B)
[PROOF STEP]
by (induct_tac "B", auto) | {
"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": 85,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime": nu... |
//---------------------------------------------------------------------------//
// Copyright (c) 2018-2021 Mikhail Komarov <nemo@nil.foundation>
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), t... | {
"alphanum_fraction": 0.6440473986,
"author": null,
"avg_line_length": 54.5555555556,
"converted": null,
"ext": "hh",
"file": null,
"hexsha": "cde81ef9baf64d5aeec07ae7aa9da215e454753c",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_... |
Require Import Braun.common.braun Braun.common.util Braun.common.same_structure.
Require Import Braun.common.log Braun.common.sequence Braun.common.list_util.
Require Import Braun.monad.monad.
Require Import Program List.
Require Import Omega.
Section foldr.
Variables A B : Set.
Variable P : B -> (list A) -> nat -... | {
"alphanum_fraction": null,
"author": "rfindler",
"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... |
[STATEMENT]
lemma member_le_L2_set: "\<lbrakk>finite A; i \<in> A\<rbrakk> \<Longrightarrow> f i \<le> L2_set f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>finite A; i \<in> A\<rbrakk> \<Longrightarrow> f i \<le> L2_set f A
[PROOF STEP]
unfolding L2_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal)... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": 2,
"llama_tokens": 221,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime": n... |
/////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2007-2013
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://w... | {
"alphanum_fraction": 0.6037651277,
"author": null,
"avg_line_length": 25.3522727273,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "ba65ca9a0c6c0676a894eedd048a9d7bb941bbc4",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
//
// Copyright (w) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/beast
//
#ifndef BOO... | {
"alphanum_fraction": 0.454795022,
"author": null,
"avg_line_length": 21.856,
"converted": null,
"ext": "hpp",
"file": null,
"hexsha": "6dcf05852e022f576da4a4655f65e14ba2e4a64c",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count":... |
import glob
import imageio
import matplotlib.pyplot as plt
from matplotlib.image import imread
import numpy as np
import os
import PIL
from tensorflow.keras import layers
import time
from IPython import display
from PIL import Image, ImageOps
import glob
import numpy as np
IMG_DIR = './data/eyes/'
image_list = []
ima... | {
"alphanum_fraction": 0.7122370937,
"author": null,
"avg_line_length": 22.7391304348,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "560323e25617c3820a1c61573c4f5d6af087df18",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
## Extraction Process
# This data represents 15 minute extracts from https://data.nashville.gov
### Extaction Script
# The script below uses an app_token per https://dev.socrata.com/consumers/getting-started.html. However,
# you can make a certain number of requests without an application token.
import pandas as pd
i... | {
"alphanum_fraction": 0.6752278376,
"author": null,
"avg_line_length": 45.1214953271,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "ff025796a445d794835ed92300fe11b53291c5a6",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
from .._lingspam import fetch_lingspam
from .._lingspam import create_pipelines_lingspam
from sklearn.model_selection import RandomizedSearchCV
from sklearn.model_selection import cross_val_score
import numpy as np
def test_fetch():
"""Test fetching the LingSpam dataset.
"""
try:
df = fetch_lingspa... | {
"alphanum_fraction": 0.6756756757,
"author": null,
"avg_line_length": 31.5185185185,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "b8e9d367c8d9bbdd61324708b49c6f8bc4036b1e",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#%%
import numpy as np
print("Numpy Version is ", np.__version__)
#%%
# Creating 1 dimensional numpy array with Python list (int type)
one_d_list = [1, 2, 3, 4, 5]
array_one_dim_list = np.array(one_d_list)
print("NumPy array: ", array_one_dim_list)
print("Shape: ", array_one_dim_list.shape)
print("Data Type: ", array... | {
"alphanum_fraction": 0.7166755178,
"author": null,
"avg_line_length": 32.747826087,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "2ac3f2b1b63f623e2edd2a08e1b7c84d03dd7a62",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
[STATEMENT]
lemma rk_ext:
assumes "rk X \<le> 3"
shows "\<exists>P. rk(X \<union> {P}) = rk X + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>P. rk (X \<union> {P}) = rk X + 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<exists>P. rk (X \<union> {P}) = rk X + 1
[PROOF STEP... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Projective_Geometry_Matroid_Rank_Properties",
"hexsha": null,
"include": null,
"lang": null,
"length": 23,
"llama_tokens": 3946,
"mathlib_filename": null,
"max_forks_count": null,
"... |
import sys
import os
import itertools
from collections import defaultdict, Counter
import re
import numpy as np
import cvxpy as cp
NUMBERS = '123456789tjqk' # Allowed alternate inputs: a->1, 0->t, 10->t, emoji
SUITS = 'scdh'
CARDS = [
n+s
for n, s in itertools.product(NUMBERS, SUITS)
]
class Solver:
d... | {
"alphanum_fraction": 0.5135774788,
"author": null,
"avg_line_length": 36.2437923251,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "b0e702afcc9e716808c44b671d9d37f2558f79d7",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
#define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// detail/sp_typeinfo.hpp
//
// Copyright 2007 Peter Dimov
//
// Distributed under the Boost Soft... | {
"alphanum_fraction": 0.6408020924,
"author": null,
"avg_line_length": 17.6461538462,
"converted": null,
"ext": "hpp",
"file": null,
"hexsha": "c8db66d14c4ae49a10ba7d811397214c0d8b5f3e",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
"""Per-channel plotting in the 2D processes-boxes space."""
import matplotlib.pyplot as plt
import numpy as np
from ..util import basic_kwargs_check, get_expected_matrix, get_experiment_tag
def _my_format(val):
"""Enforce a format style with 5 digits maximum including the decimal dot."""
if val < 1e2:
... | {
"alphanum_fraction": 0.6202830189,
"author": null,
"avg_line_length": 31.8612716763,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1388d02d85924d75f9f4de2466b7b3e36988fbd9",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2018, Alliance for Sustainable Energy, LLC. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are perm... | {
"alphanum_fraction": 0.7119347665,
"author": null,
"avg_line_length": 20.1343283582,
"converted": null,
"ext": "hpp",
"file": null,
"hexsha": "6139d2488741688d9f49c4e2512d8ca8d52df513",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
```python
# General import
import numpy as np
import scipy.sparse as sparse
from scipy.integrate import ode
import time
import matplotlib.pyplot as plt
```
```python
# pyMPC and kalman import
from pyMPC.mpc import MPCController
from pyMPC.kalman import kalman_design_simple, LinearStateEstimator
```
## System dynamic... | {
"alphanum_fraction": 0.8836688743,
"author": null,
"avg_line_length": 172.6068181818,
"converted": true,
"ext": "ipynb",
"file": null,
"hexsha": "aedf2a233ebf9530189d0c12a9dfe3b0fa522d7b",
"include": null,
"lang": "Jupyter Notebook",
"length": null,
"llama_tokens": null,
"mathlib_filename": nu... |
module DB
using ...DBUtils
using ..Entrez
using SQLite
using MySQL
using DataStreams, DataFrames
using NullableArrays
export init_pubmed_db_mysql,
init_pubmed_db_sqlite,
get_value,
all_pmids,
get_article_mesh,
db_insert!
get_value{T}(val::Nullable{T}) = get(val)
get_value(val)= va... | {
"alphanum_fraction": 0.5884500065,
"author": null,
"avg_line_length": 29.6177606178,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "1f40e29772a7659204726702210b4073d820c5d5",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import numpy as np
from numpy.linalg import lstsq
from scipy.optimize import lsq_linear
from . import moduleFrame
class FitSignals(moduleFrame.Strategy):
def __call__(self, signalVars, knownSpectra):
# rows are additions, columns are contributors
knownMask = ~np.isnan(knownSpectra[:, 0])
... | {
"alphanum_fraction": 0.6898768077,
"author": null,
"avg_line_length": 38.1020408163,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "24ba97b99cd37843fd8b359e53696bd9e75b0abb",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""
NCalculus
Numerical Differentiation and Integration Module.
"""
module NCalculus
const GaussianRoots = [0.5773502692,-0.5773502692,
0.7745966692,0.0,-0.7745966692,
0.8611363116,0.3399810436,-0.3399810436,-0.8611363116,
0.9061798459,0.5384693101,0.0,-0.5384693101,-0.9061798459]
const Ga... | {
"alphanum_fraction": 0.5332202431,
"author": null,
"avg_line_length": 31.0263157895,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "5b90b892bf4204bad7ffee546d68cec06e8aaa6d",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
"""
Scenario reduction algorithm for two-stage stochastic programmings
The fast forward selection algorithm is used.
References:
[1]https://edoc.hu-berlin.de/bitstream/handle/18452/3285/8.pdf?sequence=1
[2]http://ftp.gamsworld.org/presentations/present_IEEE03.pdf
Considering the second stage optimization probl... | {
"alphanum_fraction": 0.5913071683,
"author": null,
"avg_line_length": 37.5975609756,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "0002bfa6f14c133e57f485c1d1e2a95f355a3f54",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
from utils import read_pickle
import numpy as np
import pandas as pd
from library.feature_engineering import encode_source_labels, clean_text_label, create_position_feature, make_c100_features
from utils import duplicates_in_list
from library.make_estimated_conc import (maximum_match_probability, conc_flood_f... | {
"alphanum_fraction": 0.7845759818,
"author": null,
"avg_line_length": 35.4949494949,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "b6c13de481d74048e542fa9c39cafa09d6f2bfb0",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
@doc raw"""CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. Status is represented by the `.status` JSON path inside of a... | {
"alphanum_fraction": 0.8720637584,
"author": null,
"avg_line_length": 76.9032258065,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "e67d63db29058ff9c611af4d0bf71abee90170dd",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
#' Create an SQL tbl (abstract)
#'
#' Generally, you should no longer need to provide a custom `tbl()`
#' method you you can default `tbl.DBIConnect` method.
#'
#' @keywords internal
#' @export
#' @param subclass name of subclass
#' @param ... needed for agreement with generic. Not otherwise used.
#' @param vars DEPREC... | {
"alphanum_fraction": 0.5793397231,
"author": null,
"avg_line_length": 28.1267281106,
"converted": null,
"ext": "r",
"file": null,
"hexsha": "b659933c5fc789264f2ac6dda0507e57912fee47",
"include": null,
"lang": "R",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_cou... |
import numpy as np
from .base import LightningModuleBase
class LightningModuleSpecMixUp(LightningModuleBase):
def training_step(self, batch, batch_nb):
x, y = batch["x"], batch["y"]
aux_x = {k: v for k, v in batch.items() if (k != "x") and (k[0] == "x")}
aux_y = {k: v for k, v in batch.it... | {
"alphanum_fraction": 0.5386533666,
"author": null,
"avg_line_length": 35.3823529412,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "77e996c05a432a276f21abeb1663245a4a622de5",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.