text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
# K-Means Clustering
# This chapter introduces a different clustering algorithm - k-means clustering - and its implementation in SciPy. K-means clustering overcomes the biggest drawback of hierarchical clustering that was discussed in the last chapter. As dendrograms are specific to hierarchical clustering, this chapte... | {"hexsha": "1c91ec97e6a653427d9f022e1b7308415d06359c", "size": 6265, "ext": "py", "lang": "Python", "max_stars_repo_path": "Cluster Analysis in Python/K-Means_Clustering.py", "max_stars_repo_name": "shreejitverma/Data-Scientist", "max_stars_repo_head_hexsha": "03c06936e957f93182bb18362b01383e5775ffb1", "max_stars_repo_... |
#include <gsl/gsl_sf_airy.h>
#include <gsl/gsl_errno.h>
/* function names generated by removing "gsl_sf" from the beginning
of the name. Thus gsl_sf_airy_Ai goes to airy_Ai. */
static int sf_mode[] = { GSL_PREC_DOUBLE, GSL_PREC_SINGLE, GSL_PREC_APPROX } ;
void airy_Ai_e(double *x, int *len, int *mode, double *v... | {"hexsha": "b154d1fae4d04861ece167361ddc6c262843b7ef", "size": 3835, "ext": "c", "lang": "C", "max_stars_repo_path": "src/airy.c", "max_stars_repo_name": "kbroman/fluctuationDomains", "max_stars_repo_head_hexsha": "d646a22b258d92199845446d914c1d3866e7b43f", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": nul... |
import sys
import os
import numpy as np
from os import walk
import cv2
# python size_pad_images.py input_dir output_dir
# python size_pad_images.py C:/users/matt/../Datasets/Stop_signs_by_hand/Images C:/users/matt/../Datasets/Stop_signs_by_hand/images/size_pad
# width to resize
width = 550
# height to res... | {"hexsha": "7a4884c24c09c50d03db780f71eec563d25e150a", "size": 2216, "ext": "py", "lang": "Python", "max_stars_repo_path": "acondicionamiento/size_pad_images.py", "max_stars_repo_name": "prsantiago/yolact-facemask", "max_stars_repo_head_hexsha": "1aaf22e2bdcd180359e5d3525200dbede618f753", "max_stars_repo_licenses": ["M... |
from __future__ import print_function
import numpy as np
import numpy.random as rnd
import numpy.linalg as la
import theano.tensor as T
from pymanopt import Problem
from pymanopt.manifolds import Oblique
from pymanopt.solvers import TrustRegions
def rank_k_correlation_matrix_approximation(A, k):
"""
Returns... | {"hexsha": "c5863b2bc177adab24494b4cff994e92521650e3", "size": 1214, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/rank_k_correlation_matrix_approximation.py", "max_stars_repo_name": "calincru/pymanopt", "max_stars_repo_head_hexsha": "3eb4696ea7fc62e89905409afadc3d905b36ed30", "max_stars_repo_licenses... |
from astropy.io import fits
import numpy as np
import os
import matplotlib.pyplot as plt
def pathLookup(ccd, camera, sector):
"""
Gets the datestring and the subdirectory for the specified PRF.
The datestring and directory name can be found from the ccd, camera and sector.
Inputs
-------
... | {"hexsha": "bda9684055494b8369b1e07a1b015817d2195879", "size": 15479, "ext": "py", "lang": "Python", "max_stars_repo_path": "lygos/read_tess_prfn.py", "max_stars_repo_name": "tdaylan/pandora", "max_stars_repo_head_hexsha": "98a3184d77eaa8c10cf3e8e99d61150674aebacc", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
\documentclass[t,xcolor=dvipsnames]{beamer}
%%%%%%%%%%%%%%%%%%%%%%%% Packages/includes
\usepackage[english]{babel}
%\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage{pgfpages}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\usepackage{subcaption}
\usepackage{epigraph}
\usepackage{engord}
% Antonio's macro... | {"hexsha": "ea0475997973793f70ce406f4f1ed42fbb33b555", "size": 32339, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "presentation/presentation-10min.tex", "max_stars_repo_name": "yanii/phd-thesis", "max_stars_repo_head_hexsha": "8d21690458f77c0cfefcb6ba528d421a83408b0e", "max_stars_repo_licenses": ["MIT"], "max_s... |
# Copyright 2019 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
from ampligraph.datasets import load_wn18, load_fb15k, load_fb15k_237, load_yago3_10... | {"hexsha": "9e06be00254eeed4fa569ee854389c69ab61f743", "size": 6434, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/ampligraph/datasets/test_datasets.py", "max_stars_repo_name": "ojasviyadav/AmpliGraph", "max_stars_repo_head_hexsha": "07ce70ff9e30812ac8f4a34d245d1d5decec27f7", "max_stars_repo_licenses": [... |
"""
GPU run command:
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python cifar10_cnn.py
"""
import csv
import numpy as np
import tensorflow as tf
from keras.utils import np_utils
from keras.optimizers import SGD
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation,... | {"hexsha": "a9e8114ca01e1326caaa3afea644d83b56654fdd", "size": 6015, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/cnn/cnn.py", "max_stars_repo_name": "semaraugusto/norm-conflict-classification", "max_stars_repo_head_hexsha": "03897326b8c347eb8d2afaed35e843a2c94cc0c8", "max_stars_repo_licenses": ["Apache... |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 11 21:44:20 2018
@author: adrian
"""
from numpy import sign
def calcularRaiz(f,a,b,error):
f1 = f(a)
d = (b-a)/10
x = a + d
f2 = f(x)
while(d>error):
while (sign(f1) == sign(f2)):
x = x + d
... | {"hexsha": "8d55184c31b8fdd4753ee6354eee903cef189e81", "size": 615, "ext": "py", "lang": "Python", "max_stars_repo_path": "Taller1/Punto14/Punto14.py", "max_stars_repo_name": "adgarciaar/NumericalAnalysis", "max_stars_repo_head_hexsha": "0f1cc6878dfb6c51052ee82298dd1e3512f74fde", "max_stars_repo_licenses": ["MIT"], "ma... |
#!/usr/bin/env python
import tifffile
from scipy import ndimage as ndi
from imctools import library as lib
import argparse
import os
import numpy as np
from skimage import transform
import warnings
def resize_image(fn_stack, outfolder, basename, scalefactor):
"""
Resizes an image
:param fn_stack: The file... | {"hexsha": "fa8aae453bfb49153028a1d8a2eea970900221a0", "size": 2909, "ext": "py", "lang": "Python", "max_stars_repo_path": "imctools/scripts/resizeimage.py", "max_stars_repo_name": "tabatsky/imctools", "max_stars_repo_head_hexsha": "f7482b5b543ff5452219f54c0218177044f76df8", "max_stars_repo_licenses": ["MIT"], "max_sta... |
export oneplus
using Distributed
function oneplus(nin::Int64, nout::Int64, fitness::Function;
ctype::DataType=CGPChromo, seed::Int64=0, expert::Any=nothing,
id::String="")
population = Array{ctype}(undef, Config.lambda)
for i in eachindex(population)
population[i] = c... | {"hexsha": "e90e4d134889013444680e1cdc33b7ca785dd2e6", "size": 1840, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/EAs/oneplus.jl", "max_stars_repo_name": "d6y/CGP.jl", "max_stars_repo_head_hexsha": "8d4e11f760be54eb9e49636a2d72809ff83ba312", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 1, ... |
#!/usr/bin/env python3
import numpy as np
import re
def get_mapping(tests):
mapping = {}
tests = [frozenset(t) for t in tests]
for t in tests:
if len(t) == 2:
one = t
mapping[t] = 1
elif len(t) == 3:
seven = t
mapping[t] = 7
elif len... | {"hexsha": "e3d350e75156c1c690fb1b8fce325c3fd6ac8b3e", "size": 1466, "ext": "py", "lang": "Python", "max_stars_repo_path": "2021/8/part_2.py", "max_stars_repo_name": "lvaughn/advent", "max_stars_repo_head_hexsha": "ff3f727b8db1fd9b2a04aad5dcda9a6c8d1c271e", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": nul... |
import Utils
import numpy as np
from PIL import Image
import os
# Saves image of prime
jsonFile = "./results/euler/54x66/prime_2020-05-11 213910.json"
imgFile = "img_"+os.path.basename(jsonFile)+".png"
# load from json
num, colors, size = Utils.load_from_file(jsonFile)
# rescale normalized RGB values to 0..255
col... | {"hexsha": "197f4c90993d8e9f6e93d43838ac5779d6de58e3", "size": 608, "ext": "py", "lang": "Python", "max_stars_repo_path": "json_to_image.py", "max_stars_repo_name": "cankut/image-to-prime", "max_stars_repo_head_hexsha": "d681ac0a6435f41662f638479ee7cfde2f203cb0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
#!/usr/bin/env python3
from iok import AwesomeClient, KnowledgeGraph, ResourceType
import networkx as nx
import argparse
parser = argparse.ArgumentParser(description='IoK client arg parser')
parser.add_argument('--debug', action='store_true')
args = parser.parse_args()
try:
g = KnowledgeGraph(debug=args.debug)... | {"hexsha": "3f8ba6fcec43cb85031aa27e27cfe70872e497d2", "size": 874, "ext": "py", "lang": "Python", "max_stars_repo_path": "legacy/iok_client.py", "max_stars_repo_name": "rianadon/iok", "max_stars_repo_head_hexsha": "db7cfafd5a88f4083d0c414a328d47cc9293dbd0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
from collections import deque
import sys
import cv2
import numpy as np
import time
import imutils
import math
from matplotlib import pyplot as plt
from imutils.video import FPS
# Functions
import HSV_filter as hsv
import shape_recognition as shape
import triangulation as tri
import no_mask
import predict_real_time as ... | {"hexsha": "861294e292a77c0a880174a54dafadb3f1a1018f", "size": 10539, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_real_time.py", "max_stars_repo_name": "daniode12/Ranger", "max_stars_repo_head_hexsha": "f9e038ac907a0e5f6b34830d9cce865421410363", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
# IMPORT PACKAGES FOR ANALYSING
# ///////////////////////////////////////////////////////////////
import string
import lmfit
import pandas
import pandas as pd
from PIL import Image
import numpy as np
import os
from os import walk
from PySide6.QtWidgets import QFileDialog
from iminuit import Minuit
import matplotlib.py... | {"hexsha": "6a715bf2bf77e23506de57554a08fac9206336a9", "size": 20370, "ext": "py", "lang": "Python", "max_stars_repo_path": "gui/uis/api/atom_api_functions.py", "max_stars_repo_name": "almogze/PSI", "max_stars_repo_head_hexsha": "142e9c71e74cf9882edfb2525d955a1c20bcb448", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import torch
from torch.utils.cpp_extension import load
from torch.nn import Parameter, init
import torch.nn.functional as F
spmm = load(name='spmm', sources=['spmm.cpp', 'spmm_kernel.cu'], verbose=True)
class SPMMFunction(torch.autograd.Function):
@staticmethod
def forward(ctx, rowptr, colind, colptr, rowin... | {"hexsha": "c3b43713a53b5a4b2d929a803e1f69b7c409f86c", "size": 5912, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytorch-custom/op.py", "max_stars_repo_name": "fishmingyu/ge-spmm", "max_stars_repo_head_hexsha": "9bb41fdf265c2b505f0b6b9baa4f18ecc4de24e9", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
theory Environment_Executable
imports
Main Physical_Trace Overtaking_Aux
begin
section "Lanelets"
definition points_path2 :: "(real2 \<times> real2) list \<Rightarrow> (real \<Rightarrow> real2) list" where
"points_path2 points \<equiv> map (\<lambda>p. linepath (fst p) (snd p)) points"
fun curve_eq3 :: "(re... | {"author": "rizaldialbert", "repo": "overtaking", "sha": "0e76426d75f791635cd9e23b8e07669b7ce61a81", "save_path": "github-repos/isabelle/rizaldialbert-overtaking", "path": "github-repos/isabelle/rizaldialbert-overtaking/overtaking-0e76426d75f791635cd9e23b8e07669b7ce61a81/Environment_Executable.thy"} |
import numpy as np
from sklearn.datasets import load_iris
from sklearn.externals.six import StringIO
from sklearn import tree
import pydotplus as pydot
iris = load_iris()
test_idx = [0, 50, 100]
train_target = np.delete(iris.target, test_idx)
train_data = np.delete(iris.data, test_idx, axis=0)
test_target = iris.tar... | {"hexsha": "e42adc007fe1cc05edd11445ca25d72fe1e8729e", "size": 852, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml-example/viz.py", "max_stars_repo_name": "enilsen16/python", "max_stars_repo_head_hexsha": "bcf4eac49fc4661b4060ef413baf0d13e48eed66", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
"""Data module."""
import itertools
import logging
import math
from typing import List, Tuple
import numpy as np
logger = logging.getLogger(__name__)
class DataGenerator:
def __init__(
self,
n_samples: int = 1000,
n_features: List[int] = None,
likelihoods: List[str] = None,
... | {"hexsha": "e5d5da9085efdf5aeed6c226faf925a5fb20f1b4", "size": 19136, "ext": "py", "lang": "Python", "max_stars_repo_path": "muvi/core/synthetic.py", "max_stars_repo_name": "MLO-lab/MuVI", "max_stars_repo_head_hexsha": "98796ab6deab225adc3add75e20c4b51f842f529", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c... |
import gym
import numpy as np
class GoalEnvObservationSpaceWrapper(gym.Wrapper):
def __init__(self, env, L2_loss_to_goal=False):
super(GoalEnvObservationSpaceWrapper, self).__init__(env)
if L2_loss_to_goal:
self._get_reward = lambda obs, reward: -np.linalg.norm(obs["achieved_goal"]-obs... | {"hexsha": "f91a7a792ac22b760a1a79c4185cc34e82c7020d", "size": 1308, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tc_environments/environment_wrapper.py", "max_stars_repo_name": "Sebastian-Griesbach/Improving-Policy-Conditioned-Value-Functions", "max_stars_repo_head_hexsha": "ec4125c5e056753e507df0406fcd6... |
import sys
import os
import numpy as np
from pprint import pprint
from datetime import datetime
from datetime import timedelta
import mysql.connector
import math
import calendar
import matplotlib.pyplot as plt
from scipy import stats
import matplotlib.cm as cm
SP2_ID = 58
start = datetime(2013,11,1)
end = datetime(20... | {"hexsha": "e806c527ee4fef47f63ba07ab10b430c088d4548", "size": 1683, "ext": "py", "lang": "Python", "max_stars_repo_path": "AL_nonincand_LF_vs_FF.py", "max_stars_repo_name": "annahs/atmos_research", "max_stars_repo_head_hexsha": "b5853c9b12e327492f8f8ba5069bca3fd2e981c8", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
theorem wf_insort\<^sub>1_nat: "wf t \<Longrightarrow> wf (insort\<^sub>1 t (x::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Manual_Nits.wf t \<Longrightarrow> Manual_Nits.wf (insort\<^sub>1 t x)
[PROOF STEP]
nitpick [eval = "insort\<^sub>1 t x", expect = genuine]
[PROOF STATE]
proof (prove)
goa... | {"llama_tokens": 189, "file": null, "length": 2} |
# tensor.jl
#
# Tensor provides a dense implementation of an AbstractTensor type without any
# symmetry assumptions, i.e. it describes tensors living in the full tensor
# product space of its index spaces.
#++++++++++++++
# Tensor type:
#++++++++++++++
# Type definition and constructors:
#-----------------------------... | {"hexsha": "a310edbf18fe9cf58cb3494abc3a63c989a666b0", "size": 28145, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/tensors/tensor.jl", "max_stars_repo_name": "amilsted/TensorToolbox.jl", "max_stars_repo_head_hexsha": "d491b3d2cabb7cc584b324435a61f409714daf20", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import unittest
import numpy
import pytest
import cupy
from cupy import testing
def _generate_type_routines_input(xp, dtype, obj_type):
dtype = numpy.dtype(dtype)
if obj_type == 'dtype':
return dtype
if obj_type == 'specifier':
return str(dtype)
if obj_type == 'scalar':
retur... | {"hexsha": "c74638d272cc3c73cd69df3511ebf12d122e3e1c", "size": 2929, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/cupy_tests/test_type_routines.py", "max_stars_repo_name": "svlandeg/cupy", "max_stars_repo_head_hexsha": "484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma excess'_if:
"excess f' x = (
if x=u then excess f u - \<Delta>
else if x=v then excess f v + \<Delta>
else excess f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. excess f' x = (if x = u then excess f u - \<Delta> else if x = v then excess f v + \<Delta> else ex... | {"llama_tokens": 130, "file": "Prpu_Maxflow_Generic_Push_Relabel", "length": 1} |
[STATEMENT]
lemma rule_sub_remark_9:
assumes "\<And>v.[\<lparr>P,a\<rparr> \<^bold>\<equiv> (\<lparr>P,a\<rparr> \<^bold>& (\<lparr>Q,b\<rparr> \<^bold>\<or> (\<^bold>\<not>\<lparr>Q,b\<rparr>))) in v]"
and "[\<lparr>P,a\<rparr> \<^bold>= \<lparr>P,a\<rparr> in v]"
shows "[\<lparr>P,a\<rparr> \<^bold>= ... | {"llama_tokens": 1384, "file": "PLM_TAO_9_PLM", "length": 4} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import random
import pandas as pds
import numpy as np
import os
import matplotlib.pyplot as plt
import math
from datetime import datetime
from keras.models import Sequential, Model
from keras.layers import *
from keras.layers.convolutional import Conv1D, MaxPo... | {"hexsha": "34bf7b1d85d1f3ea8c90b8299d8f65fa945612d3", "size": 9910, "ext": "py", "lang": "Python", "max_stars_repo_path": "cnn/estimate_cnn.py", "max_stars_repo_name": "dpedrosac/iPScnn", "max_stars_repo_head_hexsha": "1ab46906b69535e67e5d3c2945c398c640a41cd3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
class Logistic:
def __init__(self, reg=0):
self.reg=reg
def fit(self, X, y, tol=1e-4):
X = np.concatenate((np.ones_like(X[:, 0])[:, np.newaxis], X), axis=1)
start=True
w = np.zeros(X[0, :].T.shape)
... | {"hexsha": "212f5813ebf928925e4d8a029d0a081f2ec3a0c7", "size": 1188, "ext": "py", "lang": "Python", "max_stars_repo_path": "Homework 1/methods/logistic.py", "max_stars_repo_name": "hugcis/Homeworks-PGM", "max_stars_repo_head_hexsha": "fdc392a30809f4ea876261c43587c181ee5d6371", "max_stars_repo_licenses": ["MIT"], "max_s... |
/*
* Sarus
*
* Copyright (c) 2018-2021, ETH Zurich. All rights reserved.
*
* Please, refer to the LICENSE file in the root directory.
* SPDX-License-Identifier: BSD-3-Clause
*
*/
/**
* @brief Utility functions to be used in the tests.
*/
#ifndef sarus_test_utility_config_hpp
#define sarus_test_utility_confi... | {"hexsha": "4b11597fe0d19c95bd8bfb717b8f536596f694f4", "size": 628, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/test_utility/config.hpp", "max_stars_repo_name": "tdhooks/sarus", "max_stars_repo_head_hexsha": "64d3152e810b1081e6dbe7b3587e8e5948c3268e", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars... |
import cv2
import random
import numpy as np
import imgaug as ia
import imgaug.augmenters as iaa
from hand_detector.yolo.utils.utils import visualize
from hand_detector.yolo.preprocess.yolo_flag import Flag
from hand_detector.yolo.preprocess.labelgen import label_generator
f = Flag()
size = f.target_size
def augment(... | {"hexsha": "8b7b56b362018ec2038b814ddec81518d3e97f46", "size": 3041, "ext": "py", "lang": "Python", "max_stars_repo_path": "hand_detector/yolo/preprocess/augmentation.py", "max_stars_repo_name": "congtranv/Unified-Gesture-and-Fingertip-Detection", "max_stars_repo_head_hexsha": "5606c2afed462d0bf5686b10c441a6b7d0dbc7ad"... |
#%%
import numpy as np
import pandas as pd
import numpy as np
import prot.viz
import tqdm
dataset_colors = prot.viz.dataset_colors()
# Define necessary renaming function and dict
def rename(k):
k = k.replace('<sup>', '')
k = k.replace('</sup>', '')
k = k.replace('<sub>', '')
k = k.replace('</sub>', '... | {"hexsha": "a01e4f551e1071810991ddd60a5f3857b49a6290", "size": 5751, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/figures/complex_explorer/explorer_munging.py", "max_stars_repo_name": "gchure/quantitative_proteome", "max_stars_repo_head_hexsha": "90d15dd208647332aeb06cf7e16ab71a6b210820", "max_stars_repo... |
#!/usr/bin/env python
"""
Copyright 2019 Jesus Villalba (Johns Hopkins University)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
import os
import argparse
import time
import logging
import numpy as np
# import av
# import cv2
import h5py
import torch
from hyperion.hyp_defs import config_logger
fr... | {"hexsha": "53f39316a185736a565efd2d6b81433f5f3ebabc", "size": 5777, "ext": "py", "lang": "Python", "max_stars_repo_path": "egs/sre19-av-v/v0.2/steps_insightface/extract-face-embed-from-image.py", "max_stars_repo_name": "hyperion-ml/hyperion", "max_stars_repo_head_hexsha": "c4c9eee0acab1ba572843373245da12d00dfffaa", "m... |
\documentclass{article}
\usepackage{amsmath}
\usepackage[margin=1.0in]{geometry}
\usepackage{xcolor}
\begin{document}
\noindent
Does $\displaystyle \sum_{n=2}^\infty \frac{1}{n \ln n}$
diverge, converge absolutely, or converge conditionally?
\subsection*{Solution}
The function $f(x)=\frac{1}{x \ln x}... | {"hexsha": "ea9089fccb15953252bd281a9c6a7d0111963f0b", "size": 1748, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "key/series/e2.tex", "max_stars_repo_name": "edward-kim-math/edward-d-kim.github.io", "max_stars_repo_head_hexsha": "db677132d89eb95dc5749dceeb9544c77b6b4a05", "max_stars_repo_licenses": ["CC-BY-4.0"... |
[STATEMENT]
lemma sum_less_suminf2:
"summable f \<Longrightarrow> (\<And>m. m\<ge>n \<Longrightarrow> 0 \<le> f m) \<Longrightarrow> n \<le> i \<Longrightarrow> 0 < f i \<Longrightarrow> sum f {..<n} < suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow... | {"llama_tokens": 589, "file": null, "length": 2} |
import numpy as np
from source import cdp, graph, knn
import pdb
class CDP(object):
def __init__(self, k, th, metric='cosinesimil', max_sz=1000, step=0.05, max_iter=100, debug_info=False):
'''
k: k in KNN searching.
th: threshold, (0, 1)
metric: choose one from ['cosinesimil', 'l1... | {"hexsha": "e0c6bcf8eb6fc789f3bebc78ebcbf9185262ad93", "size": 2837, "ext": "py", "lang": "Python", "max_stars_repo_path": "single_api.py", "max_stars_repo_name": "winnerineast/cdp", "max_stars_repo_head_hexsha": "03b21073f235eff39402bbd1654c2b7f56afef06", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 435, "ma... |
import argparse
import random
import numpy as np
import torch
from utils.gpu import set_gpu
from utils.parse import parse_yaml
import os
import time
os.environ["TZ"] = "UTC-8"
time.tzset()
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', ... | {"hexsha": "e3a470a08cfec9a810c5cc7217be37f6849c2b2e", "size": 2304, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "yongpi-scu/BRNet", "max_stars_repo_head_hexsha": "d24364af56d16592308b167a7de339e4a8a09bc8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_stars... |
module Dart.FFI.Enums
import Dart.Core
public export
interface IsEnum a where
namespace Enum
%inline
public export
equals : IsEnum a => a -> a -> Bool
equals x y = toBool (prim__dart_eq x y)
export
IsEnum a => Eq a where
(==) = Enum.equals
| {"hexsha": "2b7721d181579f357faead52d34b784cbecd989f", "size": 254, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "packages/dart-ffi/src/Dart/FFI/Enums.idr", "max_stars_repo_name": "rafaelprev/idris2dart", "max_stars_repo_head_hexsha": "64509c6731d7d0963bd27be31d9d0c9ff15da08c", "max_stars_repo_licenses": ["BSD... |
library(tidyverse)
unids_list <- readRDS("./02_ dados/02_ RFB/dados_modificados/unids_validas_RFB_2019_08_08.rds")
unids <- unids_list %>%
lapply(., unlist) %>%
lapply(., as.data.frame) %>%
lapply(., t) %>%
lapply(., as.data.frame) %>%
do.call(p... | {"hexsha": "7681af8d0f1b17a38bdad1dc4a5a7b2283bdbb17", "size": 1606, "ext": "r", "lang": "R", "max_stars_repo_path": "02_ dados/02_ RFB/scripts/data frame unidades atendimento.r", "max_stars_repo_name": "matth3us/tccENAP", "max_stars_repo_head_hexsha": "bd3b607dee01ea82cef2a45b48815dd147ff5113", "max_stars_repo_license... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
######################################################
# Generar archivo CSV de un HDF5 para la variable EVI
# Author: Jorge Mauricio
# Email: jorge.ernesto.mauricio@gmail.com
# Date: Created on Thu Sep 28 08:38:15 2017
# Version: 1.0
##################################... | {"hexsha": "f08374b36612620a70c2011cb578aff3ac01fe1a", "size": 4093, "ext": "py", "lang": "Python", "max_stars_repo_path": "pre_procesamiento_evi.py", "max_stars_repo_name": "jorgemauricio/get_modis_files_from_nasa", "max_stars_repo_head_hexsha": "fc298f702113faacabb7f6ebcb3f2530375f45d8", "max_stars_repo_licenses": ["... |
from datetime import datetime as dt
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf import Series
from cudf.core.index import RangeIndex, as_index
from cudf.testing._utils import (
DATETIME_TYPES,
NUMERIC_TYPES,
TIMEDELTA_TYPES,
assert_eq,
)
def cudf_date_series(start, sto... | {"hexsha": "f06142f4cc9f0d961d9a07d7e24cc8c0579520db", "size": 3480, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/cudf/cudf/tests/test_contains.py", "max_stars_repo_name": "gdaisukesuzuki/cudf", "max_stars_repo_head_hexsha": "aa5c8b686b1513dba7bce168200c1259f1eda908", "max_stars_repo_licenses": ["Apach... |
#ifndef FASTSIM_RADAR_HPP_
#define FASTSIM_RADAR_HPP_
#include <boost/shared_ptr.hpp>
#include "posture.hpp"
#include "map.hpp"
namespace fastsim
{
/// a radar detects a given goal in one of the n slices
/// radar SEE TROUGH OBSTACLES
class Radar
{
public:
Radar(int color, int nb_slices, bool through_wa... | {"hexsha": "d42182615bfda813871cfd6c2010e01164b38ec9", "size": 1195, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "multimodalmaze/domains/mazeDomain/simulator/libfastsim/src/radar.hpp", "max_stars_repo_name": "alexander-hagg/phdexperiments", "max_stars_repo_head_hexsha": "6506c8f2a438c67ca7c808df8715711fde73dfce... |
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE Main
#include <boost/test/unit_test.hpp>
#include <atomic>
#include <chrono>
#include <iostream>
#include <thread>
#include "../network/common/net_data.h"
#include <libclient/client.h>
#include <libdariadb/engine.h>
#include <libdariadb/meas.h>
#include <libdariad... | {"hexsha": "cfc86314467b96dd007f094f4e79266f1d3a7ae8", "size": 15491, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/net_test.cpp", "max_stars_repo_name": "dariadb/dariadb", "max_stars_repo_head_hexsha": "1edf637122752ba21c582675e2a9183fff91fa50", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
import numpy as np
class BanditChoiceBoltzmann(object):
def __init__(self):
pass
def evaluate(self, posteriorMatrix, legalItemVector, ratingMatrixForUser=None):
user_indices = np.array(range(len(legalItemVector)))
user_indices = user_indices[legalItemVector == 1]
user_ratings =... | {"hexsha": "505f5afa4177c6fb3010411941b66e6d3d51e3c9", "size": 1109, "ext": "py", "lang": "Python", "max_stars_repo_path": "banditChoiceBoltzmann.py", "max_stars_repo_name": "wezteoh/Bandit_Recommendation", "max_stars_repo_head_hexsha": "a326e4d1d082e1a2113fe739bc343fb45b0b8a4a", "max_stars_repo_licenses": ["MIT"], "ma... |
from scipy.io import loadmat
import numpy as np
import sys
def bounds_from_data(X):
lower_bound = np.min(X, axis=0)
upper_bound = np.max(X, axis=0)
return lower_bound, upper_bound
def random_choice(X, size=10000):
idx = np.random.choice(list(range(X.shape[0])), size=size)
return X[idx, :]
def... | {"hexsha": "c6a2ec060035aa81d64615ea07172956bba43694", "size": 2596, "ext": "py", "lang": "Python", "max_stars_repo_path": "PINN_Base/util.py", "max_stars_repo_name": "roman-amici/PINN_Base", "max_stars_repo_head_hexsha": "af5f2869925d0f476cc62931ae9426e1f45cfae5", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
Past issues can be found on the Student Computing Guide at http://scg.ucdavis.edu/hypertext.cfm
An HyperText Wiki Column article about DavisWiki can be found in the http://scg.ucdavis.edu/hypertext/2005fallwithmap.pdf Fall 2005 issue.
| {"hexsha": "741f9da8e1f4977b847f3c66c1695c6e85eda04b", "size": 239, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/HyperText.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
abstract type Integration end
abstract type Model{I <: Integration, T <: Time} end
"""
struct TemplateModel{I, T} <: Model{I, T}
n::Int # state dimension
m::Int # control dimension
d::Int # disturbance dimension
# additional model parameters ...
end
function f(model::TemplateModel, x, u, w)
# continuou... | {"hexsha": "df58b6e8f3364580bc29631bdeaaef3ab3ec2dad", "size": 2707, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/model.jl", "max_stars_repo_name": "jmichaux/motion_planning", "max_stars_repo_head_hexsha": "9a36f394261ff11ca8325d8a5e9d8a79f18b2744", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 35... |
# Custom Kernel implementation that only defines how to evaluate itself. This is used to
# test that fallback kernelmatrix / kerneldiagmatrix methods work properly.
struct BaseSE <: KernelFunctions.Kernel end
(k::BaseSE)(x, y) = exp(-evaluate(SqEuclidean(), x, y) / 2)
# Custom kernel to test `SimpleKernel` interface o... | {"hexsha": "2f825c1ae15afabd67640d1ee8104558ba4b7601", "size": 5098, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/matrix/kernelmatrix.jl", "max_stars_repo_name": "gkazunii/KernelFunctions.jl", "max_stars_repo_head_hexsha": "1e5751ec632477373203886920b1fe0f29966b48", "max_stars_repo_licenses": ["MIT"], "ma... |
Require Import Crypto.Specific.Framework.SynthesisFramework.
Require Import Crypto.Specific.solinas64_2e414m17_9limbs.CurveParameters.
Module P <: PrePackage.
Definition package : Tag.Context.
Proof. make_Synthesis_package curve extra_prove_mul_eq extra_prove_square_eq. Defined.
End P.
Module Export S := PackageS... | {"author": "anonymous-code-submission-01", "repo": "sp2019-54-code", "sha": "8867f5bed0821415ec99f593b1d61f715ed4f789", "save_path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code", "path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code/sp2019-54-code-8867f5bed0821415ec99f593b1d61f715ed4f7... |
#ifndef BOOST_THREAD_PTHREAD_ONCE_HPP
#define BOOST_THREAD_PTHREAD_ONCE_HPP
// once.hpp
//
// (C) Copyright 2007-8 Anthony Williams
//
// 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)
#include <boost/threa... | {"hexsha": "384895b7abe7d9d9fb1bf44fb852d86565dd41d0", "size": 3089, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "deps/boost-1.47.0/boost/thread/pthread/once.hpp", "max_stars_repo_name": "basho-labs/riak-cxx-client", "max_stars_repo_head_hexsha": "88f7196f8c30f35ec784c6e051e82082927acc77", "max_stars_repo_licen... |
[STATEMENT]
lemma f_join_empty: "xs \<Join>\<^sub>f {} = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. xs \<Join>\<^sub> {} = []
[PROOF STEP]
by (simp add: length_0_conv[symmetric] f_join_length cut_less_empty del: length_0_conv) | {"llama_tokens": 98, "file": "AutoFocus-Stream_IL_AF_Stream", "length": 1} |
# -*- coding: utf-8 -*-
"""
DCGAN 教程
==============
**翻译者**: `Antares博士 <http://www.studyai.com/antares>`_
"""
######################################################################
# 介绍
# ------------
#
# 本教程将通过一个示例介绍DCGANs。我们将训练一个生成对抗网络(generative adversarial network, GAN),
# 在给它展示许多名流的照片之后,产生新的名人。这里的大部分代码都来自 `p... | {"hexsha": "cc77526e944d8f24bdde58d62a50dab2baf56c6f", "size": 19999, "ext": "py", "lang": "Python", "max_stars_repo_path": "beginner_source/dcgan_faces_tutorial.py", "max_stars_repo_name": "ScorpioDoctor/antares02", "max_stars_repo_head_hexsha": "631b817d2e98f351d1173b620d15c4a5efed11da", "max_stars_repo_licenses": ["... |
[STATEMENT]
lemma all_eq_all: "\<forall>x. P x = Q x ==> (\<forall>x. P x) = (\<forall>x. Q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<forall>x. P x = Q x \<Longrightarrow> (\<forall>x. P x) = (\<forall>x. Q x)
[PROOF STEP]
by blast | {"llama_tokens": 106, "file": "Verified-Prover_Prover", "length": 1} |
# -*- coding: latin-1 -*-
# Copyright (c) 2008 Pycircuit Development Team
# See LICENSE for details.
import circuit
import pycircuit.utilities.param as param
import sympy
import sympy.printing.lambdarepr
import numpy as np
import inspect
from copy import copy
class Node(circuit.Node):
@property
def V(self):... | {"hexsha": "484770d67e824ee3551f8ee92fba47adcef4a811", "size": 9037, "ext": "py", "lang": "Python", "max_stars_repo_path": "pycircuit/circuit/hdl.py", "max_stars_repo_name": "michaelnt/pycircuit", "max_stars_repo_head_hexsha": "ef3110c1c3789c1e5f30c35e3f5dd15ed4bd349e", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
[STATEMENT]
lemma has_sum_uminus:
fixes f :: \<open>'a \<Rightarrow> 'b::topological_ab_group_add\<close>
shows \<open>has_sum (\<lambda>x. - f x) A a \<longleftrightarrow> has_sum f A (- a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. has_sum (\<lambda>x. - f x) A a = has_sum f A (- a)
[PROOF STEP]
by... | {"llama_tokens": 160, "file": null, "length": 1} |
import collections
import json
import math
import os
import random
from contextlib import suppress
from pathlib import Path
import numpy
import shapefile
from fstools.generate.forests.xml_parser import XmlForests
from fstools.i18n import _
from fstools.util import i3d
from fstools.util import simple_rasters
from fsto... | {"hexsha": "5b654e071ef15a31875733fb0ce6bc62b60566ea", "size": 11841, "ext": "py", "lang": "Python", "max_stars_repo_path": "fstools/generate/forests/forestGenerator.py", "max_stars_repo_name": "FireByTrial/farmsimtools", "max_stars_repo_head_hexsha": "74cf35108b2883b77effd5b55edf4be436287e36", "max_stars_repo_licenses... |
// Copyright (c) 2003 Daniel Wallin and Arvid Norberg
// 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,... | {"hexsha": "124135029a024854d058b498636cb46466afbc6b", "size": 12442, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/xray/Luabind/luabind/functor.hpp", "max_stars_repo_name": "OLR-xray/OLR-3.0", "max_stars_repo_head_hexsha": "b6a9bb2a0c1fb849b8c6cea2e831e1ceea5cc611", "max_stars_repo_licenses": ["Apache-2.0"]... |
[STATEMENT]
lemma [simp]: "class (compP f P) C = map_option (\<lambda>c. snd(compC f (C,c))) (class P C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. class (compP f P) C = map_option (\<lambda>c. snd (compC f (C, c))) (class P C)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. class (compP f ... | {"llama_tokens": 211, "file": "Jinja_Compiler_PCompiler", "length": 2} |
import scipy
import re
from ...algorithm.parameters import params
from .math_functions import *
from sklearn.metrics import log_loss
def optimize_constants(x, y, ind):
"""
Use gradient descent to search for values for the constants in
ind.phenotype which minimise loss.
:param x: Input (an array... | {"hexsha": "37aceeab996fa74b45cc516a3097adfb00221254", "size": 5284, "ext": "py", "lang": "Python", "max_stars_repo_path": "evoltree/utilities/fitness/optimize_constants.py", "max_stars_repo_name": "p-pereira/MGEDT", "max_stars_repo_head_hexsha": "99e4b3ee2d07d4ba5b261e09d0ee20f83497af53", "max_stars_repo_licenses": ["... |
import numpy
import scipy.signal
def sobel(image):
filter_x = scipy.signal.convolve2d(
image,
[[-1, 0, 1],
[-2, 0, 2],
[-1, 0, 1]],
boundary='wrap',
mode='valid'
)
filter_y = scipy.signal.convolve2d(
image,
[[-1, -2, -1],
[+0, +0,... | {"hexsha": "dde8d5cfadea0c20d0dd34209e7543695fb467b9", "size": 1096, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/2/sobel.py", "max_stars_repo_name": "axell-brendow/image-processing", "max_stars_repo_head_hexsha": "ad114d3c364d3055e6e5d6fbdbc28220cc4d96e9", "max_stars_repo_licenses": ["MIT"], "max_stars... |
[STATEMENT]
lemma iam_delete_rule: "< is_iam m p >
iam_delete k p
<\<lambda>r. is_iam (m|`(-{k})) r>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. <is_iam m p> iam_delete k p <is_iam (m |` (- {k}))>
[PROOF STEP]
unfolding is_iam_def iam_delete_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. <\<exists... | {"llama_tokens": 278, "file": "Separation_Logic_Imperative_HOL_Examples_Array_Map_Impl", "length": 2} |
\section{Problem Description}
We want to exploit the parallelism of sequential scientific Fortran code without
having to heavily modify the code itself. There are a multitude of ways to do this but
we focus on using FPGAs (Field Programmable Gate Arrays).
A FPGA is an integrated circuit that contains an array of pro... | {"hexsha": "3b94dde8a8deb90b1eb051cf6fcae49174eb2cff", "size": 2472, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "proposal/include/problem_definition.tex", "max_stars_repo_name": "RossMeikleham/MSci-Project", "max_stars_repo_head_hexsha": "4e1e3e08bf8440add18b4a87b96ca42920336e14", "max_stars_repo_licenses": ["... |
# For convenience
typealias TupleN{T,N} NTuple{N,T}
# Cast any Tuple to an TupleN{T}
convert_ntuple{T}(::Type{T},d::T) = T # For zero-dimensional arrays
convert_ntuple{N,T}(::Type{T},d::NTuple{N,T}) = d
@generated function convert_ntuple{N,T}(::Type{T},d::NTuple{N})
exprs = ntuple(i -> :(convert(T, d[$i])), Val{N}... | {"hexsha": "21b871bb95f394105faaebd5688adda0a750cb44", "size": 2138, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/util.jl", "max_stars_repo_name": "JuliaPackageMirrors/StaticArrays.jl", "max_stars_repo_head_hexsha": "c453f137c163fa435659b263d8af8e6f87f07d42", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# 4. faza: Analiza podatkov
# Uvozimo funkcijo za uvoz spletne strani.
source("lib/xml.r")
# # Preberemo spletno stran v razpredelnico.
# cat("Uvažam spletno stran...\n")
# tabela <- preuredi(uvozi.obcine(), obcine)
#
# # Narišemo graf v datoteko PDF.
# cat("Rišem graf...\n")
# pdf("slike/naselja.pdf", width=6, heig... | {"hexsha": "8850cba42362318d517a15447af1065ede6087c7", "size": 5421, "ext": "r", "lang": "R", "max_stars_repo_path": "analiza/analiza.r", "max_stars_repo_name": "filiplenarcic/APPR-2014-15", "max_stars_repo_head_hexsha": "4a8a84dbe8c4144bc526c45c1ced435f82f84841", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
from cvxpy import *
import numpy as np
import time, collections, os, errno, sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from Visualization_function import visualize
from solveCrossTime import *
from scipy import stats
from sklearn import mixture
from sklearn import covarianc... | {"hexsha": "457b11ada52c25e795950e3e589c7f83a6751ed1", "size": 15509, "ext": "py", "lang": "Python", "max_stars_repo_path": "paper code/scalability_test.py", "max_stars_repo_name": "loopinf/TICC", "max_stars_repo_head_hexsha": "320408ca5dfa77df42b006b3e7203af8ab6289e5", "max_stars_repo_licenses": ["BSD-2-Clause"], "max... |
subsection {* Variable blocks *}
theory utp_local
imports utp_theory
begin
text {* Local variables are represented as lenses whose view type is a list of values. A variable
therefore effectively records the stack of values that variable has had, if any. This allows
us to denote variable scopes using assignments t... | {"author": "git-vt", "repo": "orca", "sha": "92bda0f9cfe5cc680b9c405fc38f07a960087a36", "save_path": "github-repos/isabelle/git-vt-orca", "path": "github-repos/isabelle/git-vt-orca/orca-92bda0f9cfe5cc680b9c405fc38f07a960087a36/C-verifier/src/Midend-IVL/Isabelle-UTP/utp/utp_local.thy"} |
(* This failed in 8.3pl2 *)
Scheme Induction for eq Sort Prop.
Check eq_ind_dep.
(* This was broken in v8.5 *)
Set Rewriting Schemes.
Inductive myeq A (a:A) : A -> Prop := myrefl : myeq A a a.
Unset Rewriting Schemes.
Check myeq_rect.
Check myeq_ind.
Check myeq_rec.
Check myeq_congr.
Check myeq_sym_internal.
Check ... | {"author": "princeton-vl", "repo": "CoqGym", "sha": "0c03a6fba3a3ea7e2aecedc1c624ff3885f7267e", "save_path": "github-repos/coq/princeton-vl-CoqGym", "path": "github-repos/coq/princeton-vl-CoqGym/CoqGym-0c03a6fba3a3ea7e2aecedc1c624ff3885f7267e/coq/test-suite/success/Scheme.v"} |
"""library of function to be used in general purpose data processing for TSV class"""
import statistics
import numpy as np
from dateutil import parser
import datetime
def parse_image_file_base_name(x):
if (len(x) <= 1):
return x
index = -1
if ("\\" in x):
index = x.rindex("\\")
el... | {"hexsha": "78fa33ad02e34ab1fc005bd1515915ba3868921d", "size": 3915, "ext": "py", "lang": "Python", "max_stars_repo_path": "python-packages/core/src/omigo_core/funclib.py", "max_stars_repo_name": "amitjaiswal/tsv-data-analytics", "max_stars_repo_head_hexsha": "ea341d18e32530060728b2e60d799237d5c44683", "max_stars_repo_... |
""" Dataset Module
Dataset module introduces an abstract class that is the skeleton of all the
datasets classes. It provides the methods that Argo use to feed our ML
algorithms.
"""
from .PerturbedDecorator import PerturbedDecorator
from abc import ABC, abstractmethod
import importlib
from functools import partial... | {"hexsha": "b76d88cbc0ff1115cc732e00429bdc0cdf52ea8a", "size": 38975, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/Dataset.py", "max_stars_repo_name": "szokejokepu/natural-rws", "max_stars_repo_head_hexsha": "bb1ad4ca3ec714e6bf071d2136593dc853492b68", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma hmem_not_refl: "x \<^bold>\<notin> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<^bold>\<notin> x
[PROOF STEP]
using foundation [of "\<lbrace>x\<rbrace>"]
[PROOF STATE]
proof (prove)
using this:
\<lbrace>x\<rbrace> \<noteq> 0 \<Longrightarrow> \<exists>w. w \<^bold>\<in> \<lbrace>x\<rbrace>... | {"llama_tokens": 203, "file": "HereditarilyFinite_HF", "length": 2} |
import numpy as np
from util import resolve, genson_dumps, get_global_seed, assert_kwargs_consumed
from internal_ops import GenSONOperand
from internal_ops import GenSONFunction
from internal_ops import registry
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
def register_fun... | {"hexsha": "2a6e2c3261c52eddd6aa5c3d1f413e0f00ce1229", "size": 8655, "ext": "py", "lang": "Python", "max_stars_repo_path": "genson/functions.py", "max_stars_repo_name": "davidcox/genson", "max_stars_repo_head_hexsha": "9602f631e645bf515a6d03ec7e7dcb1227fdf680", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
import abc
import numpy as np
import torch.nn as nn
from sklearn.preprocessing import OneHotEncoder
__all__ = [
"pad_tensor",
"is_modifier_code",
"ASCIIKeyEncoder", "CoordKeyEncoder", "OneHotKeyEncoder", "select_key_encoder"
]
#==============================================================================... | {"hexsha": "a53d9361da1420efb0afcfe2dcb4ddb740238015", "size": 4250, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset/utils.py", "max_stars_repo_name": "wheeltune/kid-neuro", "max_stars_repo_head_hexsha": "131ec888e4f0c3ee1d7b4c4ebf57a6b1d5323d8a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
!##########################################################################
module vars
!##########################################################################
SAVE
double precision g_dx,g_dy,g_dz,dens,Re,eps,fac,Pr,beta,Th,Tc
double precision qzero,qstpn,qstpn_y,qstpn_z
double p... | {"hexsha": "25ac0914b9c491f78de578e57ab35a5350590fab", "size": 2287, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "source/module_vars.for", "max_stars_repo_name": "samcusworth/Hydro3D", "max_stars_repo_head_hexsha": "ecbca2004519e6210ed143737936eb26145f020e", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import numpy as np
class World:
class LocationOccupied(RuntimeError): pass
# Python doesn't have a concept of public/private variables
def __init__(self, width, height, prob_life=20, env=None):
self.env = env
self.width = width
self.height = height
self.prob_life = prob_l... | {"hexsha": "0e4ab8ab192c5080b7b90be9cda9179606b1a641", "size": 5317, "ext": "py", "lang": "Python", "max_stars_repo_path": "game_of_life/envs/world.py", "max_stars_repo_name": "smearle/gym-micropolis", "max_stars_repo_head_hexsha": "42b338ee050fb654e1c74dfe59bf5f03f03d39a4", "max_stars_repo_licenses": ["MIT"], "max_sta... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 20 16:57:42 2018
@author: bmoseley
"""
# This module defines various loss functions in pytorch.
import numpy as np
import torch
# Note: trainer passes arguments in the following order: loss(*labels, *outputs, constants)
def l2_mean_loss(a,b, ... | {"hexsha": "1c9c21d85aa18b9ce6829b49f492856e6067cd3d", "size": 1678, "ext": "py", "lang": "Python", "max_stars_repo_path": "autoencoder/losses.py", "max_stars_repo_name": "mtoqeerpk/seismic-simulation-complex-media", "max_stars_repo_head_hexsha": "701d3af7ac84120202bc9a741bfdf2320ad06ddc", "max_stars_repo_licenses": ["... |
// A series of templated routines to copy image objects between memory buffers
#ifndef GTL_IMAGECOPIERS_HPP
#define GTL_IMAGECOPIERS_HPP
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include "Utils.hpp"
#include "memoryIterators.hpp"
//CHECK ALL THE OFFSET MATHS!!!
//IT FEELS LIKE BAD BAD VOODOO!!!
//
na... | {"hexsha": "08015cfc4fb0c74687667d358446a4aa478dd6b8", "size": 21417, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "source/utils/ImageCopiers.hpp", "max_stars_repo_name": "bobvodka/GameTextureLoader3", "max_stars_repo_head_hexsha": "47db5781eb650b9746ffed327786c7e73410cbe0", "max_stars_repo_licenses": ["MIT"], "... |
// Copyright (c) 2018, The Remix Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// c... | {"hexsha": "88f12a9d2b8b3f062040393de96a067e6c75e4ac", "size": 10603, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/cryptonote_basic/difficulty.cpp", "max_stars_repo_name": "devopsralf/remix", "max_stars_repo_head_hexsha": "12220615d3011b4a86184bd83a390b50d1ee56cc", "max_stars_repo_licenses": ["BSD-3-Clause"... |
import numpy as np
import random
from eventcodes import INFO_INTERNAL
class Channel():
"""Underwater wireless communication channel
This class models the underwater communication between fish instances and
connects fish to the environmental network.
"""
def __init__(self, environment, verbose=F... | {"hexsha": "904d4559c42a3773a2001f4251242eaf2b52ae9f", "size": 2722, "ext": "py", "lang": "Python", "max_stars_repo_path": "channel.py", "max_stars_repo_name": "fberlinger/UndercoverBot", "max_stars_repo_head_hexsha": "ce6c1c02114cf52b0afe03af452398f7ccf12d2f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
from layers.convolution import Convolution
import numpy as np
class InnerProduct(Convolution):
def __init__(self, layer_name, input_shape, input_width, input_stride, output_shape, params, cpf=1, kpf=1):
kernel_num = params[0].shape[0]
kernel_shape = tuple([params[0].shape[1], 1, 1])
#reshap... | {"hexsha": "995a633e4e8b8b890fafc4aae8664c14923c5985", "size": 1640, "ext": "py", "lang": "Python", "max_stars_repo_path": "layers/innerproduct.py", "max_stars_repo_name": "fenc1022/AccDNN", "max_stars_repo_head_hexsha": "c034ddb1e3dc5e83da199aca2f2d8f6b2ff7a16f", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
%CVX_END_SET Completes a cvx set specification.
cvx_end
% Copyright 2010 Michael C. Grant and Stephen P. Boyd.
% See the file COPYING.txt for full copyright information.
% The command 'cvx_where' will show where this file is located.
| {"author": "goodshawn12", "repo": "REST", "sha": "e34ce521fcb36e7813357a9720072dd111edf797", "save_path": "github-repos/MATLAB/goodshawn12-REST", "path": "github-repos/MATLAB/goodshawn12-REST/REST-e34ce521fcb36e7813357a9720072dd111edf797/dependencies/BCILAB/dependencies/cvx-1.21.b795/commands/cvx_end_set.m"} |
# -*- coding: utf-8 -*-
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 20... | {"hexsha": "8c8c6bec930ed4d8ed4779dbcab7cac3cf6aebb1", "size": 41875, "ext": "py", "lang": "Python", "max_stars_repo_path": "idaes/core/util/model_statistics.py", "max_stars_repo_name": "OOAmusat/idaes-pse", "max_stars_repo_head_hexsha": "ae7d3bb8e372bc32822dcdcb75e9fd96b78da539", "max_stars_repo_licenses": ["RSA-MD"],... |
/*
*
* Crypto.BI Toolbox
* https://Crypto.BI/
*
* Author: José Fonseca (https://zefonseca.com/)
*
* Distributed under the MIT software license, see the accompanying
* file COPYING or http://www.opensource.org/licenses/mit-license.php.
*
*/
#include <cstdlib>
#include <boost/filesystem.hpp>
#include <iostream... | {"hexsha": "de6762ca67f5f737bbd74f9b80be61b5ee0a183f", "size": 384, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/00.includes.cpp", "max_stars_repo_name": "nwtechguy/toolbox", "max_stars_repo_head_hexsha": "a981ee6b371e92f1b18f11170e1c089b7c7f1364", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 30... |
# %% Load Annotations into dataframes
import hourglass
import imp
imp.reload(hourglass)
from hourglass import HourglassNet
from constants import *
import matplotlib.pyplot as plt
import os
# %matplotlib inline
h = HourglassNet(NUM_COCO_KEYPOINTS,DEFAULT_NUM_HG,INPUT_CHANNELS,INPUT_DIM,OUTPUT_DIM)
train_df, val_df = h.... | {"hexsha": "271017c4efc4b23a2fca09b648b034860d6bc48c", "size": 3362, "ext": "py", "lang": "Python", "max_stars_repo_path": "deprecated/run_evaluation.py", "max_stars_repo_name": "robertklee/SENG474-DataMining", "max_stars_repo_head_hexsha": "1996e263fb9a84d62ceab2b2402cbbcaf7a1e2d7", "max_stars_repo_licenses": ["MIT"],... |
#=====================================================
#Modified by: Augmented Startups & Geeky Bee AI
#Date : 22 April 2019
#Project: Yoga Angle Corrector/Plank Calc/Body Ratio
#Tutorial: http://augmentedstartups.info/OpenPose-Course-S
#=====================================================
import argparse
import loggi... | {"hexsha": "d2ca78e3c04e654c4a91c30aa8339282da94a536", "size": 9063, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_webcam-Template.py", "max_stars_repo_name": "ShreyaDadhich/Posture_Detection", "max_stars_repo_head_hexsha": "77a419c04b028c2faa365a9d337ac5463c79254d", "max_stars_repo_licenses": ["Apache-2.0... |
#!/usr/bin/env python3
"""tests for hello.py"""
import os.path
from os import path
import sys
from subprocess import getstatusoutput, getoutput
import numpy as np
import pytest
from bluesky_live.run_builder import RunBuilder
import databroker
from databroker_ls.ls import ls
from databroker_ls.catalog import Specif... | {"hexsha": "3a6d8dd23b8c4317dde62816596264b29a52f547", "size": 5938, "ext": "py", "lang": "Python", "max_stars_repo_path": "databroker_ls/tests/test.py", "max_stars_repo_name": "claracoo/databroker-ls", "max_stars_repo_head_hexsha": "03f6d0ce7bce489ab3e267773b9b77278adccfd7", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
section {* Abstract syntax for Hybrid CSP. *}
theory HHL
imports HCSP_Com
begin
consts
spec :: "fform => proc => fform => fform => prop" ("{_}_{_;_}" 80)
specP2 :: "fform => fform => proc => fform => fform => fform => fform => prop" ("{_, _}_{_, _ ; _, _}" 80)
specP3 :: "fform => fform => fform => proc => ff... | {"author": "bzhan", "repo": "mars", "sha": "d10e489a8ddf128a4cbac13291efdece458d732d", "save_path": "github-repos/isabelle/bzhan-mars", "path": "github-repos/isabelle/bzhan-mars/mars-d10e489a8ddf128a4cbac13291efdece458d732d/HHLProver/HHL.thy"} |
[STATEMENT]
lemma has_derivative_in_compose2:
assumes "\<And>x. x \<in> t \<Longrightarrow> (g has_derivative g' x) (at x within t)"
assumes "f ` s \<subseteq> t" "x \<in> s"
assumes "(f has_derivative f') (at x within s)"
shows "((\<lambda>x. g (f x)) has_derivative (\<lambda>y. g' (f x) (f' y))) (at x within ... | {"llama_tokens": 373, "file": null, "length": 2} |
# Grapheno was modified to accept non cudf entries and is working with rapids-0.17
import time
import cuml
import cudf
import cugraph
import cupy as cp
import numpy as np
from cupy.sparse import csr_matrix
def find_neighbors(X, n_neighbors, metric, algorithm, distributed):
"""
Returns the indices of the k-ne... | {"hexsha": "50ebc679b593b3470cb25c9d1de1ad33ddcb8c10", "size": 7785, "ext": "py", "lang": "Python", "max_stars_repo_path": "scFates/tools/grapheno_modified.py", "max_stars_repo_name": "LouisFaure/scTree", "max_stars_repo_head_hexsha": "4fcfed153eb3a123025c92cbd086df5baeaf42c4", "max_stars_repo_licenses": ["BSD-3-Clause... |
"""
voxel.py
-----------
Convert meshes to a simple voxel data structure and back again.
"""
import numpy as np
from . import ops
from . import transforms
from . import morphology
from . import encoding as enc
from .. import bounds as bounds_module
from .. import caching
from .. import transformations as tr
from ..... | {"hexsha": "1b190be979fdd18dc192a4a7992503b41d295f38", "size": 11802, "ext": "py", "lang": "Python", "max_stars_repo_path": "trimesh/voxel/base.py", "max_stars_repo_name": "avani17101/trimesh", "max_stars_repo_head_hexsha": "e9fcff42384734b2d13dc4c8f66eb9b319945995", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
SUBROUTINE formaa(vmfl,rmat,daatd)
!
! This subroutine modifies the dee matrix.
!
IMPLICIT NONE
INTEGER,PARAMETER::iwp=SELECTED_REAL_KIND(15)
REAL(iwp),INTENT(IN)::vmfl(:),rmat(:,:)
REAL(iwp),INTENT(OUT)::daatd(:,:)
REAL(iwp)::flowt(1,4),flowa(4,1)
flowt(1,:)=vmfl
flowa(:,1)=vmfl
daatd=MATMUL(MATMUL(MATMUL(... | {"hexsha": "f3bf497881db71091f93a0676494b19d5fdfeb49", "size": 374, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "main/formaa.f90", "max_stars_repo_name": "cunyizju/Programming-FEM-5th-Fortran", "max_stars_repo_head_hexsha": "7740d381c0871c7e860aee8a19c467bd97a4cf45", "max_stars_repo_licenses": ["MIT"], "max... |
import torch
from torch import Tensor
import numpy as np
import matplotlib.pyplot as plt
from botorch.acquisition.analytic import ExpectedImprovement
from botorch.models import SingleTaskGP
from rollout import rollout, rollout_quad
import warnings
import time
import pickle
warnings.filterwarnings("ignore")
bound = 1.... | {"hexsha": "79a6ed2d04f80d4beee2b00a1701a27197a1d006", "size": 3862, "ext": "py", "lang": "Python", "max_stars_repo_path": "enbo/util/test_rollout.py", "max_stars_repo_name": "shalijiang/bo", "max_stars_repo_head_hexsha": "af13f0a38b579ab504f49a01f1ced13532a3ad49", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
#include <boost/asio/basic_deadline_timer.hpp>
| {"hexsha": "776d2562f9c39464cb0e6a754b9b26ee2d5f016d", "size": 47, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_asio_basic_deadline_timer.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL... |
import os
import cv2
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from tensorflow.keras.preprocessing.image import load_img, img_to_array
from flask import Flask, request, render_template
from werkzeug.utils import secure_filename
from models import TB, Cancer, Covid, Mul... | {"hexsha": "b17708013f49c1e2119b4445c5ca6d6abece1ab4", "size": 2857, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "shivamtawari/XRayd-Ion-athon", "max_stars_repo_head_hexsha": "0e9235dd758f7f98d1f48d319df20cce0231fb19", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
# -*- coding: utf-8 -*-
from PIL import Image, ImageFilter
import random
import cv2
import skimage
from skimage import exposure
import numpy as np
class GaussianBlur(object):
"""Gaussian blur augmentation: https://github.com/facebookresearch/moco/"""
def __init__(self, sigma=[.1, 2.]):
self.sigma = sig... | {"hexsha": "4d8608adca2cb4a5a76a419f95fe6c28a0740254", "size": 3322, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_process/data_augment.py", "max_stars_repo_name": "Feezhen/Contrastive-learning", "max_stars_repo_head_hexsha": "9f7fc760c24ede2ffc485009ed787652551d0266", "max_stars_repo_licenses": ["MIT"], ... |
import sys, getopt, time
import pandas as pd
import sklearn
import numpy as np
import nltk
import re
import time
import codecs
import json
import joblib
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.neighbors import NearestNeighbors
from nltk.corpus import stopwords
class NumpyEncoder(json.J... | {"hexsha": "48d00bca7fdf9596feabb070251f6cc15aba2185", "size": 2505, "ext": "py", "lang": "Python", "max_stars_repo_path": "Marketplace/feed-service/recommendIdea.py", "max_stars_repo_name": "FoodStepsApp/FoodSteps", "max_stars_repo_head_hexsha": "3c048ecdfd5490f435090e50fd7638a518980823", "max_stars_repo_licenses": ["... |
'''
Author: Liweileev
Date: 2022-01-06 11:58:00
LastEditors: Liweileev
LastEditTime: 2022-01-10 01:50:43
'''
import numpy as np
import torch
import math
from torch_utils import training_stats
from torch_utils import misc
from torch_utils.ops import conv2d_gradfix
from sklearn.metrics import pairwise_distances as pdist... | {"hexsha": "b30174ce50015440d401c34725d56726689aaf7e", "size": 8174, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/style/training/loss.py", "max_stars_repo_name": "liweileev/SOMGAN", "max_stars_repo_head_hexsha": "11ec1c01b288a00f5a49906b9e683e67d3509701", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from phasIR.irtemp import centikelvin_to_celsius
from skimage.draw import disk
from scipy.signal import find_peaks, peak_widths
def pixel_intensity(sample_location, plate_location, frames, r=2):
'''
Function to find pixel intensity at a... | {"hexsha": "d4963374f6961b78fc0166e59063cb18f5844100", "size": 10709, "ext": "py", "lang": "Python", "max_stars_repo_path": "phasIR/thermal_analysis.py", "max_stars_repo_name": "MariaPoliti/phasIR", "max_stars_repo_head_hexsha": "281f7d8d99a0b2fd928f895bca2c9eb9b58991a6", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import numpy as np
import pandas as pd
from pathlib import Path
import os
import ipywidgets as widgets
from ipywidgets import Layout, Tab, Button, Label, Box, VBox, HBox, HTML, Output, Dropdown, BoundedIntText, Textarea, IntSlider, jslink, SelectMultiple
from IPython.display import display
dropdown_layout = Layout(wi... | {"hexsha": "409a30ac59a60e267b710f0ece91106aabba1539", "size": 8584, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/inference_widgets.py", "max_stars_repo_name": "dafrie/fin-disclosures-nlp", "max_stars_repo_head_hexsha": "aa89013a1b3c621df261d70cad16aeef15c34d25", "max_stars_repo_licenses": ["MIT"], "max_... |
import pygmt, math, re, time
import numpy as np
# READ TRAVEL TIME TABLE (JBTAB.PS)
def read_table(jbtab):
f = open(jbtab)
lines = []
for line in f:
line = line.strip('\n') #removing new line
line = re.sub(' +', ' ', line.lstrip()) #removing multiple spaces
lines.appe... | {"hexsha": "a12fa8984b1f8e3fbc0868600ad1ee7621ebf348", "size": 20854, "ext": "py", "lang": "Python", "max_stars_repo_path": "PLOT_STATIONS_PYTHON.py", "max_stars_repo_name": "epkasilag1/plotter", "max_stars_repo_head_hexsha": "790a3f0c8d29b85966c0cff97299216f51ff688d", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
#pragma once
#include "ast_adapted.hpp"
#include <boost/spirit/home/x3.hpp>
#include <boost/spirit/home/x3/support/utility/error_reporting.hpp>
namespace client {
namespace parser {
using quoted_string_type = boost::spirit::x3::rule<struct quoted_string_class, std::string>;
using message_type = boost::spirit::x3::r... | {"hexsha": "fa45bf9afcda9fc5ea3caecd40b67e93b9f09a28", "size": 435, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "merge/messages.hpp", "max_stars_repo_name": "zauguin/i18n-cpp", "max_stars_repo_head_hexsha": "3c9eaafe5e956b2e98cfd2f3c8f508420ff0f52c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 21.0, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.