text stringlengths 0 27.1M | meta dict |
|---|---|
function LinearGaussian(μ::Float64, σ::Float64)
α = 5.0
x = rand(:x, Normal(μ, σ))
y = rand(:y, Normal(α * x, 1.0))
z = rand(:z, Normal(y, 5.0))
return z
end
function LinearGaussianProposal()
α = 10.0
x = rand(:x, Normal(α * 3.0, 3.0))
y = rand(:y, Normal(0.0, 1.0))
end
function OneSit... | {
"alphanum_fraction": 0.5723124517,
"author": null,
"avg_line_length": 28.1086956522,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "9ccc288c59090affa108a8960b0cac72f772f0cc",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
!========================================================================
!
! S P E C F E M 2 D Version 7 . 0
! --------------------------------
!
! Main historical authors: Dimitri Komatitsch and Jeroen Tromp
! Princeton University, USA
! ... | {
"alphanum_fraction": 0.6778028593,
"author": null,
"avg_line_length": 37.1229050279,
"converted": null,
"ext": "f90",
"file": null,
"hexsha": "e1f9ee04349b245ab3e4a9288272793bd7e0b9e2",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_f... |
import numpy as np
import util
import sys
from random import random
sys.path.append('../linearclass')
### NOTE : You need to complete logreg implementation first!
from logreg import LogisticRegression
# Character to replace with sub-problem letter in plot_path/save_path
WILDCARD = 'X'
# Ratio of class 0 to class 1
... | {
"alphanum_fraction": 0.6945812808,
"author": null,
"avg_line_length": 38.3444444444,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "96ad20fe411e2ec5b26c783d343b11752159a9a0",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# --------------------------------------------------------------------------
# Copyright (c) <2017> <Lionel Garcia>
# BE-BI-PM, CERN (European Organization for Nuclear Research)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files ... | {
"alphanum_fraction": 0.6116058323,
"author": null,
"avg_line_length": 37.0253623188,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "034d5a85f7779070a68c85c9c4325d91342a362b",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma dual_assume: "[\<cdot>p] ^ o = {\<cdot>p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. [\<cdot> p ] ^ o = {\<cdot> p }
[PROOF STEP]
by (simp add: assume_def) | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "MonoBoolTranAlgebra_Statements",
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 83,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_f... |
.ds TL "Running Networking"
.ds TI COHULIP
.NH "Running net"
.PP
The command
.B net
is the part of
.B cohulip
that actually performs the networking tasks.
.B net
executes all networking tasks that a true networking package would
implement as separate executable commands.
.PP
You should read this chapter carefully to se... | {
"alphanum_fraction": 0.7578382765,
"author": null,
"avg_line_length": 27.823760432,
"converted": null,
"ext": "r",
"file": null,
"hexsha": "38cab168ee5efdd9d0bd1f83deadb3e8012313ea",
"include": null,
"lang": "R",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_coun... |
# %%
from IPython import get_ipython
from IPython.core.display import display
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
get_ipython().run_line_magic('run', 'setup')
# %% leeftijdsgroepen: download RIVM data
#leeftijdsgroepen = SimpleNamespace()
@run
def cell... | {
"alphanum_fraction": 0.6702831724,
"author": null,
"avg_line_length": 40.1612200436,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1653176a0fffc0cff571fad24d4e9075da892233",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import collections
import copy
import enum
import json
import numpy as np
# module for all things related to labels, IWP or otherwise.
#
# Documentation on Scalabel image list labels:
#
# https://doc.scalabel.ai/format.html
#
# enumeration of merge strategies for combining multiple IWP labels:
#
# union - ... | {
"alphanum_fraction": 0.6295262337,
"author": null,
"avg_line_length": 37.8818040435,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "88d29ab4b9c7f000aa5e148c9bf7abb82f0ecfb4",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import sys
sys.path.append('/home/myja3483/isce_tools/ISCE')
import os
import numpy
import tops
import re
path = '/net/tiampostorage/volume1/MyleneShare/Bigsur_desc/az1rng2'
dir_list = os.listdir(path)
regex = re.compile(r'\d{8}_\d{8}')
pair_dirs = [os.path.join(path, d) for d in list(filter(regex.search, dir_list))]
... | {
"alphanum_fraction": 0.6878612717,
"author": null,
"avg_line_length": 27.68,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "61c950d0e46112ad3e2a751a9bd4f9a1f5cbdb81",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Copyright (c) 2013-present SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import pathlib
import numpy as np
import pandas as pd
import zipfile
from . import darwincore_... | {
"alphanum_fraction": 0.6174427464,
"author": null,
"avg_line_length": 50.7113636364,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "2605a5078adcf5002a38db6f39d2ff3796203017",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma le_multiset_empty_right[simp]: "\<not> M < {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<not> M < {#}
[PROOF STEP]
using subset_mset.le_zero_eq less_multiset_def multp_def less_multiset\<^sub>D\<^sub>M
[PROOF STATE]
proof (prove)
using this:
(?n \<subseteq># {#}) = (?n = {#})
(?M < ?N) = mu... | {
"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": 296,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime": n... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 18:57:40 2020
@author: Hassan
"""
import scipy.stats as st
print(st.bernoulli.pmf(1, .5))
print(st.bernoulli.pmf(0, .5))
import numpy as np
params = np.linspace(0, 1, 100)
import matplotlib.pyplot as plt
import numpy as np
plt.xlabel('x: height [... | {
"alphanum_fraction": 0.6373626374,
"author": null,
"avg_line_length": 18.8275862069,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1924d0d97981211694257266abf6372b53614bbf",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | {
"alphanum_fraction": 0.5831833376,
"author": null,
"avg_line_length": 43.6966292135,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "7cab0e4d43e30c3a5ce114120340d48a9039acae",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#pragma once
#include <functional> //hash
#include <boost/dynamic_bitset.hpp>
#include "sdd/values/flat_set.hh"
#include "mc/units/exceptions.hh"
namespace caesar { namespace mc { namespace units {
/*------------------------------------------------------------------------------------------------*/
class post
{
p... | {
"alphanum_fraction": 0.5125430398,
"author": null,
"avg_line_length": 21.2879581152,
"converted": null,
"ext": "hh",
"file": null,
"hexsha": "3b005bebd0d7926c02ca6bde4bc08a9d78dab4ed",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_... |
import acl
import numpy as np
import datetime
from atlas_utils.utils import *
from atlas_utils.acl_image import AclImage
class Model(object):
def __init__(self, acl_resource, model_path):
self._run_mode = acl_resource.run_mode
self.model_path = model_path # string
self.model_id = None ... | {
"alphanum_fraction": 0.5970951222,
"author": null,
"avg_line_length": 45.1174242424,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "f45b4075d08bab7be3cabc9826ef3e5b64e00974",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma iTILL_sub: "k \<ominus> [\<dots>n] = (if n \<le> k then [k - n\<dots>,n] else [\<dots>k])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. k \<ominus> [\<dots>n] = (if n \<le> k then [k - n\<dots>,n] else [\<dots>k])
[PROOF STEP]
by (force simp add: set_eq_iff iT_Minus_mem_iff iT_iff) | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Nat-Interval-Logic_IL_IntervalOperators",
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 144,
"mathlib_filename": null,
"max_forks_count": null,
"max_fo... |
import numpy as np
import matplotlib.pyplot as plt
from kf_v4 import f
from simulated_observation import ls_of_observations_v4, real_state_v4
plt.ion()
plt.figure()
# assume the pic is 300 in x-length, and 200 in y-height
real_state = real_state_v4
f.x = ls_of_observations_v4[0]
NUMSTEPS = 10 # number of loops to... | {
"alphanum_fraction": 0.6680045872,
"author": null,
"avg_line_length": 20.7619047619,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "fe0d173c218999441c2b340ed453016264e9c4ea",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
using BenchmarkTools
using SequentialRaytrace
import SequentialRaytrace: gen_result, update_result!
using TimerOutputs
using StaticArrays
# 12.881 us AbstractVector
# 12.796 us Vector
# 1.74 SVector OpticalComponent
function testlens()
Lens("", Object(Air, 200.0),
SVector(
# [
Optical... | {
"alphanum_fraction": 0.5287713841,
"author": null,
"avg_line_length": 28.8693877551,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "a89dc191816245911971adc90092e554c8703c93",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
function create_grid(mesh::RawMesh, format, user_elements)
dim = getdim(mesh)
cells = create_cells(getelementsdicts(mesh), user_elements, format)
nodes = create_nodes(getnodes(mesh), Val(dim))
cellsets = create_cellsets(getelementsdicts(mesh), getelementsets(mesh))
nodesets = create_nodesets(getnode... | {
"alphanum_fraction": 0.7123627347,
"author": null,
"avg_line_length": 42.1343283582,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "330bc82d08cc43c949af28f98c9543f8cb6a252e",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
from datetime import datetime, timedelta
import pandas as pd
import numpy as np
from scipy.interpolate import interp1d
from pyseir import load_data
from pyseir.inference.infer_t0 import infer_t0
from pyseir.inference import fit_results
# Fig 4 of Imperial college.
# https://www.imperial.ac.uk/media/imperial-college/m... | {
"alphanum_fraction": 0.6217107349,
"author": null,
"avg_line_length": 37.2836879433,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "5d8df18b43d52cb4043b32f6c4a7fc86c401bbbb",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
import datetime
import numpy as np
import pandas as pd
import tensorflow as tf
from matplotlib import pyplot as plt
import dnn_model
sys.path.append("/home/scw4750/Documents... | {
"alphanum_fraction": 0.6629549158,
"author": null,
"avg_line_length": 30.9411764706,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "5143bccde9467fadd532175526f496923760a9e1",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
/*
Copyright (c) 2015, Matthew H. Reilly (kb1vc)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright
notice, this list of conditi... | {
"alphanum_fraction": 0.6389293518,
"author": null,
"avg_line_length": 34.7594936709,
"converted": null,
"ext": "cxx",
"file": null,
"hexsha": "dc89289f0273c6e9a3e600813fa254667f825fee",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
function weighted_moment_distance(wm::BlockBootstrapWeightMatrix, sims)
observed_moments = select_moments(wm.obs)
n_replications = size(sims, 2)
G = zeros(n_replications, 5)
sim_moments_matrix = get_summary_stats(sims, wm.obs)
G = sim_moments_matrix - repeat(observed_moments', n_replications, 1)
... | {
"alphanum_fraction": 0.7135416667,
"author": null,
"avg_line_length": 32,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "53dac77296416b87adc062c256ae43a995055540",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count": n... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .build import SSHEAD_REGISTRY
from .ss_layers import Bottleneck, conv1x1, conv3x3
from ..utils.image_list import ImageList, crop_tensor
class RotationHead(nn.Module):
def __init__(self, cfg, cin):
super(RotationHea... | {
"alphanum_fraction": 0.5903660886,
"author": null,
"avg_line_length": 37.8832116788,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "4c4d033b493d39987fa1685724a30b0e523ca7da",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
import collections
import numpy as np
import os, shutil
class Dictionary:
def __init__(self, fpath=None, msg=True):
self.fpath = fpath
self.size = 0
self.name = ''
self.word = []
self.weight = []
self.wLen = []
self.removedWords = []
if fpa... | {
"alphanum_fraction": 0.5092361458,
"author": null,
"avg_line_length": 32.3064516129,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "d8a704c701d29c934744f630601c77b0ec6eaae7",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
import time
import torch
import argparse
import numpy as np
from inference import infer
from utils.util import mode
from hparams import hparams as hps
from torch.utils.data import DataLoader
from utils.logger import Tacotron2Logger
from utils.dataset import ljdataset, ljcollate
from model.model import Tacotro... | {
"alphanum_fraction": 0.7134205093,
"author": null,
"avg_line_length": 32.0044052863,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "2a1261ae0c3420f861047c56ccb10801fdf70e2d",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma simple_distributed_measure:
"simple_distributed M X P \<Longrightarrow> a \<in> X`space M \<Longrightarrow> P a = measure M (X -` {a} \<inter> space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>simple_distributed M X P; a \<in> X ` space M\<rbrakk> \<Longrightarrow> P a = Sigma_Alg... | {
"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": 349,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime": n... |
"""
Script to launch experiments with a dimension reduction
See parse_arguments() function for details on arguments
Based on implementation in https://github.com/rymc/n2d
and article:
McConville, R., Santos-Rodriguez, R., Piechocki, R. J., & Craddock, I. (2019).
N2d:(not too) deep clustering via clustering the local m... | {
"alphanum_fraction": 0.6036193349,
"author": null,
"avg_line_length": 46.1501831502,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "bb1ed9c12adef39cf535a9bc1bcf338b4459e1de",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#include "email.hpp"
#include <boost/asio.hpp>
#include <iostream>
#include <array>
#include "mybio.hpp"
#include <functional>
void add_r_n(char *str, size_t &len) {
str[len] = '\r';
str[len + 1] = '\n';
str[len += 2] = '\0';
}
Email::Email() {
}
Email::~Email() {
}
Email &Email::setToEmailAddress(const... | {
"alphanum_fraction": 0.5460739779,
"author": null,
"avg_line_length": 28.537037037,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "4f4724a1e4c44e127bec7d7edd2d941d0c25f044",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_... |
Require Export message.
Require Import Coq.QArith.QArith.
Require Import Coq.QArith.Qabs.
Require Import Coq.QArith.QOrderedType.
Require Import Psatz.
Record SendEvtInfo := mkSendEvtInfo {
(**
Currently, every send event is in response to a received message.
As a response to every received message, a list message... | {
"alphanum_fraction": null,
"author": "aa755",
"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_datet... |
import torch.utils.data as tordata
import numpy as np
import os.path as osp
import os
import pickle
import cv2
import xarray as xr
import pandas as pd
class SilhouetteDataSet(tordata.Dataset):
def __init__(self, seq_dir, vID, label, config):
self.seq_dir = seq_dir
print("the dataset nam... | {
"alphanum_fraction": 0.5715517241,
"author": null,
"avg_line_length": 37.0212765957,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "debc93a3aed44e4ca1f523728f00e27a5e110593",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# Hello, world!
This is our hello world notebook!
```
print("Hello world!")
```
Hello world!
Here we continue with some formula
\begin{align}
f(x) = \sin(\pi x),
\end{align}
which we would like to plot
```
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
```
... | {
"alphanum_fraction": 0.8758865248,
"author": null,
"avg_line_length": 135.125,
"converted": true,
"ext": "ipynb",
"file": null,
"hexsha": "5386663dd01c8ee03107f37958a7d9e3639d9582",
"include": null,
"lang": "Jupyter Notebook",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"... |
from __future__ import absolute_import, division, print_function
import numpy as np
from .hashfunctions import generate_hashfunctions
from .maintenance import maintenance
class CountdownBloomFilter(object):
""" Implementation of a Modified Countdown Bloom Filter. Uses a batched maintenance process instead of a ... | {
"alphanum_fraction": 0.6497053045,
"author": null,
"avg_line_length": 41.3821138211,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1907b85571a4a0ee43c72cb5d6135d6f8a5170dd",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
import numpy as np
import xlsxwriter
from skimage import img_as_ubyte
from skimage.color import label2rgb
from skimage.io import imsave
from sklearn.metrics import normalized_mutual_info_score, adjusted_rand_score
from python_research.experiments.unsupervised_segmentation.pipeline import MetricsEnum
def s... | {
"alphanum_fraction": 0.6981740064,
"author": null,
"avg_line_length": 36.5098039216,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "0fd56cdff5c32ee2ab7315740c82d42163aa1a21",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
/-
Copyright (c) 2020 The Xena project. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Kevin Buzzard
Thanks: Imperial College London, leanprover-community
The complex numbers, modelled as R^2 in the obvious way.
-/
import complex.basic -- tutorial level
/-!
# Level 1... | {
"alphanum_fraction": null,
"author": "ImperialCollegeLondon",
"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... |
from SwarmAnalyticsUtility.SocketIOClient import SocketIOClient
from SwarmAnalyticsUtility.MessageInterface.MessageInterface import MessageInterface
from SwarmAnalyticsUtility.MessageInterface.MessageList import MessageList
from uuid import uuid4
import numpy as np
from SwarmAnalyticsUtility.MessageInterface.Enums imp... | {
"alphanum_fraction": 0.6472940168,
"author": null,
"avg_line_length": 40.2471264368,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "971ac8a59726d9f79c975364301d7dcfa274616f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#include "irods/rodsDef.h"
#include "irods/authenticate.h"
#include "irods/rodsQuota.h"
#include "irods/msParam.h"
#include "irods/rcConnect.h"
#include "irods/icatStructs.hpp"
#include "irods/icatHighLevelRoutines.hpp"
#include "irods/private/mid_level.hpp"
#include "irods/private/low_level.hpp"
#include "irods/irods_... | {
"alphanum_fraction": 0.5567709319,
"author": null,
"avg_line_length": 35.4776520238,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "a3c5341812db5a33e68ca0ebedb8396e83f4f339",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
axiom Person : Type
axioms (Nice: Person → Prop) (Old : Person → Prop)
example : (∃ (p : Person), Nice p ∨ Old p) →
(∃ (p : Person), Nice p) ∨
(∃ (p : Person), Old p) :=
λ pno,
match pno with
| exists.intro fred pf_fred_either_nice_or_old :=
match pf_fred_either_nice_or_o... | {
"alphanum_fraction": null,
"author": "kevinsullivan",
"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_m... |
[STATEMENT]
lemma has_sum_mono2:
fixes f :: "'a \<Rightarrow> 'b::{topological_ab_group_add, ordered_comm_monoid_add,linorder_topology}"
assumes "has_sum f A S" "has_sum f B S'" "A \<subseteq> B"
assumes "\<And>x. x \<in> B - A \<Longrightarrow> f x \<ge> 0"
shows "S \<le> S'"
[PROOF STATE]
proof (prove)
goal... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": null,
"hexsha": null,
"include": null,
"lang": null,
"length": 8,
"llama_tokens": 620,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime": n... |
#include <boost/test/unit_test.hpp>
#include <debug_enum_name.h>
#include <iostream>
#include <fstream>
#include <vector>
BOOST_AUTO_TEST_CASE(test_debug_enum_name) {
// this test is meaningful only for languages that have --debug
// and do not save enum type info
}
| {
"alphanum_fraction": 0.7410071942,
"author": null,
"avg_line_length": 21.3846153846,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "347c9be5b63203c7714e8fd5cca792376cc22149",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
/**
** Isaac Genome Alignment Software
** Copyright (c) 2010-2017 Illumina, Inc.
** All rights reserved.
**
** This software is provided under the terms and conditions of the
** GNU GENERAL PUBLIC LICENSE Version 3
**
** You should have received a copy of the GNU GENERAL PUBLIC LICENSE Version 3
** along with ... | {
"alphanum_fraction": 0.7277701778,
"author": null,
"avg_line_length": 32.7313432836,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "add81314aab08fa99a87d7d4472720859dc8a24e",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
from rlkit.envs.wrappers import StackObservationEnv, RewardWrapperEnv
import rlkit.torch.pytorch_util as ptu
from rlkit.samplers.data_collector.step_collector import MdpStepCollector
from rlkit.samplers.data_collector.path_collector import GoalConditionedPathCollector
from rlkit.torch.networks import ConcatMlp
from rlk... | {
"alphanum_fraction": 0.6794217281,
"author": null,
"avg_line_length": 35.6445578231,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "d8d117c8f9aaeb3222e5c0c984117915ee1dbce4",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import time
#from multiprocessing import Pool
#from multiprocessing import freeze_support
from threading import Thread
import numpy as np
import random
import win32gui, win32con
CONFIGFILE = '.\lwp.conf'
class DriftWords:
def __init__(self):
self.Words = []
self.Coors = []
self... | {
"alphanum_fraction": 0.5523358014,
"author": null,
"avg_line_length": 45.8997555012,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1c18e89465027924c8c964c4b4930e4e7078c5ae",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
from visualservoing.policy_base import Policy
from visualservoing.memory import MemoryFactory
from random_policy import OrnsteinUhlenbeckActionNoise
from sklearn.neighbors import KDTree
import time
class DataSelector:
def __init__(self, eps=None, k=None):
eps_or_k = (eps is not None o... | {
"alphanum_fraction": 0.547927177,
"author": null,
"avg_line_length": 34.5378787879,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "5e6f285bf165f80cd1eee413cf1765753b9594ab",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SCICO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
r"""
CT with Preconditioned Conjugate Gradient
=========================================
This example demonstrates ... | {
"alphanum_fraction": 0.6836836837,
"author": null,
"avg_line_length": 27.9440559441,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "e69b92d27e7601bf41320cdb3230df280ca7d8ec",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import Data.Vect
myReverse : Vect n elem -> Vect n elem
myReverse [] = []
myReverse {n = S k} (x :: xs) = reverseProof x xs (myReverse xs ++ [x])
where
reverseProof : Vect (k + 1) elem -> Vect (S k) elem
reverseProof {k} result = rewrite (plusCommutative 1 k) in result
| {
"alphanum_fraction": 0.640569395,
"author": null,
"avg_line_length": 31.2222222222,
"converted": null,
"ext": "idr",
"file": null,
"hexsha": "c64f6c4f4277266e0e16b72203ebbad4e470709e",
"include": null,
"lang": "Idris",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
class MF:
'''
Class for Matrix Factorization
A randomized iterative matrix factorization algorithm for matrix equations
of the form AS = X, where X is the data matrix and A, S are the factor matrices solved for.
Parameters:
------... | {
"alphanum_fraction": 0.4772961333,
"author": null,
"avg_line_length": 38.0106761566,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "9764b92d0cd6223ec2d68bf208596423d0ef872a",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
# --------------------------------------------------------
# Tensorflow VCL
# Licensed under The MIT License [see LICENSE for details]
# Written by Zhi Hou
# ---------
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import _init_paths
from ult.ult... | {
"alphanum_fraction": 0.6056595162,
"author": null,
"avg_line_length": 31.9854014599,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "a3aaca85c921760c42156287176fc438d5275ff3",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from keras import backend as K
from keras.applications import vgg19
from keras.applications import imagenet_utils
from keras.preprocessing.image import load_img, img_to_array
from time import time
from tqdm import tqdm
from s... | {
"alphanum_fraction": 0.6727351539,
"author": null,
"avg_line_length": 29.2025316456,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "821ea5cae0d478cb0e1c755e7507081f9a50f6d2",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import displayarray.frame.np_to_opencv as npcv
import numpy as np
import pytest
import cv2
def test_init():
npcv.NpCam(np.zeros((10, 10)))
with pytest.raises(AssertionError):
npcv.NpCam("Not a numpy array")
def test_open():
cam = npcv.NpCam(np.zeros((10, 10)))
assert cam.isOpened() is True
... | {
"alphanum_fraction": 0.6553067186,
"author": null,
"avg_line_length": 23.8837209302,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "06072e8117253f0d991cf4c1b2ec034e618bd618",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
def plot_loss(history):
plt.plot(history.history['loss'], label='loss')
plt.plot(history.history['val_loss'], label='val_loss')
plt.xlabel('Epoch')
p... | {
"alphanum_fraction": 0.7178631052,
"author": null,
"avg_line_length": 27.5402298851,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "47cce726bfa8c2ca9c93e2d7524a93091fede9ae",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""
Example of training a bunch of models in parallel
http://airflow.readthedocs.org/en/latest/tutorial.html
"""
from datetime import datetime, timedelta
import numpy as np
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.contrib.operators.ecs_operator import ECSOperator
N... | {
"alphanum_fraction": 0.6609970674,
"author": null,
"avg_line_length": 27.5,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "e09020bf0ddd9b952d8e0f2a73f90ed141b79030",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_count"... |
/* =========================================================================
Copyright (c) 2010-2012, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
... | {
"alphanum_fraction": 0.5299937547,
"author": null,
"avg_line_length": 33.3585526316,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "4fa9a54242990d8558c358300b969a4fd4403da6",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import scipy.stats as st
from scipy.spatial.distance import cdist
import sklearn as sk
from sklearn.svm import LinearSVC
from sklearn.linear_model import LogisticRegression, LinearRegression
from sklearn.model_selection import cross_val_predict
... | {
"alphanum_fraction": 0.5296616376,
"author": null,
"avg_line_length": 31.1025056948,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "91bccf578aae46375c0d7d8588d7c5bb37aa7289",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
using Plasma
TD = 30000 # eV
Te = 10000 # eV
D = species.D
e = species.e
D_D = Distribution(Maxwellian(TD, D.m), D)
D_e = Distribution(Maxwellian(Te, e.m), e)
G = Geometry()
plasma = ElectrostaticPlasma([D_D, D_e], G)
sol = Plasma.solve(plasma, dim=1, GPU=false)
Plasma.plot(sol)
## 2D with custom P and speci... | {
"alphanum_fraction": 0.6748046875,
"author": null,
"avg_line_length": 16.5161290323,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "11ba2768e571532dd432ae78af113c8de3c656c2",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
[STATEMENT]
lemma sums_mult_D: "(\<lambda>n. c * f n) sums a \<Longrightarrow> c \<noteq> 0 \<Longrightarrow> f sums (a/c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>(\<lambda>n. c * f n) sums a; c \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> f sums (a / c)
[PROOF STEP]
using sums_mult_iff
[PROOF STATE]... | {
"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": 257,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_event_max_datetime": n... |
#!/usr/bin/env python
import sncosmo
import numpy as np
import scipy
import sources
import astropy.modeling
import astropy.cosmology
"""
Introduce Galaxy and Universe classes that may exist elsewhere
already but are included here for the demonstration of the
proposed usage. Note that the galaxy and universe are re... | {
"alphanum_fraction": 0.6643816053,
"author": null,
"avg_line_length": 41.8029850746,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "916d37bfa7b944aafa57786e582318012cb50582",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
module MaxHelpingHandRainbowSpinnerColorAreaController
using ..Ahorn, Maple
@mapdef Entity "MaxHelpingHand/RainbowSpinnerColorAreaController" RainbowSpinnerColorAreaController(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight,
colors::String="89E5AE,88E0E0,8... | {
"alphanum_fraction": 0.767594108,
"author": null,
"avg_line_length": 43.6428571429,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "531e61b5dce4fe1caa39df2050b6475226ae5465",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
"""
by: noOne
date: 211027
copied from a notebook written by 'ilovescience'
which can be found at https://www.kaggle.com/tanlikesmath/petfinder-pawpularity-eda-fastai-starter
"""
import numpy as np
import pandas as pd
import sys
from timm import create_model
from fastai.vision.all import *
import matplotlib.pyplot as ... | {
"alphanum_fraction": 0.7592982456,
"author": null,
"avg_line_length": 33.9285714286,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "2ea81360a5202234c3fe89708cac3bda1c585e9f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
/* Copyright (c) 2010-2019, Delft University of Technology
* All rigths reserved
*
* This file is part of the Tudat. Redistribution and use in source and
* binary forms, with or without modification, are permitted exclusively
* under the terms of the Modified BSD license. You should have received
*... | {
"alphanum_fraction": 0.6609186968,
"author": null,
"avg_line_length": 46.8316151203,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "ece06c085da776df3c5fbad8d8018e2a2059e0f7",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
# Vehicle designs for different time frames
import os
import sys
sys.path.append(os.path.abspath(os.path.dirname(__file__) + "/../../models"))
import numpy as np
from gpkit import Model, ureg
from copy import deepcopy
from collections import OrderedDict
from matplotlib import pyplot as plt
from aircraft_models impor... | {
"alphanum_fraction": 0.6161119274,
"author": null,
"avg_line_length": 31.306,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "b02000cc5b16aaa2631dea381e5d8843feeef4f5",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_coun... |
program a
implicit none
integer :: y4d3, y2d3
y4d3 = 2015294 ! October 21, 2015
y2d3 = yyyyddd2yyddd(y4d3)
print '(i5)', y2d3
contains
elemental integer function yyyyddd2yyddd(y4d3) result(yyddd)
integer, intent(in) :: y4d3
integer :: year4, year2, doy
doy2 = modulo(y4d3, 1000)
year4 = (y4d3 - doy) / 1000
ye... | {
"alphanum_fraction": 0.7118644068,
"author": null,
"avg_line_length": 14.2413793103,
"converted": null,
"ext": "f90",
"file": null,
"hexsha": "686f79e767ef3b7b990ff15446a29efaba160d06",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_f... |
"""
2022-04-18 14:53:32
"""
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
import numpy as np
import os
import datetime
class C... | {
"alphanum_fraction": 0.6387347392,
"author": null,
"avg_line_length": 35.3333333333,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "7407c51628441f064b247e2f0c5e878a2183bacf",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
using ModelingToolkit
using Test
@Param t
@Unknown x(t)
@Unknown y(t)
@Unknown z(t)
x1 = Unknown(:x ,dependents = [t])
y1 = Unknown(:y ,dependents = [t])
z1 = Unknown(:z ,dependents = [t])
@test x1 == x
@test y1 == y
@test z1 == z
@test convert(Expr, x) == :x
@test convert(Expr, y) == :y
@test convert(Expr, z) == :z
... | {
"alphanum_fraction": 0.591152815,
"author": null,
"avg_line_length": 17.7619047619,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "c58f734d0fbe841fee1331d354f0bee607b09dee",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
SUBROUTINE HUEANG (R,G,B, ANG, DIST)
C This program calculates a characteristic angle for a hue from the
C RGB color cube. It does so by rotating the cube 45 deg around the
C y-axis and atan(sqrt(2)) around the z-axis (assuming xyz = RGB).
C This lines up the black-white cube diagonal (0,0,0 to 1,1,1) along... | {
"alphanum_fraction": 0.6302681992,
"author": null,
"avg_line_length": 33.3191489362,
"converted": null,
"ext": "f",
"file": null,
"hexsha": "ebde48c65e9cb0a5725f8a268ee414373c0515aa",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
//
// Created by arssivka on 11/23/15.
//
#include <rd/hardware/Robot.h>
#include <alcommon/albrokermanager.h>
#include <boost/property_tree/json_parser.hpp>
using namespace AL;
using namespace boost;
using namespace std;
using namespace rd;
Robot::Robot(const std::string& name, const std::string& ip, unsigned int p... | {
"alphanum_fraction": 0.4628540887,
"author": null,
"avg_line_length": 33.1150442478,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "e43cdf15c84fd1fc3f5c6934441a986e9babd223",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
Require Import LayerDeps.
Require Import Ident.
Require Import RData.
Require Import EventReplay.
Require Import MoverTypes.
Require Import Constants.
Require Import CommonLib.
Require Import AbsAccessor.Spec.
Require Import BaremoreHandler.Spec.
Require Import RmiSMC.Spec.
Require Import CtxtSwitch.Spec.
Require Impor... | {
"alphanum_fraction": null,
"author": "columbia",
"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... |
function [stat, cfg] = statistics_wrapper(cfg, varargin)
% STATISTICS_WRAPPER performs the selection of the biological data for
% timelock, frequency or source data and sets up the design vector or
% matrix.
%
% The specific configuration options for selecting timelock, frequency
% of source data are described in FT_T... | {
"alphanum_fraction": null,
"author": "spm",
"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_datetim... |
# SPDX-FileCopyrightText: 2021 Lukas Schrangl <lukas.schrangl@tuwien.ac.at>
#
# SPDX-License-Identifier: BSD-3-Clause
import argparse
import contextlib
import enum
from pathlib import Path
import re
import sys
import warnings
from PyQt5 import QtCore, QtQml, QtQuick, QtWidgets
import numpy as np
import pandas as pd
f... | {
"alphanum_fraction": 0.5426352629,
"author": null,
"avg_line_length": 37.4961685824,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "7ad552629220c1361e0414994eede37a03096b0b",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
%% Example
% An example script, it is used to show how to use the arcs
% functions of the KUKA iiwa matlab toolbox
% First start the server on the KUKA iiwa controller
% Then run the following script in Matlab
% Note you have 60 seconds to connect to server after starting the
% application (MatlabToolboxServer) from t... | {
"alphanum_fraction": null,
"author": "Modi1987",
"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... |
\documentclass[../ewet_cwc_report.tex]{subfiles}
\begin{document}
\section{Electrical Design and Controls}
\subsection{Introduction}
\noindent
In the small-scale turbine design, it is critical to identify
the type of the generator that would be used through the
design process because mechanical designs and modeling... | {
"alphanum_fraction": 0.7823741977,
"author": null,
"avg_line_length": 43.8321513002,
"converted": null,
"ext": "tex",
"file": null,
"hexsha": "39266dab26be02e502b514c00a6c48afd1ceb628",
"include": null,
"lang": "TeX",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
type _TreeState
leaveIx::Int
innerIx::Int
end
# a,b is the span of the subtree
# terminates when a == b
function construct_tree(parents::Vector{Int}, a::Int, b::Int)
function _construct_tree(parents, a, b, state::_TreeState)
#println("Split $a and $b with state $state")
if a == b then
... | {
"alphanum_fraction": 0.6520874751,
"author": null,
"avg_line_length": 26.4736842105,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "d3e034710e79d5cda50cf752aa7a3bc065ddedd3",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
"""
Created: May 2018
@author: JerryX
Find more : https://www.zhihu.com/people/xu-jerry-82
"""
import numpy as np
import time
import numba
import logging.config
import sys
import os
curPath = os.path.abspath(os.path.dirname(__file__))
sys.path.append(curPath)
from xDLUtils import Tools
# create logg... | {
"alphanum_fraction": 0.5634040081,
"author": null,
"avg_line_length": 41.0859188544,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "f69a0ae1625f0cccc16a6c38a89a6b8320f6ed15",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
from __future__ import division
import math
import numpy as np
from mlfromscratch.utils import accuracy_score
from mlfromscratch.deep_learning.activation_functions import Sigmoid
class Loss(object):
def loss(self, y_true, y_pred):
return NotImplementedError()
def gradient(self, y, y_pred):
ra... | {
"alphanum_fraction": 0.5803298717,
"author": null,
"avg_line_length": 30.8867924528,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "57f952214dd27c052025c7638cb0a12c3bd19860",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merg... | {
"alphanum_fraction": 0.6373181341,
"author": null,
"avg_line_length": 43.2922077922,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1a99874718e166ff8a90d8a9ae7cc2d62d45ee11",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
-- Imagen_inversa_de_la_union.lean
-- Imagen inversa de la unión
-- José A. Alonso Jiménez
-- Sevilla, 14 de junio de 2021
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Demostrar que
-- f ⁻¹' (u ∪ v) = f ⁻¹' u ∪ f... | {
"alphanum_fraction": null,
"author": "jaalonso",
"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... |
#! /usr/bin/env python
# Colm Coughlan 20.11.2015
# Dublin Institute for Advanced Studies
'''
L1551 IRS 5 field at 610 MHz
T Tau field
DG Tau field
'''
import numpy as np
import pandas as pd
import argparse
import matplotlib.pyplot as plt
import scipy.stats
myfontsize = 15
plt.rcParams.update({'font.size': myfontsi... | {
"alphanum_fraction": 0.6823116642,
"author": null,
"avg_line_length": 36.4879227053,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "f5e3051d3c36a1b057d74e4d6cfa8d6e19133ad4",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
using JuMP, EAGO
m = Model()
EAGO.register_eago_operators!(m)
@variable(m, -1 <= x[i=1:2] <= 1)
@variable(m, -3.892086739821988 <= q <= 1.133112254487742)
add_NL_constraint(m, :(log(1 + exp(-0.9215225812660202 ... | {
"alphanum_fraction": 0.5531453362,
"author": null,
"avg_line_length": 54.2352941176,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "d362f3bdc727573477f09f71e504eec49517bf76",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import av
from io import BytesIO
import numpy as np
import base64
from IPython.display import display, HTML
from pathlib import Path
from multiprocessing import cpu_count
import matplotlib.pyplot as plt
from tqdm.auto import tqdm
from .parallel import parallel
import logging
import time
import multiprocessing
from matp... | {
"alphanum_fraction": 0.608558262,
"author": null,
"avg_line_length": 33.90625,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "383ba6f385fcd9465a459cffab314fbed9fbca62",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_cou... |
"""Unit tests for Fourier transform processors
"""
import logging
import unittest
import numpy
from astropy import units as u
from astropy.coordinates import SkyCoord
from photutils import fit_2dgaussian
from arl.data.polarisation import PolarisationFrame
from arl.image.operations import export_image_to_fits
from a... | {
"alphanum_fraction": 0.6283261803,
"author": null,
"avg_line_length": 43.4701492537,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "1331690777a38b4e285fb2f687a349e93345e27f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | {
"alphanum_fraction": 0.7353126974,
"author": null,
"avg_line_length": 29.8679245283,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "76857e9d67df12aaa2c33423f6804d24336b1d35",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""Backend supported: tensorflow.compat.v1, tensorflow, pytorch
Documentation: https://deepxde.readthedocs.io/en/latest/demos/poisson.1d.dirichlet.html
"""
import sys
sys.path.append("..")
import deepxde as dde
import matplotlib.pyplot as plt
import numpy as np
# Import tf if using backend tensorflow.compat.v... | {
"alphanum_fraction": 0.70155902,
"author": null,
"avg_line_length": 32.0714285714,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "97e0d4d98473e54bd9448647466c6f43dd2ba4a7",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import h5py
import math
import argparse
import numpy as np
import pandas as pd
import cv2
import tensorflow as tf
import glob
import random
from PIL import Image
def prepare_h5_file_for_imitation_model(dset_folder, res, buffer_size, i... | {
"alphanum_fraction": 0.6548906876,
"author": null,
"avg_line_length": 43.0586319218,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "fd82e8ebe6584444c8c33767a12f9a4199da08b8",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
#include <boost/functional/hash.hpp>
#include "common/time.h"
#include "common/type.h"
#include <algorithm>
#include <vector>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>
using namespace std;
long long cand_num;
long long res_num;
const int JACCARD =... | {
"alphanum_fraction": 0.5843014129,
"author": null,
"avg_line_length": 21.9655172414,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "95da0344d78493689675bcdb7d525df8c084d45b",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
# Detect audio peaks with Librosa (https://librosa.github.io/librosa/)
# imports
from __future__ import print_function
import librosa
import numpy as np
import datetime
# Load local audio file
y, sr = librosa.load('src/song/song.ogg')
# Get file duration in seconds
duration = librosa.get_duration(y)
bpm = librosa.b... | {
"alphanum_fraction": 0.6746119734,
"author": null,
"avg_line_length": 30.0666666667,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "44535d43c911e8b05f7873a30675e93b74d49947",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
/**
* @file
* @copyright defined in VAC/LICENSE.txt
*/
#include <boost/test/unit_test.hpp>
#include <VACio/testing/tester.hpp>
using namespace VACio;
using namespace testing;
using namespace chain;
BOOST_AUTO_TEST_SUITE(block_tests)
BOOST_AUTO_TEST_CASE(block_with_invalid_tx_test)
{
tester main;
// Firs... | {
"alphanum_fraction": 0.7367101304,
"author": null,
"avg_line_length": 36.9259259259,
"converted": null,
"ext": "cpp",
"file": null,
"hexsha": "4f317f512075aa8b8ac51e48256731a0f6c6543c",
"include": null,
"lang": "C++",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks... |
# pylint: disable=W0212
"""
Webcam demo application
Implementation adapted from https://github.com/vita-epfl/openpifpaf/blob/master/openpifpaf/webcam.py
"""
import time
import logging
import torch
import matplotlib.pyplot as plt
from PIL import Image
try:
import cv2
except ImportError:
cv2 = None
import req... | {
"alphanum_fraction": 0.5481443475,
"author": null,
"avg_line_length": 33.7976878613,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "180fd7113006c503bc32b19c2dfdfc52dd69d99f",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
import os
import sys
import time
import pickle
import argparse
import numpy as np
import autosklearn.classification
from tabulate import tabulate
sys.path.append(os.getcwd())
from solnml.datasets.utils import load_train_test_data
from solnml.components.metrics.cls_metrics import balanced_accuracy
from solnml.componen... | {
"alphanum_fraction": 0.7199813476,
"author": null,
"avg_line_length": 37.9557522124,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "4e1a2b9ad8628cfa011075d1287f2000d9116ba2",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma specializedtoprimes1:
fixes p::nat
shows "\<lbrakk>prime p; prime q; p \<noteq> q; a mod p = b mod p ; a mod q = b mod q\<rbrakk>
\<Longrightarrow> a mod (p*q) = b mod (p*q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>prime p; prime q; p \<noteq> q; a mod p = b mod p; a ... | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "RSAPSS_Productdivides",
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 189,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_forks_eve... |
"""Storm-centered radar images."""
import os
import copy
import glob
import numpy
from scipy.interpolate import interp1d as scipy_interp1d
import netCDF4
from gewittergefahr.gg_io import netcdf_io
from gewittergefahr.gg_io import gridrad_io
from gewittergefahr.gg_io import myrorss_and_mrms_io
from gewittergefahr.gg_ut... | {
"alphanum_fraction": 0.6872669903,
"author": null,
"avg_line_length": 42.2903097697,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "50fb788c71897a3dacec0886b6784af188b396d8",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
[STATEMENT]
lemma card_le_UNIV:
fixes A :: "('n::finite) set"
shows "card A \<le> CARD('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. card A \<le> CARD('n)
[PROOF STEP]
by (simp add: card_mono) | {
"alphanum_fraction": null,
"author": null,
"avg_line_length": null,
"converted": null,
"ext": null,
"file": "Tarskis_Geometry_Miscellany",
"hexsha": null,
"include": null,
"lang": null,
"length": 1,
"llama_tokens": 93,
"mathlib_filename": null,
"max_forks_count": null,
"max_forks_repo_fork... |
function getproposal(p::Prior, nparams)
newparams = zeros(Float64, nparams)
update_newparams!(newparams, p)
return newparams
end
update_newparams!(newparams,p::Prior) = update_newparams!(newparams, 1, p.distribution...)
@inline function update_newparams!(newparams, i, x, y...)
newparams[i] = rand(x)
update_... | {
"alphanum_fraction": 0.7282608696,
"author": null,
"avg_line_length": 30.6666666667,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "fda21063770e7af4625fb79550e4b5097849548e",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | {
"alphanum_fraction": 0.6646486634,
"author": null,
"avg_line_length": 38.3838120104,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "e38aac7b661164fc734547defb65e52e1dc1b1d5",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
"""Provides printers for a full-structured representation"""
from textwrap import dedent, indent
from sympy.core.basic import Basic as SympyBasic
from ..core.abstract_algebra import Expression
from ..utils.singleton import Singleton
from ._render_head_repr import render_head_repr
from .base import QalgebraBasePrinte... | {
"alphanum_fraction": 0.5556390977,
"author": null,
"avg_line_length": 34.1025641026,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "135a7aceef48ec84c985aadfbc0f89b68ec78ff2",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_for... |
using Base.Test
using CUDArt
using Knet
include(Pkg.dir("Knet/test/mnist.jl"))
sparse32{T}(a::Array{T})=convert(SparseMatrixCSC{T,Int32}, a)
xtrn = MNIST.xtrn
xtst = MNIST.xtst
ytrn = MNIST.ytrn
ytst = MNIST.ytst
w0 = similar(ytst, size(ytst,1), 0)
d0 = 6.0
c0 = 1.0
g0 = 0.1
niter = 100
nbatch = 128
net = nothing
nc =... | {
"alphanum_fraction": 0.544870269,
"author": null,
"avg_line_length": 32.8203125,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "67323b5d8902141a5b4866d2fa8fa7af733dfb2a",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_co... |
!-----------------------------------------------------------------------
! Function: db_bode
! Authors: S. Lazerson (lazerson@pppl.gov)
! Date: 03/02/2012
! Description: This subroutine calculates the flux due to a line
! segment using bode formula.
!------------... | {
"alphanum_fraction": 0.3682249322,
"author": null,
"avg_line_length": 37.3670886076,
"converted": null,
"ext": "f90",
"file": null,
"hexsha": "a6b56424dd45dbd6765eb55cb5be18ddc6723bba",
"include": null,
"lang": "FORTRAN",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_f... |
@testset "model.jl" begin
@testset "setval! & generated_quantities" begin
@model function demo1(xs, ::Type{TV} = Vector{Float64}) where {TV}
m = TV(undef, 2)
for i in 1:2
m[i] ~ Normal(0, 1)
end
for i in eachindex(xs)
xs[i] ~ N... | {
"alphanum_fraction": 0.4987450699,
"author": null,
"avg_line_length": 29.3578947368,
"converted": null,
"ext": "jl",
"file": null,
"hexsha": "ee488b64c483cd62d8d03ca04af4a154e55d9c57",
"include": null,
"lang": "Julia",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_fork... |
import cv2
import magic
import tempfile
import base64
import numpy as np
from PIL import Image
from faceSwap import FaceSwap
from inspect import getsourcefile
import os.path
import sys
import io
current_path = os.path.abspath(getsourcefile(lambda: 0))
current_dir = os.path.dirname(current_path)
parent_dir = current_di... | {
"alphanum_fraction": 0.7064965197,
"author": null,
"avg_line_length": 26.9375,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "166a367766302bb1b04db554d733628ffcb9b351",
"include": true,
"lang": "Python",
"length": null,
"llama_tokens": null,
"mathlib_filename": null,
"max_forks_cou... |
function main
close all
problemNames = {'DenoisingEinstein';'AcceleratedDenoisingEinstein'};
for iproblem = 1:length(problemNames)
pName = problemNames{iproblem};
sLoader = SettingsLoader(pName);
settings = sLoader.settings;
denoisingProblem = DenoisingProblem(settings);
denoisingProblem.... | {
"alphanum_fraction": null,
"author": "SwanLab",
"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... |
from __future__ import print_function
import tensorflow as tf
import numpy as np
import math
import sklearn
class Conv1DClassifier:
def __init__(self, seq_len, vocab_size, n_out, sess=tf.Session(),
n_filters=250, embedding_dims=50, padding='valid', top_k=5):
"""
Parameters:
... | {
"alphanum_fraction": 0.5653081267,
"author": null,
"avg_line_length": 38.2441314554,
"converted": null,
"ext": "py",
"file": null,
"hexsha": "c27107ac9f554fb5319be40e9719c486f76e5758",
"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.