text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
from skimage.io import imread
import numpy as np
import os
import numpy as np
from skimage.io import imread, imsave
from skimage.transform import resize, rotate
import random
from sklearn.model_selection import KFold
from sklearn.model_selection import train_test_split
import time
import torch
# Mohammad: Does scikit... | {"hexsha": "d7fcdbb60e8e87e66ba1768e65c39f916b45b8ba", "size": 992, "ext": "py", "lang": "Python", "max_stars_repo_path": "shapr/utils.py", "max_stars_repo_name": "marrlab/SHAPR_torch", "max_stars_repo_head_hexsha": "e1bf5525f315b5ebee55bbb87a9b66a12538edb7", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun... |
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import DBSCAN
Dataset=pd.read_csv(r'C:Datasets/Country-data.csv')
df=pd.get_dummies(Dataset)
X=Dataset.iloc[:,[3,5]].values
#plot
plt.sca... | {"hexsha": "5de4108b45b8fc84d9e530c353d4520fd9f0a06a", "size": 1071, "ext": "py", "lang": "Python", "max_stars_repo_path": "AI/Machine Learning/Unsupervised Learning/Anomaly Detection/DBSCAN.py", "max_stars_repo_name": "Chitra-devulapalli/OpenCV_Projects", "max_stars_repo_head_hexsha": "a473d4c39f95263c957df7125d32e645... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) IBM Corporation 2018
#
# 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
#
# U... | {"hexsha": "e70e9f8f68fa33c96f26edd9907a91f4b734220c", "size": 7012, "ext": "py", "lang": "Python", "max_stars_repo_path": "problems/seq_to_seq/algorithmic/maes_baselines/skip_recall_cl.py", "max_stars_repo_name": "aasseman/mi-prometheus", "max_stars_repo_head_hexsha": "c655c88cc6aec4d0724c19ea95209f1c2dd6770d", "max_s... |
module DataConvenience
import WeakRefStrings:StringVector
using DataFrames: AbstractDataFrame, DataFrame, rename, dropmissing
using CategoricalArrays
using Statistics
using Missings: nonmissingtype
import Statistics:cor
export cor, dfcor, @replicate, StringVector
include("cate-arrays.jl")
include("CCA.jl")
include(... | {"hexsha": "09ae1910a641059d77b110dc7a7e65db2a28d4af", "size": 934, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/DataConvenience.jl", "max_stars_repo_name": "xiaodaigh/DataConvenience", "max_stars_repo_head_hexsha": "e16049bf47357fcf4bb4f9d0dba271826884de02", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import numpy as np
import pandas as pd
import csv as csv
from sklearn.model_selection import cross_val_score
from sklearn.neural_network import MLPClassifier
# Training data
train_df = pd.read_csv('train.csv', header=0)
# Test data
test_df = pd.read_csv('test.csv', header=0)
# Convert back to numpy array
tr... | {"hexsha": "174717cb501609c3d007ac989075328476426a73", "size": 1262, "ext": "py", "lang": "Python", "max_stars_repo_path": "Digit Recognizer/train_with_neural_network.py", "max_stars_repo_name": "SakhawatSumit/Kaggle-Competitions-", "max_stars_repo_head_hexsha": "e2335beca6e2f8e3b2368b30f536cea4e7a9eb52", "max_stars_re... |
include("../utils.jl")
@testset "General group tests" begin
@testset "Not implemented operation" begin
G = GroupManifold(NotImplementedManifold(), NotImplementedOperation())
@test repr(G) == "GroupManifold(NotImplementedManifold(), NotImplementedOperation())"
x = [1.0, 2.0]
v = [2.... | {"hexsha": "3d11da00e5acda32f46a5d2852f9fbcb397e4b8d", "size": 8246, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/groups/groups_general.jl", "max_stars_repo_name": "manuelweisser/Manifolds.jl", "max_stars_repo_head_hexsha": "07f889a290ece01569c6c53bb0c96a5608923a0c", "max_stars_repo_licenses": ["MIT"], "m... |
from binance.client import Client
import numpy as np
from decimal import *
import time
from config_db import config_db
try:
import mysql.connector as mysql
except :
import MySQLdb as mysql
class crawlerDataBinance(object):
COIN_INFO_IDCOIN = 0
COIN_INFO_SYMBOL = 1
COIN_INFO_MINQTY = 2
COIN... | {"hexsha": "154dd41f4ab844d8851a6aacb68974fefeac2c32", "size": 4093, "ext": "py", "lang": "Python", "max_stars_repo_path": "crawler_data_binance.py", "max_stars_repo_name": "hung96ad/predict_price_cryptocurrencies", "max_stars_repo_head_hexsha": "c13a9560045c6c028c26cacda1d089cd21246aaa", "max_stars_repo_licenses": ["U... |
This editor can edit this entry and tell us a bit about themselves by clicking the Edit icon.
20060524 07:33:00 Welcome to the Wiki. Can you tell us more about your http://daviswiki.org/Cafe_Roma?actiondiff&date1148449360 statement on the Cafe Roma page? Users/JasonAller
Some elaboration based on things I know: C... | {"hexsha": "f94bfc88dc81476ca64f80d63cea47347dd05136", "size": 1915, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/DavisExile.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import argparse
from abc import ABC
from collections import OrderedDict, deque
from collections import namedtuple
from typing import Tuple
import gym
import gym_forex
import numpy as np
from numpy import array
import pytorch_lightning as pl
import torch
import torch.optim as optim
from torch import nn
fr... | {"hexsha": "43750bf1dd549867f04210e0a802b06b83e703ad", "size": 6407, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/Pytorch_Implimentation_2.py", "max_stars_repo_name": "Engineering-Geek/ForEx", "max_stars_repo_head_hexsha": "fbe53b33dfd540e20abb947829ecb06ebb1e20a8", "max_stars_repo_licenses": ["MIT"], "m... |
// OffAxisSource.h
// created by Kuangdai on 11-Nov-2017
// base class of off-axis source
#include "OffAxisSource.h"
#include "Geodesy.h"
#include "Quad.h"
#include "Domain.h"
#include "Element.h"
// TODO: implement this in core
// #include "OffAxisSourceTerm.h"
#include "Mesh.h"
#include "XMath.h"
#include "Spectral... | {"hexsha": "96870d346710ac5478aca751c15b85dde2c0f125", "size": 4395, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "SOLVER/src/preloop/source/offaxis/OffAxisSource.cpp", "max_stars_repo_name": "kuangdai/AxiSEM3D", "max_stars_repo_head_hexsha": "fd9da14e9107783e3b07b936c67af2412146e099", "max_stars_repo_licenses":... |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geogr... | {"hexsha": "cdc8e03b08e892382706c0a86c217638747a21f5", "size": 20523, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "boost_1_57_0/libs/geometry/test/algorithms/distance.cpp", "max_stars_repo_name": "MisterTea/HyperNEAT", "max_stars_repo_head_hexsha": "516fef725621991ee709eb9b4afe40e0ce82640d", "max_stars_repo_lic... |
# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License'). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' fil... | {"hexsha": "3fb8b6772527a938a6cd6dc8d821e2a793fdabbf", "size": 3365, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sagemaker_inference/decoder.py", "max_stars_repo_name": "nskool/sagemaker-inference-toolkit", "max_stars_repo_head_hexsha": "e8553693108b1965eef197159a561370e46b7610", "max_stars_repo_licenses... |
#!/usr/bin/env julia
function assertmsg(assertion, msg)
if !assertion
println("assert-ERROR: $msg")
exit(1)
else
println("assert-OK: $msg")
end
end
## expects string, returns decoded string
function process(inp)
rest = inp
outp = ""
loop = 0
println(" input=$inp")
m = match(r"^(.*?)\((\d+... | {"hexsha": "98ebe7207d2c0ed183abe4bc992f5cf724e7416a", "size": 1982, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "day09/day09_a.jl", "max_stars_repo_name": "kannix68/advent_of_code_2016", "max_stars_repo_head_hexsha": "785766f5e7d6ed24dfdb22a441956747749c36f8", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
# coding=utf-8
# Copyright 2019 The Authors of RL Reliability Metrics.
#
# 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 b... | {"hexsha": "ab1b80b6f9899e60ab1d22d57bb391dd11808547", "size": 2857, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl_reliability_metrics/analysis/plot_training_curves_test.py", "max_stars_repo_name": "tfboyd/rl-reliability-metrics", "max_stars_repo_head_hexsha": "0f517f43d5ef0b032b52dff9c2d38ac5db0da8af", "ma... |
#!python
import matplotlib.backend_tools
class PointerTool(matplotlib.backend_tools.ToolToggleBase):
description = 'Select nodes with left mouse, deselect with right, scroll to undo/redo'
image = "../lib/browser_images/pointer_25x25.png"
radio_group = 'default'
default_keymap = 's'
def __init__(... | {"hexsha": "70b2d8e8399ff548d008c6eb8e644f48e4281a61", "size": 5009, "ext": "py", "lang": "Python", "max_stars_repo_path": "ion_networks/sandbox_browser.py", "max_stars_repo_name": "swillems/ion_networks", "max_stars_repo_head_hexsha": "5304a92248ec007ac2253f246a3d44bdb58ae110", "max_stars_repo_licenses": ["MIT"], "max... |
from dataloader import RetinopathyLoader
from train import load_model
from sklearn.metrics import confusion_matrix
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
from tqdm import tqdm
import seaborn as sns
import torch.nn as nn
import numpy as np
import torch
import argparse
parser = argpars... | {"hexsha": "9bf59467fb1446c9d04daf735c6fde5600171b21", "size": 2593, "ext": "py", "lang": "Python", "max_stars_repo_path": "lab3/plot_confusion.py", "max_stars_repo_name": "joycenerd/Deep_Learning_Practice_labs", "max_stars_repo_head_hexsha": "3dde335825bd727c862364127734c7aa15aa3235", "max_stars_repo_licenses": ["MIT"... |
[STATEMENT]
lemma equiv_class_member:
assumes "x \<in> A"
and "\<approx>A `` {x} = \<approx>A `` {y}"
shows "y \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. y \<in> A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> A
\<approx>A `` {x} = \<approx>A `` {y}
goal (1 subgoal):
... | {"llama_tokens": 362, "file": "Myhill-Nerode_Myhill_2", "length": 5} |
/* Boost test/add.cpp
* test with symbolic operations if the addition algorithm is correct
*
* Copyright Guillaume Melquiond 2002-2003
* Permission to use, copy, modify, sell, and distribute this software
* is hereby granted without fee provided that the above copyright notice
* appears in all copies and th... | {"hexsha": "6d13b644fad950edb5bc6921ce2ce761ddd862ee", "size": 6811, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "sdk/boost_1_30_0/libs/numeric/interval/test/add.cpp", "max_stars_repo_name": "acidicMercury8/xray-1.0", "max_stars_repo_head_hexsha": "65e85c0e31e82d612c793d980dc4b73fa186c76c", "max_stars_repo_lice... |
from ResoFit.calibration import Calibration
from ResoFit.fitresonance import FitResonance
import numpy as np
import pprint
import matplotlib.pyplot as plt
from ResoFit.experiment import Experiment
import peakutils as pku
folder = 'data/IPTS_19558/reso_data_19558'
data_file1 = 'Gd_thin.csv'
data_file2 = 'Gd_thick.csv'
... | {"hexsha": "1498ddef44a3fe3a5afa6271ed63b761574012bb", "size": 1925, "ext": "py", "lang": "Python", "max_stars_repo_path": "ResoFit/data/IPTS_19558/ipts_preview_plot.py", "max_stars_repo_name": "ornlneutronimaging/ResoFit", "max_stars_repo_head_hexsha": "65c936d4736cbaf47260aaf7d03fca4d4bdc2c58", "max_stars_repo_licens... |
import json
from sklearn.metrics import roc_curve
import numpy as np
import matplotlib.pyplot as plt
def main():
labels = json.load(open('../models/benchmark_scores.json'))
on = labels['on_score']
off = labels['off_score']
yp = np.array(on + off)
y = np.array([1] * len(on) + [0] * len(off))
... | {"hexsha": "ae10a1817fa78411fdadcca3a894451a543a7e1c", "size": 840, "ext": "py", "lang": "Python", "max_stars_repo_path": "figures/roc_plot.py", "max_stars_repo_name": "ChrisBeaumont/brut", "max_stars_repo_head_hexsha": "f4223b84448d1db1b0e98e043dc6670adf05ee5d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6... |
"""Visualize flow from png files containing angle/magnitude."""
import argparse
import collections
import logging
from pathlib import Path
import numpy as np
from joblib import Parallel, delayed
from PIL import Image
from tqdm import tqdm
from utils.flow import compute_flow_color, load_flow_png
from utils.log import... | {"hexsha": "895ea4d3361d7f08128681b7deb80ab200d38e49", "size": 5798, "ext": "py", "lang": "Python", "max_stars_repo_path": "flow/visualize_angle_magnitude_flow.py", "max_stars_repo_name": "MSiam/segment-any-moving", "max_stars_repo_head_hexsha": "82cb782867d866d2f4eb68230edb75f613e15a02", "max_stars_repo_licenses": ["A... |
from scipy import misc
from skimage import color
import numpy as np
import os as os
if __name__ == "__main__":
path = "USPSdata/Numerals/"
count = 0
for i in range(10):
new_path = path
new_path = new_path + str(i) + "/"
for name in os.listdir(new_path):
final_pat... | {"hexsha": "3766a2bb2efbf2af67182733c5be07ccf23ffd0a", "size": 1100, "ext": "py", "lang": "Python", "max_stars_repo_path": "Project 3 - Neural Network and Tensor Flow/usps.py", "max_stars_repo_name": "JruvikaBhimani/CSE-547---Introduction-to-Machine-Learning", "max_stars_repo_head_hexsha": "3a8196cf9372cfbecbb043fc7ea9... |
# $Id$
#
# Copyright (C) 2000-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" command line utili... | {"hexsha": "0a150ebcfd52b5edbab443474681b7ce885c2afc", "size": 54886, "ext": "py", "lang": "Python", "max_stars_repo_path": "third_party_package/RDKit_2015_03_1/rdkit/ML/ScreenComposite.py", "max_stars_repo_name": "Ivy286/cluster_basedfps", "max_stars_repo_head_hexsha": "7fc216537f570436f008ea567c137d03ba2b6d81", "max_... |
#!/usr/bin/env python3
import cv2
import os
import sys
import time
import numpy as np
from openvino.inference_engine import IENetwork, IEPlugin
from multiprocessing import Process, Queue
import multiprocessing
import threading
import queue
infered_images = 0
class VideoCapture:
def __init__(self, name):
... | {"hexsha": "211320250b2ce9ec58a3635a400c5a81791d4702", "size": 7334, "ext": "py", "lang": "Python", "max_stars_repo_path": "async_api_multi-threads_multi-requests_multi-ncs.py", "max_stars_repo_name": "ArinToaca/Fast-Neural-Style-Transfer", "max_stars_repo_head_hexsha": "690d40d411cc9edd3ae74de3faf7e7a6feb737c4", "max_... |
"""
Title: Lane Detection Script
Author: Anton Elmiger
Created: 2020-05-27
Information: Lane Detection for different scenarios input scenarios (see constants.py)
"""
import cv2
import numpy as np
import socket
from sys import platform
import time
from signal import signal, SIGINT
from sys import exit
import l... | {"hexsha": "ea7c0ea636d121ee1b3f0d704ca7ca0426a0605b", "size": 7747, "ext": "py", "lang": "Python", "max_stars_repo_path": "lane_detection_script.py", "max_stars_repo_name": "aelmiger/lane_detection", "max_stars_repo_head_hexsha": "dc66d66c974f7b2f25204ab5f826af52b99ea847", "max_stars_repo_licenses": ["MIT"], "max_star... |
import numpy as np
def truthfunc(X):
f = 15
return 10-10*(np.tanh(X*2) + 0.15*np.sin(X*f))
truth_functions = [truthfunc]
thresholds = [0.7]
plot_rangedef = np.asarray([
[-1,1,100]
])
plotX = np.linspace(*plot_rangedef[0]).reshape(-1,1)
acq_rangedef = np.asarray([
[-1,1,100]
])
acqX = np.linspace(*ac... | {"hexsha": "25496425b9f20ab353f2e317d92b536424327d90", "size": 487, "ext": "py", "lang": "Python", "max_stars_repo_path": "excursion/testcases/oned_fast.py", "max_stars_repo_name": "lukasheinrich/excursion", "max_stars_repo_head_hexsha": "c6b91f65982cd33072c9d341ae330678a7d6606f", "max_stars_repo_licenses": ["Apache-2.... |
"""
This file initializes the IscaTools module by setting and determining the
ECMWF reanalysis parameters to be analyzed and the regions upon which the data
are to be extracted from. Functionalities include:
- Setting up of reanalysis module type
- Setting up of reanalysis parameters to be analyzed
- Setti... | {"hexsha": "446007c4e15657d95f9bbc235d8cc4460decf975", "size": 10886, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/analysis.jl", "max_stars_repo_name": "natgeo-wong/IscaTools.jl", "max_stars_repo_head_hexsha": "07beaa211480b2be50345c2a255d2beb137732ea", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#####
##### Building blocks for traversing a Hamiltonian deterministically, using the leapfrog
##### integrator.
#####
####
#### kinetic energy
####
"""
$(SIGNATURES)
Return kinetic energy `κ`, at momentum `p`.
"""
function kinetic_energy(κ::GaussianKineticEnergy{D,T,L}, p::PtrVector{D,T,L}, q = nothing) where {D,T,L... | {"hexsha": "82fd13974f55f24fc8dc661174a8bac41b27b29a", "size": 6218, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/kinetic_energy.jl", "max_stars_repo_name": "chriselrod/InplaceDHMC.jl", "max_stars_repo_head_hexsha": "571f1e79425b57d07b2ec759bd050f6d14241630", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
*----------------------------------------------------------------------*
subroutine set_cc_ipst_targets(tgt_info,orb_info)
*----------------------------------------------------------------------*
* set targets needed in CC ionized state calculations
*-----------------------------------------------------------... | {"hexsha": "e690f2ec0b48944ec30159da6b5c8262c018428e", "size": 10612, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "cc_spec/set_cc_ipst_targets.f", "max_stars_repo_name": "ak-ustutt/GeCCo-public", "max_stars_repo_head_hexsha": "8d43a6c9323aeba7eb54625b95553bfd4b2418c6", "max_stars_repo_licenses": ["MIT"], "max... |
[STATEMENT]
lemma domain_1'': "d (x \<cdot> y) \<le> d x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. d (x \<cdot> y) \<le> d x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. d (x \<cdot> y) \<le> d x
[PROOF STEP]
have "d (x \<cdot> y) = d (x \<cdot> d y)"
[PROOF STATE]
proof (prove)
goal ... | {"llama_tokens": 671, "file": "KAD_Domain_Semiring", "length": 10} |
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
% Package required to modify the line spacing
\usepackage{setspace}
\begin{document}
\section{Simple line spacing}
\lipsum[1]
\section{Half one line spacing}
\begin{onehalfspacing}
\lipsum[2]
\end{onehalfspacing}
\s... | {"hexsha": "eeaf72d8ad23cae240b36ed537413a86bd6d7c8e", "size": 418, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "compendium/page-layout/line-spacing.tex", "max_stars_repo_name": "ZenLulz/LatexCompendium", "max_stars_repo_head_hexsha": "cc623a88ab05ca90430338333003293baea00f8c", "max_stars_repo_licenses": ["MIT"... |
import numpy as np
import ipdb
def nms(scores, overlaps, th):
idx = []
N = len(scores)
if len(scores) < 1:
return idx
assert N == overlaps.shape[0] and N == overlaps.shape[1]
scores = np.array(scores)
sidx = np.argsort(scores)[::-1]
idx.append(sidx[0]) # retain the idx c.t. the h... | {"hexsha": "7cd13444318986ffcc856c3b5959ee3987d62e69", "size": 12349, "ext": "py", "lang": "Python", "max_stars_repo_path": "track_utils.py", "max_stars_repo_name": "jalayrac/weakactionloc", "max_stars_repo_head_hexsha": "53a50fa6128bd873190ad783482a884dfe8a453f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
from eodatadown.eodatadownuseranalysis import EODataDownUserAnalysis
from eodatadown.eodatadownutils import EODataDownUtils
import rsgislib
import rsgislib.vectorutils
import rsgislib.imagecalc
import rsgislib.rastergis
import rsgislib.rastergis.ratutils
import rsgislib.imageutils.imagelut
import rsgislib.imageutils
i... | {"hexsha": "2d3e5bd6363896b07c0b5495ef8ebc75c98f2541", "size": 20697, "ext": "py", "lang": "Python", "max_stars_repo_path": "eodd_plugins/landsat/landsat_gmw_chng.py", "max_stars_repo_name": "globalmangrovewatch/gmw_monitoring_demo", "max_stars_repo_head_hexsha": "3c8c5df275b2088577f080eb8aaf517cb82927f3", "max_stars_r... |
import os
import subprocess
import time
import logging
import numpy as np
import mss
import mouse
from logger import Logger
from config import Config
from screen import Screen
from template_finder import TemplateFinder
LauncherExeName = "Diablo II Resurrected Launcher.exe"
BnetExeName = "Battle.net.exe"
GameExeName =... | {"hexsha": "4a606f4629b3897bed1c3690fe863678007d7e74", "size": 6013, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/game_restart.py", "max_stars_repo_name": "joexzh/botty", "max_stars_repo_head_hexsha": "6249df462d2f34a9c8eb5a1addb2c8eb9a8c822b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
passive component C {
telemetry T: U32 low { red 0, red 1 }
}
| {"hexsha": "a01d90dac8f4a24e82b2154e51b3e08483fd3d73", "size": 66, "ext": "fpp", "lang": "FORTRAN", "max_stars_repo_path": "compiler/tools/fpp-check/test/tlm_channel/duplicate_limit_low.fpp", "max_stars_repo_name": "kevin-f-ortega/fpp", "max_stars_repo_head_hexsha": "ee355fc99eb8040157c62e69f58ac6a8435cd981", "max_star... |
import io
import itertools
import pytest
from pandas.util.testing import (
assert_series_equal, assert_frame_equal, assert_index_equal)
from numpy.testing import assert_array_equal
import pandas as pd
import numpy as np
import matplotlib.figure
import matplotlib.pyplot as plt
from matplotlib.text import Text
from ... | {"hexsha": "a1631f3adb9116771811e3ae91e5b13f183d3505", "size": 35671, "ext": "py", "lang": "Python", "max_stars_repo_path": "upsetplot/tests/test_upsetplot.py", "max_stars_repo_name": "ipa-maa/UpSetPlot", "max_stars_repo_head_hexsha": "70fe97099b37afc1acbefe35a421e8ee17f98ad2", "max_stars_repo_licenses": ["BSD-3-Clause... |
"""Reinforcement learning agent."""
import numpy as np
from numba import jit
import _thread
import datetime
import json
import sys
from game.hexus import Hexus
from game.qtable import end_transaction, QTable
class Agent(object):
"""Agent is the reinforcement learning agent that learns optimal state action pa... | {"hexsha": "49a4f9bb70c484b139af1d595de63f5cfa15261d", "size": 9745, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl/agent.py", "max_stars_repo_name": "mattrwh-pC506/hexus-training-grounds", "max_stars_repo_head_hexsha": "98036547595ecca269c21644c272a4ac4198e1dc", "max_stars_repo_licenses": ["MIT"], "max_star... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class DiceCELoss(nn.Module):
def __init__(self):
super(DiceCELoss, self).__init__()
def forward(self, predicted, target, num_classes=3):
# target's shape: batchsize, height, width
# predicted's shape... | {"hexsha": "d50336a641762b9ff3f2acf7bff8556d3d775d6e", "size": 1836, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup/loss.py", "max_stars_repo_name": "daoducanhc/Weed-and-Plant_Segmentation", "max_stars_repo_head_hexsha": "3bf7900409a49bac4e60e54fc31431b5720a9f15", "max_stars_repo_licenses": ["MIT"], "max_... |
""" Script for end-to-end training of the T2F model """
import datetime
import time
import torch as th
import numpy as np
import data_processing.DataLoader as dl
import argparse
import yaml
import os
import pickle
import timeit
from torch.backends import cudnn
from torch.nn.functional import avg_pool2d
# define the de... | {"hexsha": "508992c453b94a08f9d86f9ab6f058638d95772a", "size": 16966, "ext": "py", "lang": "Python", "max_stars_repo_path": "implementation/train_network.py", "max_stars_repo_name": "phuocnguyen2008/T2F_MSG_GAN", "max_stars_repo_head_hexsha": "16088d17c9a44de0b60563f16abf42320ffd554c", "max_stars_repo_licenses": ["MIT"... |
import os
import numpy as np
from sklearn import neighbors
import pandas as pd
filename = "data.txt"
file = open(filename,'r')
x_data = []
y_data = []
num = 0
for eachline in file:
eachline = eachline.split(os.linesep)[0]
data = eachline.split(',')
y_data.append(float(data[0]))
x_data.append([])
... | {"hexsha": "ef5020551f500b8617600d9bf1b79f533c97cf5e", "size": 1574, "ext": "py", "lang": "Python", "max_stars_repo_path": "demo/platform/f/laji/knn/main/knn.py", "max_stars_repo_name": "12hyhy12/cloud-recommender", "max_stars_repo_head_hexsha": "27ed4ab4adffb5d610161821e48e1d361f788dc8", "max_stars_repo_licenses": ["A... |
# Copyright 2019 Google Inc. All Rights Reserved.
#
# 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 ... | {"hexsha": "3be126afbbf27451878a6e6dafc759d7fa180187", "size": 5617, "ext": "py", "lang": "Python", "max_stars_repo_path": "dlvm/nvidia/webapp/server.py", "max_stars_repo_name": "dlminvestments/ml-on-gcp", "max_stars_repo_head_hexsha": "b5cd889951a53a5300521c58854dece554aa3813", "max_stars_repo_licenses": ["Apache-2.0"... |
import operator
from copy import deepcopy
import cv2
import numpy as np
from matplotlib import pyplot as plt
from numpy import asarray
# from highway_disagreements.get_agent import ACTION_DICT
from PIL import ImageFont, ImageDraw, Image
def get_marked_frames(trajectories, config, static_position=None,
... | {"hexsha": "e5b0f96c575846b74d00216309bb61d87fa1e72c", "size": 4675, "ext": "py", "lang": "Python", "max_stars_repo_path": "contrastive_highlights/mark_agents.py", "max_stars_repo_name": "yotamitai/Contrastive_Highlights", "max_stars_repo_head_hexsha": "fb485a53a6810b781b15a2e610bf86db97048873", "max_stars_repo_license... |
#!/usr/bin/python
#burn_in.py
'''
Functions for testing burn-in stationarity.
'''
# other imports
import numpy as np
from numpy import random as r
from matplotlib import colors
import matplotlib.pyplot as plt
from scipy import interpolate
from scipy.spatial import cKDTree
from collections import Counter as C
from sci... | {"hexsha": "6a244c91fce492664314ad6627d8149dc37a7115", "size": 3405, "ext": "py", "lang": "Python", "max_stars_repo_path": "build/lib/geonomics/sim/burnin.py", "max_stars_repo_name": "AnushaPB/geonomics-1", "max_stars_repo_head_hexsha": "deee0c377e81f509463eaf6f9d0b2f0809f2ddc3", "max_stars_repo_licenses": ["MIT"], "ma... |
# Rebuttal figure 1c analysis of data and perform Test for Significance on EPSC
# amplitude across conditions
# Requires installation of packages: 'Skillings.Mack'
library(Skillings.Mack)
library(ggplot2)
df = read.csv('data/data_rebuttal_fig1.csv')
# subset for all DPDPE experiments with a baseline value
df_DPDPE = d... | {"hexsha": "400c81bc1b4ed370c8546a25b0c1bd971334e760", "size": 7860, "ext": "r", "lang": "R", "max_stars_repo_path": "analyze_rebuttal_experiments.r", "max_stars_repo_name": "elifesciences-publications/opi_syn_circuit", "max_stars_repo_head_hexsha": "a361e5d87392e997804605352971d3a5e07e286e", "max_stars_repo_licenses":... |
from __future__ import print_function
from __future__ import absolute_import
from past.builtins import basestring
import moby2
import numpy as np
import os
from . import tools
class WeatherChannel(tools.AuxChannel):
"""
Class for loading and reduction of APEX weather data.
"""
def __init__(self, chan... | {"hexsha": "4b88b17a52fcde2a87ca126b1686963b67d02387", "size": 2995, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/aux_data/apex.py", "max_stars_repo_name": "ACTCollaboration/moby2", "max_stars_repo_head_hexsha": "b0f6bd6add7170999eb964d18f16d795520426e9", "max_stars_repo_licenses": ["BSD-2-Clause"], "m... |
#!/usr/bin/env python
import itertools
from io import StringIO
from urllib.parse import urlparse
import time
from bs4 import BeautifulSoup
import numpy as np
import pandas as pd
import requests
from nfldfs import utils as utils
# Function to create game search parameters
def find_games(dfs_site, season_from, week_... | {"hexsha": "cec0b0a85ca6c1e8230bb23666a0e719b5e2761f", "size": 4576, "ext": "py", "lang": "Python", "max_stars_repo_path": "nfldfs/games.py", "max_stars_repo_name": "gilbertkyle/nfldfs", "max_stars_repo_head_hexsha": "e54a2f69cc8b4039adf33d0a12a13494292f204e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
import json
import logging
import logging.config
import os, sys, inspect, time
PARENT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.join(PARENT_DIR, 'helper_functions'))
import pandas as pd
import numpy as np
from pandas_datareader import data, wb
import datetime
import sci... | {"hexsha": "1b1a87cadf219cdb800f3274f6a26e6de82ee2e1", "size": 3335, "ext": "py", "lang": "Python", "max_stars_repo_path": "helper_functions/python_finance.py", "max_stars_repo_name": "cleveranjos/Rapid-ML-Gateway", "max_stars_repo_head_hexsha": "10a14abfce3351791331642c47eddfbf622e76d2", "max_stars_repo_licenses": ["M... |
# -*- coding: utf-8 -*-
"""
@author: Raymond F. Pauszek III, Ph.D. (2020)
smtirf >> hmm >> models
"""
import numpy as np
import json
from .. import SMJsonEncoder, SMJsonDecoder
from . import row, col, normalize_rows, ExitFlag
from . import algorithms as hmmalg
from .distributions import *
from . import hyperparameters ... | {"hexsha": "4376cbfe4d62d3ecfbba59936ed3a706d210197f", "size": 10330, "ext": "py", "lang": "Python", "max_stars_repo_path": "hmm/models.py", "max_stars_repo_name": "rpauszek/smtirf", "max_stars_repo_head_hexsha": "236a78fe1feba14bda517d72e1eb8396a616dfc4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def births(path):
"""US Births
Number of births each day from 1968 to ... | {"hexsha": "cf191955b6375f880fb5dec8aa88455c6b5dfcdd", "size": 1753, "ext": "py", "lang": "Python", "max_stars_repo_path": "observations/r/births.py", "max_stars_repo_name": "hajime9652/observations", "max_stars_repo_head_hexsha": "2c8b1ac31025938cb17762e540f2f592e302d5de", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
{-
Definition of the torus as a HIT together with a proof that it is
equivalent to two circles
-}
{-# OPTIONS --cubical --safe #-}
module Cubical.HITs.Torus.Base where
open import Cubical.Core.Glue
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorph... | {"hexsha": "71fdd013cee661b557c0001a00671d759685ee64", "size": 3297, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Cubical/HITs/Torus/Base.agda", "max_stars_repo_name": "cj-xu/cubical", "max_stars_repo_head_hexsha": "7fd336c6d31a6e6d58a44114831aacd63f422545", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# Preprocess images
from scipy import misc
from scipy.ndimage.measurements import center_of_mass
import numpy as np
import os
from os.path import isfile, isdir
class ProgBar(object):
def __init__(self):
self.counter = 0
def progress(self):
self.counter += 1
print('.', end = ''... | {"hexsha": "22adfdf1975336498e63384e2a3eeadd63781ec6", "size": 1768, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocess.py", "max_stars_repo_name": "coolioasjulio/DevanagriRecognizer", "max_stars_repo_head_hexsha": "ed25c6f331cde2a19187cb7bd40790db069f469c", "max_stars_repo_licenses": ["MIT"], "max_stars... |
"""
This is an implementation of the mini-batch gradient descent algorithm for a linear perceptron model
The class model is based off of sklearn:
http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Perceptron.html
"""
import numpy as np
from koko.optimization import minibatch_gradien... | {"hexsha": "529db5fd961fe41d278c2ebe161b739b5bd97cea", "size": 2542, "ext": "py", "lang": "Python", "max_stars_repo_path": "koko/classifiers/linear_perceptron.py", "max_stars_repo_name": "bhillmann/koko", "max_stars_repo_head_hexsha": "46825bb3e579c949c1700564c13186c46cf4b4f7", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma splay_Leaf_iff[simp]: "(splay a t = Leaf) = (t = Leaf)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (splay a t = \<langle>\<rangle>) = (t = \<langle>\<rangle>)
[PROOF STEP]
by(induction a t rule: splay.induct) (auto split: tree.splits) | {"llama_tokens": 108, "file": "Splay_Tree_Splay_Tree", "length": 1} |
; 2002-03-31 earl
; * fixed url-encoding matters
; 2003-05-23 earl
; * title-only -> full search change
make object! [
doc: "redirects to a snip specified in name or snip-name"
handle: func [name /local target] [
if error? try [ target: any [name snip-name] ] [return ""]
either space-... | {"hexsha": "80d706252753f104c72c78169b7e17f67c69f6c4", "size": 533, "ext": "r", "lang": "R", "max_stars_repo_path": "code/apps/alias.r", "max_stars_repo_name": "earl/vanilla", "max_stars_repo_head_hexsha": "76e3b6196820810690aa113362dc1c4f34381b85", "max_stars_repo_licenses": ["AFL-2.0"], "max_stars_count": 4, "max_sta... |
from astropy.io import fits
from numpy import *
import glob
minimum_time = 20 # In seconds
for fltname in glob.glob("*_flt.fits"):
fflt = fits.open(fltname)
print(fflt[0].header["EXPTIME"])
print(fflt.info())
fima = fits.open(fltname.replace("_flt.", "_ima."))
print(fima.info())
... | {"hexsha": "d924329fea84fe028e5f8c5220736d3306551240", "size": 1204, "ext": "py", "lang": "Python", "max_stars_repo_path": "ima_to_flt.py", "max_stars_repo_name": "rubind/ima_to_flt", "max_stars_repo_head_hexsha": "7b92d24661d6a6ca2b1d037e8c8bc0cd824ebcf1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
"""
Utils related to the least squared regression.
"""
import numpy as np
from sklearn.linear_model import LinearRegression
def mse_loss(linear_o, y):
"""Returns a vector of mean squared errors of each object.
Given a vector of linear ouputs a vector of ground truth target values y
returns squared resid... | {"hexsha": "8bef78c61ce6b49cbba7e0918792f3621ab64bb0", "size": 892, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/objectives/mse.py", "max_stars_repo_name": "Bihaqo/exp-machines", "max_stars_repo_head_hexsha": "cec6163d67cb813bd06a5d0c1d4e94778538c31e", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
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 agr... | {"hexsha": "276322d8393e0e5871c9427892139375bdf7a416", "size": 3330, "ext": "py", "lang": "Python", "max_stars_repo_path": "oneflow/ir/test/OneFlow/folding/test_simple_multiply.py", "max_stars_repo_name": "triple-Mu/oneflow", "max_stars_repo_head_hexsha": "395da40885016d0b899f8a1eb87e5311a556a9b8", "max_stars_repo_lice... |
#(When threading works, not yet):
# To get the benefit of threading start julia with multiple threads:
# JULIA_NUM_THREADS=x julia (where you choose x)
#A multiprocess write method for saving large image sequences in NRRD format
#This function is useful when retrieving a stack from img takes a lot of time ... | {"hexsha": "e39b9f6bb9e1066a6a60b9c26f2861d5bf7533f1", "size": 2640, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/write_to_disk.jl", "max_stars_repo_name": "HolyLab/StitchDPI.jl", "max_stars_repo_head_hexsha": "74ab52bb7dd4b845a08cd9548af5be6ad2d91d94", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
module FastbackTests
using Test
using Dates
using Fastback
include("permute.jl")
include("bidask.jl")
include("position.jl")
include("collectors.jl")
include("account.jl")
end
| {"hexsha": "c22a309e9fb5a51a2d249fd22ad82410c80618b8", "size": 179, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "rbeeli/fastback.jl", "max_stars_repo_head_hexsha": "a5f766e4a45ef85b54ce876ab17983e61a8a33e6", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
[STATEMENT]
lemma subdistl_iso:
fixes f :: "'a \<Rightarrow> 'b::complete_lattice"
shows "(f \<circ> Inf \<le> Inf \<circ> (`) f) = mono f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (f \<circ> Inf \<le> Inf \<circ> (`) f) = mono f
[PROOF STEP]
using Inf_subdistl_iso iso_Inf_subdistl
[PROOF STATE]
proof (pr... | {"llama_tokens": 237, "file": "Order_Lattice_Props_Order_Lattice_Props", "length": 2} |
# functions that implement analysis and synthesis of sounds using the Stochastic Model
# (for example usage check stochasticModel_function.py in the models_interface directory)
import numpy as np
from scipy.signal import hanning, resample
from scipy.fftpack import fft, ifft
import utilFunctions as UF
def stochasticMo... | {"hexsha": "6b713dc2c856d444c8d45987ba71afbd06033ef2", "size": 7179, "ext": "py", "lang": "Python", "max_stars_repo_path": "extra_dependencies/models/stochasticModel.py", "max_stars_repo_name": "SubramaniKrishna/VaPar-Synth", "max_stars_repo_head_hexsha": "51ce07de856365f9c3c9637c048eacbb70d5f38a", "max_stars_repo_lice... |
import numpy as np
import tensorflow as tf
class Transform(object):
def forward(self, x):
"""
Map from the free-space to the variable space, using numpy
"""
raise NotImplementedError
def backward(self, y):
"""
Map from the variable-space to the free space, using ... | {"hexsha": "87ccd556243212d4dbf149200789e3f2e30cc6d0", "size": 2242, "ext": "py", "lang": "Python", "max_stars_repo_path": "GPflow/transforms.py", "max_stars_repo_name": "ShuaiW/GPflow", "max_stars_repo_head_hexsha": "7383014e75d78512db58cfcd5cc9c1777d435abf", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count... |
subroutine nplotter(p,wt,wt2,nd)
c--- Variable passed in to this routine:
c
c--- p: 4-momenta of leptons and jets in the format p(i,4)
c--- with the particles numbered according to the input file
c--- and components labelled by (px,py,pz,E)
c
c--- wt: weight of this event
c
c--- wt... | {"hexsha": "154f7932b98e9126a5d540be0caa53396beba2b2", "size": 5924, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "MCFM-JHUGen/src/User/nplotter.f", "max_stars_repo_name": "tmartini/JHUGen", "max_stars_repo_head_hexsha": "80da31668d7b7eb5b02bb4cac435562c45075d24", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
import matplotlib.pyplot as plt
import numpy as np
import os
import torch
from matplotlib.offsetbox import AnchoredOffsetbox, TextArea, VPacker
from mmm import DataHandler as DH
from mmm import GeotagGCN
from mmm import GeoUtils as GU
from mmm import VisGCN
from PIL import Image
from torchvision import transforms
from ... | {"hexsha": "8472f0b5c494372ceeb09ea8a2aeb50399d7c54e", "size": 14080, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/and_results.py", "max_stars_repo_name": "Umb1ife/Research", "max_stars_repo_head_hexsha": "d0c7d10f4bee56b9630e1971e504cbb6f088e715", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
### IDONE uses a piece-wise linear surrogate model for optimization of
### expensive cost functions with integer variables.
###
### IDONE_minimize(obj, x0, lb, ub, max_evals) solves the minimization problem
###
### min f(x)
### st. lb<=x<=ub, x is integer
###
### where obj is the objective function, x0 the initial gues... | {"hexsha": "530f900bc3e056e5f1cd84610e0326dbc5d6a80b", "size": 11477, "ext": "py", "lang": "Python", "max_stars_repo_path": "expensiveoptimbenchmark/solvers/IDONE/IDONE.py", "max_stars_repo_name": "AlgTUDelft/ExpensiveOptimBenchmark", "max_stars_repo_head_hexsha": "642056f8d94c7f953e50c3cd05bbbf9f39ad5c3d", "max_stars_... |
// Copyright 2021 PickNik Inc.
//
// 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 conditions and the following discl... | {"hexsha": "8ef705a832b35008529900605e61b04936b926f5", "size": 5461, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/rviz_visual_tools/imarker_simple.hpp", "max_stars_repo_name": "ros2-gbp/rviz_visual_tools-release", "max_stars_repo_head_hexsha": "c745e89389b04c825900c2220126b4feaa350489", "max_stars_repo_... |
import csv
import numpy as np
import theano
import theano.tensor as T
import operator
import nltk
import itertools
from datetime import datetime
from rnn_numpy import RNN,train_with_sgd
vocabulary_size=8000
unknown_token='UNKOWN_TOKEN'
sentence_start_token='SENTENCE_START'
sentence_end_token='SENTENCE_END'
# Read t... | {"hexsha": "75978e30b9bfb4543ea3d63260b275cb51b19c14", "size": 3063, "ext": "py", "lang": "Python", "max_stars_repo_path": "RNN_Tutorial/train_numpy.py", "max_stars_repo_name": "jiangnanhugo/SimpleRNN", "max_stars_repo_head_hexsha": "0de55c302ba11a8eb4eb9004ce46b5bbb5ad179a", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma r2f_rtrancl_hom: "\<F> (rtrancl R) = kstar (\<F> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<F> (R\<^sup>*) = kstar (\<F> R)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<F> (R\<^sup>*) = kstar (\<F> R)
[PROOF STEP]
have "\<F> (rtrancl R) = \<F> (\<Union>i. R ^^ i... | {"llama_tokens": 784, "file": "Transformer_Semantics_Kleisli_Quantaloid", "length": 10} |
#!/usr/bin/env python3
import os
import lib
from lib import StatTracker
import torch
import shutil
import matplotlib.pyplot as plt
import numpy as np
import itertools
from mpl_toolkits.axes_grid1 import make_axes_locatable
from lib.common import group
runs = lib.get_runs(["cifar10"])
BASE_DIR = "out/cifar10_confusion... | {"hexsha": "a462ad43e781edc878f587a793f93f0a6cb748ee", "size": 3639, "ext": "py", "lang": "Python", "max_stars_repo_path": "paper/plot_cifar10_confusion_diff.py", "max_stars_repo_name": "RobertCsordas/modules", "max_stars_repo_head_hexsha": "efdb8790b074862581e035c9ab5bf889440a8023", "max_stars_repo_licenses": ["BSD-3-... |
# Copyright 2018 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | {"hexsha": "805764dfe6487216945840072a5a6a0e0912726f", "size": 34230, "ext": "py", "lang": "Python", "max_stars_repo_path": "response_model/python/metric_learning/end_to_end/testing.py", "max_stars_repo_name": "googlearchive/rgc-models", "max_stars_repo_head_hexsha": "0dea94bbd54f591d82d95169e33d40bb55b6be94", "max_sta... |
// see LICENSE.txt
#pragma once
#include <boost/filesystem/path.hpp>
#include <fc/io/json.hpp>
#include <graphene/app/application.hpp>
#include <graphene/chain/database.hpp>
#include <graphene/chain/operation_history_object.hpp>
#include <graphene/chain/committee_member_object.hpp>
#include <graphene/utilities/temp... | {"hexsha": "3dadf76593ea37f94ba564b98950cd013a25104b", "size": 16989, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "tests/common/database_fixture.hpp", "max_stars_repo_name": "EDCBlockchain/blockchain", "max_stars_repo_head_hexsha": "41c74b981658d79d770b075191cfb14faeb84dab", "max_stars_repo_licenses": ["MIT"], ... |
[STATEMENT]
lemma (in Semilat) merges_bounded_lemma:
"\<lbrakk> mono r step n A; bounded step n;
\<forall>(p',s') \<in> set (step p (ss!p)). s' \<in> A; ss \<in> list n A; ts \<in> list n A; p < n;
ss [\<sqsubseteq>\<^sub>r] ts; \<forall>p. p < n \<longrightarrow> stable r step ts p \<rbrakk>
\<Longrighta... | {"llama_tokens": 6698, "file": "JinjaThreads_DFA_Kildall", "length": 22} |
[STATEMENT]
lemma allocationUnion:
assumes "a1 \<in> allocationsUniverse"
"a2 \<in> allocationsUniverse"
"(\<Union> (Range a1)) \<inter> (\<Union> (Range a2)) = {}"
"(Domain a1) \<inter> (Domain a2) = {}"
shows "a1 \<union> a2 \<in> allocationsUniverse"
[PROOF STATE]
proof (prove)
... | {"llama_tokens": 7123, "file": "Vickrey_Clarke_Groves_Universes", "length": 60} |
#include "backends.hpp"
#include <exception>
#include <armadillo>
#include <string>
using namespace std;
using namespace arma;
string EDFBackend::mrn_to_array_name(string mrn)
{
return _mrn_to_array_name(mrn, ".edf");
}
ArrayMetadata EDFBackend::get_array_metadata(string mrn)
{
if (is_cached_array(mrn))
{... | {"hexsha": "b401ddfd64370e5c0b38b6906e882d8ee36972b3", "size": 3462, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "toolkit/toolkit/storage/edf_backend.cpp", "max_stars_repo_name": "joshblum/eeg-toolkit", "max_stars_repo_head_hexsha": "20b54ad0c511480626b0757bb1c56d4b541fca20", "max_stars_repo_licenses": ["MIT"],... |
import pickle, torch
import numpy as np
import pandas as pd
target_epsilons = [1.1, 2.0, 4.0, 8.0, 14.0]
anticipated_Ts = [2, 5, 10, 20]
models_dict = {}
for eps in target_epsilons:
models_dict[eps] = pickle.load(open('./res/models_2019-11-05_{}.p'.format(eps), 'rb'))
X_test = pd.read_csv('./onehotted_data/encoded_... | {"hexsha": "f78b875cd08e7f11f3b38a7af4c551c73ebf3d8d", "size": 1412, "ext": "py", "lang": "Python", "max_stars_repo_path": "adult/dp_logistic_regression_onehot/classify_anticipated.py", "max_stars_repo_name": "DPBayes/data-sharing-examples", "max_stars_repo_head_hexsha": "f9fffc5b8f45d8dd7b93cb7e812439decfa51193", "max... |
//
// GraphTools library
// Copyright 2017-2019 Illumina, Inc.
// All rights reserved.
//
// Author: Felix Schlesinger <fschlesinger@illumina.com>
//
// 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 Lic... | {"hexsha": "1dfb2e43a764ea01f1944bf46ac041307ee4ebcb", "size": 4647, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "ehunter/thirdparty/graph-tools-master-f421f4c/src/graphio/GraphJson.cpp", "max_stars_repo_name": "bw2/ExpansionHunter", "max_stars_repo_head_hexsha": "6a6005a4bae2c49f56ec8997a301b70a75b042b6", "max... |
import fsspec
import intake # must be v 0.6.2
import xarray as xr
import pandas as pd
import os as os
import numpy as np
# An example of how to get the weighted area
# https://nordicesmhub.github.io/NEGI-Abisko-2019/training/Example_model_global_arctic_average.html
## The url path that contains to the pangeo archive... | {"hexsha": "8693015aae9c566b1e66a8fc3d51200cbb6ba18b", "size": 4757, "ext": "py", "lang": "Python", "max_stars_repo_path": "tos/HL_LL_global/0.global_tos.py", "max_stars_repo_name": "kdorheim/2022-hectorv3-data-needs", "max_stars_repo_head_hexsha": "07b756b6d9c70f705bb0ffe60a9c32aa2eaf8e21", "max_stars_repo_licenses": ... |
"""Utilities around opening and processing netcdfs from this project."""
import numpy as np
import pathlib
from typing import Union, Tuple, Optional, Literal
import xarray as xr
from uncertainties import ufloat
from src.plot_utils import add_units
from src.constants import SEL_DICT, MASK
def fix_calendar(
xr_in: ... | {"hexsha": "6a2df53f4fc3af41bec90e04f11f5e0db859047c", "size": 17331, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/xr_utils.py", "max_stars_repo_name": "sdat2/seager19", "max_stars_repo_head_hexsha": "9c3acbc5332da787de1eda2600a82490ff20fa11", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "max... |
[STATEMENT]
lemma complements_iso_unit_register: \<open>iso_register I \<Longrightarrow> is_unit_register U \<Longrightarrow> complements I U\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>iso_register I; is_unit_register U\<rbrakk> \<Longrightarrow> complements I U
[PROOF STEP]
using complements_sy... | {"llama_tokens": 279, "file": "Registers_Laws_Complement", "length": 2} |
import numpy as np
import pandas as pd
from model import MainClauseModel
class MainClauseExperiment(object):
def __init__(self, data, seed=25472):
self._data = data
self._seed = seed
np.random.seed(seed)
def _initialize_models(self):
self._models = {c: [MainClauseModel()
... | {"hexsha": "7f240f901734afa5e9f7e693664de6871024da59", "size": 3343, "ext": "py", "lang": "Python", "max_stars_repo_path": "mainclausemodel/experiment.py", "max_stars_repo_name": "z-n-huang/SyntacticBootstrappingModel", "max_stars_repo_head_hexsha": "6c2c7a46d7964ea8deac403f47a87b566e2acad2", "max_stars_repo_licenses":... |
# Copyright(c) 2019-2020 Intel Corporation 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 condition... | {"hexsha": "7006ed71317775974197d8422ff224edfdfa01ac", "size": 9264, "ext": "py", "lang": "Python", "max_stars_repo_path": "nxsdk_modules_ncl/epl/src/computeResults.py", "max_stars_repo_name": "biagiom/models", "max_stars_repo_head_hexsha": "79489a3c429b3027dd420840bbccfee5e8c9a879", "max_stars_repo_licenses": ["BSD-3-... |
-- Si a es un punto de acumulación de la sucesión de Cauchy u, entonces a es el límite de u
-- ========================================================================================
import data.real.basic
variable {u : ℕ → ℝ}
variables {a : ℝ}
variable {φ : ℕ → ℕ}
-- ---------------------------------------------... | {"author": "jaalonso", "repo": "DAO_con_Lean", "sha": "1888a830871f358075ac712fc15bbf8b6806ac96", "save_path": "github-repos/lean/jaalonso-DAO_con_Lean", "path": "github-repos/lean/jaalonso-DAO_con_Lean/DAO_con_Lean-1888a830871f358075ac712fc15bbf8b6806ac96/src/5_Limites/cauchy_acumulacion_limite.lean"} |
import cv2
import numpy as np
import os
import argparse
import configparser
from webcam_video_stream import WebcamVideoStream
from auto_pose.ae.utils import get_dataset_path
from aae_retina_pose_estimator import AePoseEstimator
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-test_config",... | {"hexsha": "372cd338d7801eac151b4a42aaafdb47487007b8", "size": 3692, "ext": "py", "lang": "Python", "max_stars_repo_path": "auto_pose/test/aae_retina_webcam_pose.py", "max_stars_repo_name": "dfraska-ftl/AugmentedAutoencoder", "max_stars_repo_head_hexsha": "ef000e82c1b64ab72bdb203ed1f4ce6fcd536829", "max_stars_repo_lice... |
'''
@Author danielvallejo237
'''
import json
import numpy as np
import re
import stanza
from spacy_stanza import StanzaLanguage
import unidecode
import random
NLPProc=None
JSONOBJ=None
with open("recipes_full_v2.json") as jsonFile:
jsonObject = json.load(jsonFile)
JSONOBJ=jsonObject
jsonFile.... | {"hexsha": "db696ddd5f1662f345f290594cc0b30173d6b653", "size": 1834, "ext": "py", "lang": "Python", "max_stars_repo_path": "botutils.py", "max_stars_repo_name": "danielvallejo237/SPI2022", "max_stars_repo_head_hexsha": "563d4357514b7fe4a70d14b960ae305fb3f81a01", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import numpy as np
from . import DiffAgentBase
class DiffAgentSpeculative(DiffAgentBase.DiffAgentBase):
def prediction(self, observation):
self.diff = np.random.randint(0, self.space.spaces[2].n)
def act(self, ob):
self.current_prediction = (self.diff + ob) % self.space.spaces[2].n
... | {"hexsha": "1452df939563d5def00bbf64529ff1dfe45e078e", "size": 632, "ext": "py", "lang": "Python", "max_stars_repo_path": "agents/DiffAgentSpeculative.py", "max_stars_repo_name": "sergiuionescu/gym-agents", "max_stars_repo_head_hexsha": "c65b786a148a868c9ee922dca1cb592604e7e828", "max_stars_repo_licenses": ["Apache-2.0... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Rectangular cap of a sphere
===========================
:math:`\alpha, \beta` are the half-angles defining the width/height of the
rectangular cap.
:math:`R` is the radius of the sphere.
Notes
~~~~~
This implementation uses inbuilt integration functions to calcula... | {"hexsha": "b8f4828565b8252ec1d8c917da389177808de030", "size": 4443, "ext": "py", "lang": "Python", "max_stars_repo_path": "beamshapes/workshop/rect_cap_sphere.py", "max_stars_repo_name": "faroit/bat_beamshapes", "max_stars_repo_head_hexsha": "9c2919b4e56dbd0cfc1039edc608ce1592b78df3", "max_stars_repo_licenses": ["MIT"... |
import os
import torch
from torch.utils.data import Dataset
from torchvision.transforms import transforms as T
import numpy as np
from PIL import Image
import csv
class miniImagenet(Dataset):
"""
put mini-imagenet files as:
root :
|- images/*.jpg includes all images
|- train.csv
... | {"hexsha": "85c4e2422c0bc7282b05741ca8d3fd85f5231058", "size": 6644, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset/mini_imagenet.py", "max_stars_repo_name": "ashtonteng/few-shot-ctm", "max_stars_repo_head_hexsha": "e864c865178ccec0562fa6a4edf3558228af72fe", "max_stars_repo_licenses": ["MIT"], "max_star... |
[STATEMENT]
lemma toCard_inj: "\<lbrakk>|A| \<le>o r; Card_order r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> toCard A r x = toCard A r y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>|A| \<le>o r; Card_order r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (toCard A r ... | {"llama_tokens": 519, "file": null, "length": 3} |
# Lecture 01 The Geometry of Linear Equations
Today's lecture contains:<br/>
1. 2D Linear Equations<br/>
2. 3D Linear Equations<br/>
3. Matrix Multiple Vector<br/>
For all equations, we focus on TWO big concepts: **row picture** and **column picture.**<br/>
<br/>
<br/>
## 1. 2D Linear Equations
Suppose we have two... | {"hexsha": "355392c81b675d5ca944a20e60df5bb3e01d26ae", "size": 223864, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "Lecture 01 The Geometry of Linear Equations.ipynb", "max_stars_repo_name": "XingxinHE/Linear_Algebra", "max_stars_repo_head_hexsha": "7d6b78699f8653ece60e07765fd485dd36b26194", "max... |
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
if __name__ == '__main__':
y_pred_reg = np.load('y_pred_reg.p')
y_pred_automl = np.load('y_pred_automl.p')
y_test = np.load('y_test.p')
f, axes = plt.subplots(1, 2)
ax = axes[0]
... | {"hexsha": "6480b66cff25a7ac418b75b9923329dccef38d77", "size": 1094, "ext": "py", "lang": "Python", "max_stars_repo_path": "conf_matrix.py", "max_stars_repo_name": "jtorniainen/wine-quality-predictor", "max_stars_repo_head_hexsha": "f8ccf59212e4723226e5fd7155172a8dc7c7b856", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""
Filename: analyze_inconsistency_validation.py
Authors:
Jason Youn -jyoun@ucdavis.edu
Description:
To-do:
"""
# standard imports
import argparse
import logging as log
import os
import sys
ABS_PATH_METRICS = os.path.join(os.path.dirname(__file__), '../integrate_modules')
sys.path.insert(0, ABS_PATH_METRICS)
... | {"hexsha": "01fc2faa542789bf4f705cde37ae1dc6e5ee958c", "size": 4124, "ext": "py", "lang": "Python", "max_stars_repo_path": "kg_constructor/tools/analyze_inconsistency_validation.py", "max_stars_repo_name": "bigghost2054/KIDS", "max_stars_repo_head_hexsha": "ace171efc6cf4eb3cd346a662e5af32dc4072ab3", "max_stars_repo_lic... |
using JuliaTutorial
using Test
# to group test together, to oranise serveral tests
# @testset "JuliaTutorial.jl" begin
# # @test myaddition(1, 1) == 2
# end
sexonthebeach = Cocktail(("vodka", "schnaps", "orange juice", "cranberry juice"))
tipunch = Cocktail(("rhum", "sugar", "lime juice"))
olivierssecret = myadd... | {"hexsha": "3fa7d5f5d4c5dec8d4dbccced7630bcce7feb59d", "size": 384, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "edinburgh-biomedical-ai/JuliaTutorial.jl", "max_stars_repo_head_hexsha": "197e2b54c3d2c2886effe9fd14aacf5f257b3202", "max_stars_repo_licenses": ["MIT"], "m... |
[STATEMENT]
lemma fmap_ball_all3:
fixes
Px :: "'c \<Rightarrow> 'd \<Rightarrow> 'e \<Rightarrow> bool" and
P :: "'c \<Rightarrow> 'd \<Rightarrow> 'e \<Rightarrow> 'b option \<Rightarrow> 'b option \<Rightarrow> bool" and
f :: "('a::finite) -~> 'b" and f' :: "'a -~> 'b"
assumes
"dom f' = dom f" and
"\<... | {"llama_tokens": 833, "file": "Locally-Nameless-Sigma_preliminary_FMap", "length": 7} |
#include <memory>
//#include <boost/regex.hpp>
#include <regex>
#include "Node.h"
#include "Common.h"
#include "Filesystem.h"
using namespace std;
Node :: Node(const std::string& fn):
m_Filename(fn)
{
if(Filesystem::getExtension(fn)=="json")
{
try {
m_pConfig = make_shared<Meta>(fn);
... | {"hexsha": "b0166f0d8daf835c0348aa9e3140b0c7fae994f3", "size": 22262, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Qor/Node.cpp", "max_stars_repo_name": "flipcoder/qor", "max_stars_repo_head_hexsha": "7a2ebf667be4c913fbc7daf5e0b07a4c1723389d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 84.0, "max_st... |
[STATEMENT]
lemma parallel_strategy_Src_eq:
shows "Arr t \<Longrightarrow> parallel_strategy (Src t) = parallel_strategy t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Arr t \<Longrightarrow> parallel_strategy (Src t) = parallel_strategy t
[PROOF STEP]
by (induct t) auto | {"llama_tokens": 101, "file": "ResiduatedTransitionSystem_LambdaCalculus", "length": 1} |
#import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import numpy as np
import os, keras
from keras import backend as K
import keras, datetime, os, functools
from PIL import Image as PIL_Image
from keras.preprocessing.image import load_img, img_to_array, array_to_img, save_img
def load_... | {"hexsha": "f128792406eeb7b23d203a7071a3fb0a9c6e1492", "size": 5969, "ext": "py", "lang": "Python", "max_stars_repo_path": "Detection/capcha_patch.py", "max_stars_repo_name": "irobert0126/AITrojan", "max_stars_repo_head_hexsha": "98ebe6062ed00d59c88f16627c71b1e8c9962a08", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
"""
static calculation
"""
import os
import sys
import shutil
import numpy as np
from pymatflow.remote.server import server_handle
from pymatflow.cp2k.cp2k import Cp2k
"""
"""
class StaticRun(Cp2k):
"""
Usage:
a = static_run()
a.get_xyz(xxx)
a.set_params(xxx)
... | {"hexsha": "748bc7c06df58d8b8c5126e563e3ffbebf905e32", "size": 19282, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymatflow/cp2k/static.py", "max_stars_repo_name": "DeqiTang/pymatflow", "max_stars_repo_head_hexsha": "bd8776feb40ecef0e6704ee898d9f42ded3b0186", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
#include <iostream>
#include <boost/variant.hpp>
#include <sstream>
class A
{
public:
A(const std::string& s) :str{ s }
{
}
std::string str;
};
using var_t = boost::variant<int, double, A>;
class processor : public boost::static_visitor<int>
{
public:
int operator()(int& val)
{
strm.str("... | {"hexsha": "afd5e89c8258c4cb04f4a014f2a6dd9c340572fc", "size": 1170, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "main.cpp", "max_stars_repo_name": "Gayane05/Visitor-design-pattern", "max_stars_repo_head_hexsha": "851b52f825c35e52883b7465ed3832558deed2f4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import sys
from limix.utils.preprocess import remove_dependent_cols
from limix.utils.util_functions import smartDumpDictHdf5
# core
from limix.core.gp import GP2KronSum
from limix.core.gp import GP2KronSumLR
from limix.core.gp import GP3KronSumLR
from limix.core.covar import FreeFormCov
import h5py
import pdb
import ... | {"hexsha": "e0214a4f70af5fc07269ef225a31c4cb9181bc38", "size": 14084, "ext": "py", "lang": "Python", "max_stars_repo_path": "svca_limix/limix/mtSet/mtset.py", "max_stars_repo_name": "DenisSch/svca", "max_stars_repo_head_hexsha": "bd029c120ca8310f43311253e4d7ce19bc08350c", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
#! /usr/bin/python3
"""
python -m py_compile IOtest.py
"""
import base64
import sys
import numpy as np
from PIL import Image
# for line in sys.stdin:
# # sys.stdout.write(line.strip())
# data = base64.b64decode(line.strip())
# sys.stdout.write(data)
# # base64_bytes = base64.b64encode(data)
# ... | {"hexsha": "099a48eef98473c588a886f36bf4d2d91adb9bc8", "size": 910, "ext": "py", "lang": "Python", "max_stars_repo_path": "IOtest.py", "max_stars_repo_name": "flederbaysian/ardpifi", "max_stars_repo_head_hexsha": "8de6752d8ed6f508d1afa5d3805373a58c0b54d2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.