text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
if haskey(ENV, "CI")
ENV["PLOTS_TEST"] = "true"
ENV["GKSwstype"] = "100" # gr segfault workaround
end
using FluxOptTools, Optim, Zygote, Flux, Plots, Test, Statistics, Random
##
@testset "FluxOptTools" begin
@info "Testing FluxOptTools"
@testset "copy" begin
@info "Testing copy"
m = Chain(Dense(1,5,tanh), Den... | {"hexsha": "40566017920fd0510147a4d55ea836c193e5472f", "size": 3637, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "baggepinnen/FluxOptTools.jl", "max_stars_repo_head_hexsha": "fa0f140978295cc49f9a69eda7a442318883aed9", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import tensorflow as tf
import numpy as np
import pandas as pd
import scipy.stats as st
from tensorflow.keras import layers
import sklearn.metrics
import sklearn
from tensorflow.keras.models import Model
import matplotlib.pyplot as plt
from tensorflow.keras.preprocessing import *
from collections import defaultdict
fr... | {"hexsha": "b6ece16c236440f8b0e8ec291e455ed0dd260b99", "size": 8553, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/ContinuousFeedForward.py", "max_stars_repo_name": "nd-hal/fair-psych-nlp", "max_stars_repo_head_hexsha": "c0ba97fdcec6a2f58563de8dba3b9dde6f9b4b6b", "max_stars_repo_licenses": ["MIT"], "max_s... |
import numpy as np
import random
class experienceBuffer():
#Initialize an empty buffer of buffer_size
def __init__(self, buffer_size = 2000):
self.buffer = []
self.buffer_size = buffer_size
#Add experience to the buffer, and clear old experiences of full
def add(self,experience):
... | {"hexsha": "1e4af3dfcf01d8d2327a3ffecf91a037dd61347c", "size": 684, "ext": "py", "lang": "Python", "max_stars_repo_path": "DQN-Breakout/experience_replay.py", "max_stars_repo_name": "TonyNgo1/RL-OpenAIGym", "max_stars_repo_head_hexsha": "9e079d7783f4d93e7e3478cfc511ff31fa4bfb7d", "max_stars_repo_licenses": ["MIT"], "ma... |
from pathlib import Path
import numpy as np
from mdgraph.data.preprocess import aminoacid_int_encoding, aminoacid_int_to_onehot
TEST_DATA_PATH = Path(__file__).parent / "data/1FME-unfolded.pdb"
def test_residue_onehot_encoding():
residues, labels = aminoacid_int_encoding(str(TEST_DATA_PATH))
assert len(resi... | {"hexsha": "04f890c1f862e206b4912946fec8c5b03de4497e", "size": 587, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_preprocess.py", "max_stars_repo_name": "hengma1001/pytorch-geometric-sandbox", "max_stars_repo_head_hexsha": "cd5b73663db9d9c27a957c56cab20e575fc6374d", "max_stars_repo_licenses": ["MIT"]... |
#include <type_traits>
#include <boost/preprocessor/stringize.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/print.hpp>
#include <boost/fusion/include/vector.hpp>
#include <desalt/parameter_pack.hpp>
#include <iostream>
#include <typeinfo>
#include <cxxabi.h>
namespace ppack = desalt::parameter_pack;
namesp... | {"hexsha": "9cb733c555716d2dc00681f4e394cc605019e099", "size": 1988, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/parameter_pack.cpp", "max_stars_repo_name": "dechimal/desalt", "max_stars_repo_head_hexsha": "29f2bbe9e41850ddd4ebff39958747e504e3a6a3", "max_stars_repo_licenses": ["WTFPL"], "max_stars_count":... |
# -*- coding: utf-8 -*-
"""Mask-RCNN.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1aHWlXGTEeAFxN3L4lkJdtkDQsYKtxlc8
"""
import torch
import torchvision
import torchvision.transforms as T
import PIL
from PIL import Image
import random
import m... | {"hexsha": "7c62c11224956a227599e50f0fac48418d5dd21a", "size": 3649, "ext": "py", "lang": "Python", "max_stars_repo_path": "mask_rcnn.py", "max_stars_repo_name": "aryachiranjeev/Mask-RCNN", "max_stars_repo_head_hexsha": "8d34d3879a4039dccc173bea699b24465aa33372", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
# run from detectron2/detectron2 directory
#from detectron2.data.datasets.coco import convert_to_coco_json
import torch
assert torch.__version__.startswith("1.7")
import argparse
import detectron2
from detectron2.utils.logger import setup_logger
setup_logger()
import numpy as np
import os, json, cv2, random
from de... | {"hexsha": "56c71b62ed2857062cd2c08a9b765e292c3bc632", "size": 5885, "ext": "py", "lang": "Python", "max_stars_repo_path": "detectron2/detect.py", "max_stars_repo_name": "av777x/detectron2", "max_stars_repo_head_hexsha": "c1794881d6d2fac6af0b3206937d32628677469c", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.axes._base import _AxesBase
from matplotlib.patches import Ellipse, Circle
def calc_point_on_circle(i: int, slice: float, radius: float, center: (float, float) = (0, 0)):
"""
Return coordinates of the i-th point on a circle.
:param i: i-t... | {"hexsha": "9cddaf72065f2d67db70b1ca95ed0ea18889480b", "size": 4992, "ext": "py", "lang": "Python", "max_stars_repo_path": "flower_plot/flower_plot.py", "max_stars_repo_name": "MrTomRod/flower-plot", "max_stars_repo_head_hexsha": "19d5cf4dd63aa1aed418b0b66684aea8c7676ec6", "max_stars_repo_licenses": ["MIT"], "max_stars... |
/-
Copyright (c) 2018 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau, Mario Carneiro, Johan Commelin, Amelia Livingston, Anne Baanen
-/
import group_theory.submonoid.inverses
import ring_theory.finiteness
import ring_theory.localization.basic
impor... | {"author": "saisurbehera", "repo": "mathProof", "sha": "57c6bfe75652e9d3312d8904441a32aff7d6a75e", "save_path": "github-repos/lean/saisurbehera-mathProof", "path": "github-repos/lean/saisurbehera-mathProof/mathProof-57c6bfe75652e9d3312d8904441a32aff7d6a75e/src/tertiary_packages/mathlib/src/ring_theory/localization/inv_... |
'''
Created on Apr 6, 2016
@author: jesus
Contains all methods and classes to perform the corpus division for cross validation
'''
import cPickle
import numpy as np
import copy,random
'''
Since we don't have enough sentences, we have no validation set, then,
each fold consists of a valtest set and a training se... | {"hexsha": "81f8902e95aaa6f0f2b1db55a99d5ac8d08b649a", "size": 7103, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/crossValidation.py", "max_stars_repo_name": "iesus/thesis-production-models", "max_stars_repo_head_hexsha": "38bf703db513ffeed5a533590fbae747235a60ba", "max_stars_repo_licenses": ["MIT"], "ma... |
# from __future__ import absolute_import
# from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
import glob
import numpy as np
from PIL import Image
def main():
data = '/data/zming/GH/manji/2000_labeled_sample_head'
folders = os.listdir(data)
folders.sor... | {"hexsha": "929ddb0a7e540d04b9f5ed46356ad9247fca749d", "size": 2241, "ext": "py", "lang": "Python", "max_stars_repo_path": "handrecog/src/util/check_bad_tf_decodepng.py", "max_stars_repo_name": "hengxyz/hand_detection_recognition", "max_stars_repo_head_hexsha": "317545056886d7b85947f9258c4cc02e98cfd2fe", "max_stars_rep... |
from nets.yolo3 import yolo_body
from keras.layers import Input
from yolo import YOLO
from PIL import Image
import numpy as np
from datetime import datetime
if __name__ == '__main__':
yolo = YOLO()
# x = 10
# photo = []
# with open('2007_test.txt') as f:
# file = f.readlines()
# # pri... | {"hexsha": "25914e8e27f1597990d5b1b8de3e77bd6d8ef312", "size": 1054, "ext": "py", "lang": "Python", "max_stars_repo_path": "predict.py", "max_stars_repo_name": "robert4213/Plant_detection_Application", "max_stars_repo_head_hexsha": "807267adefcec37f02d1480a9ddbb49169fdbd5f", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma hoare_cnvalid:
assumes hoare: "\<Gamma>,\<Theta>\<turnstile>\<^bsub>/F\<^esub> P c Q,A"
shows "\<And>n. \<Gamma>,\<Theta>\<Turnstile>n:\<^bsub>/F\<^esub> P c Q,A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>n. \<Gamma>,\<Theta>\<Turnstile>n:\<^bsub>/F\<^esub> P c Q,A
[PROOF STEP]
using h... | {"llama_tokens": 137187, "file": "Simpl_HoarePartialProps", "length": 426} |
#include <boost/intrusive/Segment_tree/segment_tree_algorithms.hpp>
#include <boost/intrusive/Segment_tree/segment_tree_hook.hpp>
#include "boost/intrusive/Segment_tree/merging_function.hpp"
#include <boost/intrusive/Segment_tree/segment_tree_iterator.hpp>
#include<boost/intrusive/any_hook.hpp>
#include <boost/intrusi... | {"hexsha": "0f971c9cc04fee109ee5183c465bbcf3abfa9e45", "size": 12967, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/intrusive/Segment_tree/segment_tree.hpp", "max_stars_repo_name": "BoostGSoC18/Advanced-Intrusive", "max_stars_repo_head_hexsha": "30c465125c460e4bc2a9583ce00f0f706ed23e5a", "max_stars... |
pushfirst!(LOAD_PATH, joinpath(@__DIR__, "..", "packages"))
import VSCodeLiveUnitTesting
popfirst!(LOAD_PATH)
VSCodeLiveUnitTesting.live_unit_test(ARGS[1], ARGS[2])
| {"hexsha": "c289605357104b258ed9685c819c71e1e5f13c7c", "size": 166, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "scripts/tasks/task_liveunittesting.jl", "max_stars_repo_name": "novitk/julia-vscode", "max_stars_repo_head_hexsha": "a3ec5649a734b5c1dc09b0f40aa7a7aa6caac5d2", "max_stars_repo_licenses": ["MIT"], "m... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | {"hexsha": "4825d1e52442f9cf1ef1bcb6697bf2c3143bc602", "size": 3126, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/python/contrib/test_hexagon/topi/test_softmax.py", "max_stars_repo_name": "pfk-beta/tvm", "max_stars_repo_head_hexsha": "5ecb8c384a66933fec8c7f033cba03337eb1a726", "max_stars_repo_licenses":... |
section \<open>Translating Multitape TMs to Singletape TMs\<close>
text \<open>In this section we define the mapping from a multitape Turing machine to a singletape
Turing machine. We further define soundness of the translation via several relations
which establish a connection between configurations of b... | {"author": "isabelle-prover", "repo": "mirror-afp-devel", "sha": "c84055551f07621736c3eb6a1ef4fb7e8cc57dd1", "save_path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel", "path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel/mirror-afp-devel-c84055551f07621736c3eb6a1ef4fb7e8cc57dd1/thys/Multitape_To_... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import json
import argparse
import numpy as np
import h5py
from graph_utils import graph
def build_vocab(imgs, params):
count_thr = params['word_count_threshold']
# count up the number ... | {"hexsha": "87850bd07ffd68e886e742f68f15308300a960a6", "size": 8284, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/prepro_tree_labels.py", "max_stars_repo_name": "mazm13/Image-to-Tree.pytorch", "max_stars_repo_head_hexsha": "1d32e31d489ea6be784dbbe173acc362b82c59dc", "max_stars_repo_licenses": ["MIT"],... |
#pragma once
#include <nano/lib/utility.hpp>
#include <nano/node/common.hpp>
#include <nano/secure/common.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index_container.hpp>
#include <functional>
#include... | {"hexsha": "cd902cac40cebfeb420f3f2795ddf4b6ca9aac84", "size": 5720, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "nano/node/telemetry.hpp", "max_stars_repo_name": "Sukhmai/nano-node", "max_stars_repo_head_hexsha": "d4b3e5473ed85366edbd91aebc698ccc28e018fb", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
# -------------------------------------------------------------------
# Data Exploration
# -------------------------------------------------------------------
# Creates plots of steering angles by consecutive timestamps
from __future__ import print_function
import numpy as np
import pandas as pd
import csv
import ... | {"hexsha": "b254609872fb1c91cec9e1da989f3b2eb3512c37", "size": 3088, "ext": "py", "lang": "Python", "max_stars_repo_path": "datacurve.py", "max_stars_repo_name": "shahidul56/CNN_Steering_Angle", "max_stars_repo_head_hexsha": "a2f8b19e936cc0436469e61fc72e30d93f7f1fee", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#include "leela_zero.h"
#include "log_file.h"
#include "exit_status.h"
#include <boost/regex.hpp>
#include <boost/filesystem.hpp>
#ifdef WIN32
#include <boost/process/windows.hpp>
#endif
static const boost::regex reFirstLine(R"(Using \d++ thread\(s\)\..*+)");
LeelaZero::LeelaZero(const String& lz, const... | {"hexsha": "9c315234bc7e52d3c1e00438c88017b520307ecb", "size": 2757, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/leela_zero.cpp", "max_stars_repo_name": "wentaol/zero-problem", "max_stars_repo_head_hexsha": "887e61826225137b5c7e40feea8ae932bdcf333b", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
"""
tf2onnx.utils - misc utilities for tf2onnx
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import six
import numpy as np
import tenso... | {"hexsha": "0ec3f6bf6b8606aba5b5993c16ed6f721f3c1b2b", "size": 11759, "ext": "py", "lang": "Python", "max_stars_repo_path": "tf2onnx/utils.py", "max_stars_repo_name": "kadeng/tensorflow-onnx", "max_stars_repo_head_hexsha": "db91f5b25cc2a053f46af3b2c04b65a679cff03b", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
program test_bit
use lfortran_intrinsic_bit, only: iand, ior, ibclr, ibset, btest
implicit none
integer(kind=4) :: a
integer(kind=4) :: b
integer(kind=8) :: x
integer(kind=8) :: y
a = 4
b = 1
if (iand(a, b) /= 0) error stop
x = 3
y = 1
if (iand(x, y) /= 1) error stop
a = 1
b = 2
if (ior(a, b) /= 3) error stop
x =... | {"hexsha": "8748ba9bc9fa272acb402d737e750a432e4b89d4", "size": 590, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/runtime/tests/test_bit.f90", "max_stars_repo_name": "Thirumalai-Shaktivel/lfortran", "max_stars_repo_head_hexsha": "bb39faf1094b028351d5aefe27d64ee69302300a", "max_stars_repo_licenses": ["BSD... |
import hdnntools as hdt
import nmstools as nmt
import pyanitools as pyt
import pyaniasetools as aat
import pyanitrainer as atr
import pymolfrag as pmf
from pyNeuroChem import cachegenerator as cg
import numpy as np
from time import sleep
import subprocess
import random
#import pyssh
import re
import os
import pyani... | {"hexsha": "980e6c37b9c028142ebe2cddb9ecb468a69fb9ce", "size": 45991, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/anialtools.py", "max_stars_repo_name": "plin1112/ANI-Tools", "max_stars_repo_head_hexsha": "76280c918fc79fee8c266b8bc9ab57f86104ec99", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 8... |
\chapter{Mitigations}
\label{ch:mitigations}
In this chapter we describe the mitigations to the threats we found in
the previous chapter.
\section{Mitigation by Threat}
The threat tables detail a proposed mitigation for each identified
threat. The final implementation is left to the designers who would
address each t... | {"hexsha": "df1c87c8bc6b01b4cfd2543a54d4fbea3427c74b", "size": 1726, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "text/mitigation.tex", "max_stars_repo_name": "pacman47403/B547A1", "max_stars_repo_head_hexsha": "e5b21e352efa257102ffe9ea8674ea73e910e449", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
[STATEMENT]
lemma step_Stuck_prop:
assumes step: "\<Gamma> \<turnstile> (c, s) \<rightarrow> (c', s')"
shows "s=Stuck \<Longrightarrow> s'=Stuck"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. s = Stuck \<Longrightarrow> s' = Stuck
[PROOF STEP]
using step
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<turnst... | {"llama_tokens": 182, "file": "Complx_SmallStep", "length": 2} |
/*
* Copyright (c) 2018, Sunanda Bose (Neel Basu) (neel.basu.z@gmail.com)
* 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 c... | {"hexsha": "3559a75155e2eea97e550d84f1902cd37bbdbf01", "size": 2319, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "sources/exceptions.cpp", "max_stars_repo_name": "DominikLindorfer/mathematicapp", "max_stars_repo_head_hexsha": "ce9de342501d803ccd115533d19c7e3ace51e475", "max_stars_repo_licenses": ["BSD-2-Clause-... |
#include <boost/text/trie_set.hpp>
#include <boost/text/trie_set.hpp>
| {"hexsha": "6d358d077612d87b575d0fb073c847bad5dbcaae", "size": 70, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/compile_include_trie_set_2.cpp", "max_stars_repo_name": "eightysquirrels/text", "max_stars_repo_head_hexsha": "d935545648777786dc196a75346cde8906da846a", "max_stars_repo_licenses": ["BSL-1.0"], "... |
"""
Optimization of the CADRE MDP.
"""
from __future__ import print_function
import numpy as np
from openmdao.api import Problem, PETScKrylov # , LinearBlockGS
from CADRE.CADRE_mdp import CADRE_MDP_Group
import cProfile
import pstats
import sys
argv = sys.argv[1:]
if 'paper' in argv:
# These numbers are for ... | {"hexsha": "421958f0dfebbdb509faeeffa3471614ba27eb4f", "size": 2419, "ext": "py", "lang": "Python", "max_stars_repo_path": "profile/profile_derivs.py", "max_stars_repo_name": "robfalck/CADRE", "max_stars_repo_head_hexsha": "f1fb419aade62fe830d56d958f35f1e153f04363", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
program givcor
! Given two arrays of equal length of unordered values, find a
! "matching value" in the second array for each value in the
! first so that the global correlation coefficient reaches
! exactly a given target.
! _________________________________________________________________
! The routine fir... | {"hexsha": "f59ab32931206c067c2d990549146d47cf78bbb1", "size": 4845, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "source/f2000/givcor.f90", "max_stars_repo_name": "agforero/FTFramework", "max_stars_repo_head_hexsha": "6caf0bc7bae8dc54a62da62df37e852625f0427d", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# Copyright 2017 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 a... | {"hexsha": "0e431fa38d41cea1a8636d8c52ba67154905e005", "size": 992, "ext": "py", "lang": "Python", "max_stars_repo_path": "vae-gan/data/create_random_embedding.py", "max_stars_repo_name": "google/generativemloncloud", "max_stars_repo_head_hexsha": "29c4a7b14b5fababaa4570c9efce07517dd0d79f", "max_stars_repo_licenses": [... |
Add LoadPath "D:\sfsol".
Require Export Imp.
Definition aequiv (a1 a2 : aexp) : Prop :=
forall (st:state),
aeval st a1 = aeval st a2.
Definition bequiv (b1 b2 : bexp) : Prop :=
forall (st:state),
beval st b1 = beval st b2.
Definition cequiv (c1 c2 : com) : Prop :=
forall (st st' : state),
(c1 / st ... | {"author": "mmalone", "repo": "sfsol", "sha": "5888f4532a1ec1ababa21bef39e25eb26279f0e4", "save_path": "github-repos/coq/mmalone-sfsol", "path": "github-repos/coq/mmalone-sfsol/sfsol-5888f4532a1ec1ababa21bef39e25eb26279f0e4/Equiv.v"} |
(* DEC 2.0 language specification.
Paolo Torrini
Universite' de Lille - CRIStAL-CNRS
*)
Require Import List.
Require Import Equality.
Require Import Eqdep.
Require Import PeanoNat.
Require Import Omega.
Require Import ProofIrrelevance.
Require Import AuxLibI1.
Require Import TypSpecI1.
Require Import ModTyp... | {"author": "2xs", "repo": "dec", "sha": "79290ae2f92d437fe365a1b366a30e1eb2b83d19", "save_path": "github-repos/coq/2xs-dec", "path": "github-repos/coq/2xs-dec/dec-79290ae2f92d437fe365a1b366a30e1eb2b83d19/src/DEC2/PreReflI1.v"} |
import os
import numpy as np
import cv2
import torch
from .models import load_model
from .utils import Window, draw_face
# global settings
EPS = 1e-5
minFace_ = 20 * 1.4
scale_ = 1.414
stride_ = 8
classThreshold_ = [0.37, 0.43, 0.97]
nmsThreshold_ = [0.8, 0.8, 0.3]
angleRange_ = 45
stable_ = 0
class Window2:
... | {"hexsha": "866879882e8b02e47e7d7bcf43912a4fce5b9ca1", "size": 12463, "ext": "py", "lang": "Python", "max_stars_repo_path": "pcn/pcn.py", "max_stars_repo_name": "quickgrid/pytorch-PCN", "max_stars_repo_head_hexsha": "6c6b15867b09a92eb1035e05c364b8710d7d49e3", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_coun... |
import unittest
import pytest
import numpy as np
from yaonet.tensor import Tensor
from yaonet.basic_functions import matmul
class TestTensorAdd(unittest.TestCase):
def test_tensor_reshape(self):
# t1 is (1, 2)
t1 = Tensor([[1, 2]], requires_grad=True)
# t2 is a (2, 2)
t2 = Tens... | {"hexsha": "4c1bc76a75e3c996ab103e7108f0d24cfbf8b2b1", "size": 958, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_tensor_reshape.py", "max_stars_repo_name": "Zzoay/yaonet_py", "max_stars_repo_head_hexsha": "79367d6f65ddcfb94c261393e8b9a46775346dbe", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
import torch
from torchvision import datasets, transforms
import argparse
import numpy as np
from PIL import Image
import json
def argparse_train():
parser = argparse.ArgumentParser()
parser.add_argument("data_directory", help="set directory to get the data from")
parser.add_argument("--save_dir", help="s... | {"hexsha": "187309ad0b3f17d5ce515e971a8047608248727f", "size": 5564, "ext": "py", "lang": "Python", "max_stars_repo_path": "utility.py", "max_stars_repo_name": "Wolfgang90/ds_p2_image_classifier", "max_stars_repo_head_hexsha": "2f4416bb20f5a8bec084a5f07406a6622f3239f1", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
\section{Motivation}
A typical customer, buying in a normal clothing storage, often has to deal with a great variety of apparel he can choose from.
The range of clothing he can choose from is even greater, when he uses online-shopping - either on dedicated clothing-shops such as \href{https:\\www.zalando.de}{Zalando}... | {"hexsha": "8529e23de586cd6bbd57b2df29712bc9e5fdabb9", "size": 2293, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "interim-report/inc/motivation/motivation.tex", "max_stars_repo_name": "dustywind/bachelor-thesis", "max_stars_repo_head_hexsha": "be06aaeb1b4d73f727a19029a3416a9b8043194d", "max_stars_repo_licenses"... |
INTEGER MEDISC,SODISC,NDISC,APDISC,MLDISC,MEDIA,SOMA,N,APROV,
* MELHOR,ALUNO,NOTA,UE,US
CHARACTER TURMA*1
DATA UE,US,SODISC,NDISC,APDISC,MLDISC/5,6,3*0,-1/
10 CONTINUE
SOMA = 0
N = 0
APROV = 0
MELHOR = -1
20 CONTINUE
READ(UE,21) TURMA,ALUNO,NOTA
21 FORMAT(A1,I1,I3)
IF (ALUNO.EQ.0) GO TO 30... | {"hexsha": "e766e7521137599d5b03e05a7173ad5e7c9783c7", "size": 1007, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "codes/120809/teste.for", "max_stars_repo_name": "danielsanfr/fortran-study", "max_stars_repo_head_hexsha": "101ff0aa552f40542b5bc3e90ee0265f9a74eb48", "max_stars_repo_licenses": ["Unlicense"], "... |
# deps.jl is created at the end of a successful build, so rm
# to ensure that failed builds are missing this file.
if isfile("deps.jl")
rm("deps.jl")
end
include("build_petscs.jl")
| {"hexsha": "21247c85ba1999e6a9102b66c6694b6a80e6eec4", "size": 183, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "deps/build.jl", "max_stars_repo_name": "gridap/PETSc.jl", "max_stars_repo_head_hexsha": "734dd02defddfffd79656ad48596bc82d14a219c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
[STATEMENT]
lemma list_before_trans[trans]: "distinct l \<Longrightarrow> trans (list_before_rel l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. distinct l \<Longrightarrow> trans (list_before_rel l)
[PROOF STEP]
by (clarsimp simp: trans_def list_before_rel_alt) (metis index_nth_id less_trans) | {"llama_tokens": 107, "file": "Prpu_Maxflow_Graph_Topological_Ordering", "length": 1} |
import numpy as np
import pandas as pd
import pybaseball as bb
from pybaseball import statcast
from pybaseball import batting_leaders
from pybaseball import batting_stats_range
from pybaseball import pitching_leaders
from pybaseball import pitching_stats_range
print('Dates must be entered as Year-Month-Day')
x = input... | {"hexsha": "e2168e14a395754c083cbd741f4e5a36d943c403", "size": 658, "ext": "py", "lang": "Python", "max_stars_repo_path": "Example hitting.py", "max_stars_repo_name": "ksu-is/Sports-Heat-Chart", "max_stars_repo_head_hexsha": "5d4eb4aad60ff99ff46cfe0c846fe462c7885684", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
[STATEMENT]
lemma short_cut'[simp,code_unfold]: "(\<eight> \<doteq> \<six>) = false"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<eight> \<doteq> \<six>) = false
[PROOF STEP]
apply(rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>x. (\<eight> \<doteq> \<six>) x = false x
[PROOF STEP]
apply(simp... | {"llama_tokens": 244, "file": "Featherweight_OCL_UML_Library", "length": 3} |
# Author: Seongchun Yang
# Affiliation: Kyoto University
# ======================================================================
# 1. (IMPORTANT:CITATION ALERT)
# As close of an exact implementation of doi: 10.1109/ICIECS.2009.5365064 (Zhang et al., IEEE, 2009).
# 2.
# Reason behind the name 'forgetting scale' paramet... | {"hexsha": "0a4b2248ed85704b3c06e8fd46dc039cdcc1c942", "size": 4331, "ext": "py", "lang": "Python", "max_stars_repo_path": "KF/Zhang_AUKF.py", "max_stars_repo_name": "SeongchunYang/KF", "max_stars_repo_head_hexsha": "af3ea7a66623879794779c42157294f630add735", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
import sys
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra
def main():
n, m = map(int, sys.stdin.readline().split())
can_speak = [[] for _ in range(m + 1)]
for i in range(n):
*languages, = map(int, sys.stdin.readline().split())
... | {"hexsha": "72ac67c6563b05af2d8082fd5e395391d6d463c8", "size": 826, "ext": "py", "lang": "Python", "max_stars_repo_path": "jp.atcoder/cf16-final/codefestival_2016_final_c/8722733.py", "max_stars_repo_name": "kagemeka/atcoder-submissions", "max_stars_repo_head_hexsha": "91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e", "max_st... |
#!/usr/bin/env python3
import warnings
import numpy as np
from .utils import eis
from .utils import num
def compute(windata, wl0, wl_width):
''' Compute synthetic emission for a given AIA band using EIS data.
Parameters
==========
windata : idl.IDLStructure
Windata structure containing the ... | {"hexsha": "433d89694ba818d56b9da26698501b7833c1a03e", "size": 1808, "ext": "py", "lang": "Python", "max_stars_repo_path": "eis_pointing/eis_aia_emission.py", "max_stars_repo_name": "gpelouze/eis_pointing", "max_stars_repo_head_hexsha": "2ee714a2295bafae3492ab956792535336dd2a81", "max_stars_repo_licenses": ["MIT"], "ma... |
\section{Order statistics}
| {"hexsha": "eada27cb0170b283cac9ddcff3824c7ffb52086d", "size": 29, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "src/pug/theory/probability/orderStatistics/01-00-Order.tex", "max_stars_repo_name": "adamdboult/nodeHomePage", "max_stars_repo_head_hexsha": "266bfc6865bb8f6b1530499dde3aa6206bb09b93", "max_stars_repo... |
from astropy.table import Table
from yoshi.yoshi import run_one_yoshi
def main():
import argparse
parser = argparse.ArgumentParser(description="yoshi")
parser.add_argument('jobreq', type=str)
parser.add_argument('out', type=str)
opt = parser.parse_args()
obsjobs = Table.read(opt.jobreq, forma... | {"hexsha": "dd1783ea68665b07ea93edb50e8592df55e36b74", "size": 678, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_example.py", "max_stars_repo_name": "sot/yoshi", "max_stars_repo_head_hexsha": "15550f2620ceb8e5e813df5761b9d3e6e86d68e4", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": null, ... |
import matplotlib.pyplot as plt
import numpy as np
from numpy import fft, rot90, multiply
from PIL import Image
img = np.asarray(Image.open("school_of_fish.png").convert("L"))
school_of_fish = np.zeros((img.shape[0], img.shape[1]))
for i in range(img.shape[0]):
for j in range(img.shape[1]):
school_of_fis... | {"hexsha": "d7ab7d7d5d7e91d48a5520d1c8ec5f5632554101", "size": 1352, "ext": "py", "lang": "Python", "max_stars_repo_path": "lab9_FFT_applications/task_1/fish.py", "max_stars_repo_name": "j-adamczyk/Numerical-Algorithms", "max_stars_repo_head_hexsha": "47cfa8154bab448d1bf87b892d83e45c68dd2e2a", "max_stars_repo_licenses"... |
subroutine ewweighted
c******************************************************************************
c This routine computes a weighted mean EW for one line from a set
c of models
c******************************************************************************
implicit real*8 (a-h,o-z)
incl... | {"hexsha": "c6240b03cf67910cfec5dc53131bbd7d09a11a18", "size": 2326, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "MoogSource/Ewweighted.f", "max_stars_repo_name": "soylentdeen/MoogPy", "max_stars_repo_head_hexsha": "9485a7e302ef4d4339013f27672d1d5e7059a41f", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
using Printf
using Plots
using ProgressMeter
function animate(input, traj, filename; size = [800,400], fps :: Int64 = 10, last=0, dpi=150)
ENV["GKSwstype"]="nul"
U = traj.U
S = traj.S
D = traj.D
I = traj.I
snenc = @sprintf("%5.2f",sum(traj.nenc)/traj.nsteps)
if last < 1
last = traj.nsteps
end
... | {"hexsha": "498b1d9f435292a969e41744a258df2c66a1ed5c", "size": 2928, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/animate.jl", "max_stars_repo_name": "m3g/kinetics", "max_stars_repo_head_hexsha": "f84fbd7120d8848b1bbfe5c9ec936fd2690e3e8d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_star... |
import os
import sys
import tarfile
import collections
import torch.utils.data as data
import shutil
import numpy as np
import random
from PIL import Image
from torchvision.datasets.utils import download_url, check_integrity
def isic_cmap(N=256, normalized=False):
def bitget(byteval, idx):
return ((byteva... | {"hexsha": "8eb6d63e6aebb118e8142bac616fe4474d8a9d96", "size": 2347, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/semantic_segmentation/deeplabv3plus/datasets/isic.py", "max_stars_repo_name": "mazeiomli/ARMA-Networks", "max_stars_repo_head_hexsha": "a7932abad7c4022311c0ec5263a302ab1cc6a354", "max_stars_r... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 9 15:15:50 2020
@author: Patrick
"""
"""Implementation of Fast Orthogonal Search"""
#==============================================
#nonlinear_data_generation.py
#==============================================
import numpy as np
from matplotlib import pyplot as plt
from... | {"hexsha": "cd92d9a7e42eb0898694db304eea9d1925010974", "size": 1098, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/nonlinear_data_generation.py", "max_stars_repo_name": "guangyizhangbci/Implementation-of-Fast-Orthogonal-Search", "max_stars_repo_head_hexsha": "17feb7569d1ab345c3cd234d572506959b9e70c0", "ma... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import hashlib
import shutil
import numpy as np
import tensorflow as tf
from tf_datasets.core.download import download_http, extract_gzip
from tf_datasets.core.base_dataset im... | {"hexsha": "b88ca70536d6f8a52de28d4836bcafe92b5c0a0c", "size": 4287, "ext": "py", "lang": "Python", "max_stars_repo_path": "tf_datasets/datasets_old/pascal_voc_2007.py", "max_stars_repo_name": "tmattio/tf_datasets", "max_stars_repo_head_hexsha": "03a11554355f3b7dc9acb3b01e7c98daca463bfc", "max_stars_repo_licenses": ["M... |
"""
Draw Figures - Chapter 5
This script generates all of the figures that appear in Chapter 5 of the textbook.
Ported from MATLAB Code
Nicholas O'Donoughue
25 March 2021
"""
import utils
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from examples import chapter5
def make_all_figures(cl... | {"hexsha": "03a8b8f37846a6da9072046a4f408d93689eb1b0", "size": 3245, "ext": "py", "lang": "Python", "max_stars_repo_path": "make_figures/chapter5.py", "max_stars_repo_name": "nodonoughue/emitter-detection-python", "max_stars_repo_head_hexsha": "ebff19acebcc1edfd941280e05f8ddf2ff20c974", "max_stars_repo_licenses": ["MIT... |
#!/usr/bin/r
suppressMessages(library(Rcpp))
suppressMessages(library(inline))
foo <- '
int i, j, na, nb, nab;
double *xa, *xb, *xab;
SEXP ab;
PROTECT(a = AS_NUMERIC(a));
PROTECT(b = AS_NUMERIC(b));
na = LENGTH(a); nb = LENGTH(b); nab = na + nb - 1;
PROTECT(ab = NEW_NUMERIC(nab));
xa = NUMERIC_POIN... | {"hexsha": "8a4083833792dbee55163fbb7b3b50e27049f84b", "size": 646, "ext": "r", "lang": "R", "max_stars_repo_path": "packrat/lib/x86_64-w64-mingw32/3.2.1/Rcpp/examples/RcppInline/RcppSimpleExample.r", "max_stars_repo_name": "Fredin/El-Habla-de-Monterrey", "max_stars_repo_head_hexsha": "dd3333663bf5f66a751033166137109f0... |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from scipy import optimize
from sklearn.utils.class_weight import compute_class_weight
from sklearn.preprocessing import LabelEncoder
from scipy import optimize
def make_class_with_unscored_labels(labels, unscored_labels_d... | {"hexsha": "5425e269113b300dc5ffbfcb80574c1607ed0081", "size": 6332, "ext": "py", "lang": "Python", "max_stars_repo_path": "Scripts/ECG_processing.py", "max_stars_repo_name": "Bsingstad/FYS-STK4155-oblig2", "max_stars_repo_head_hexsha": "81a587e3a64dd8f7ff1ca5868c09db2d4dccf896", "max_stars_repo_licenses": ["Apache-2.0... |
import nlcontrol.systems as nlSystems
import numpy as np
from simupy.systems import DynamicalSystem, SystemFromCallable
def append(*signals):
"""
Append a N_i-channel signals to a sum(N_i, i)-channel signal. Add as many signals as needed. The order of appearance determines the index of the output.
Paramet... | {"hexsha": "26f6d83ba26fee97e72db771fad735900e451223", "size": 4126, "ext": "py", "lang": "Python", "max_stars_repo_path": "nlcontrol/signals/signal_tools.py", "max_stars_repo_name": "LodeLand/nlcontrol", "max_stars_repo_head_hexsha": "9de5cc34cbc4835fc32e8b9c20ef3ea9da509fd9", "max_stars_repo_licenses": ["BSD-3-Clause... |
import numpy as np
import cv2
input = cv2.imread('input/strawberry.jpg')
height, width = input_image.shape[:2]
x_gauss = cv2.getGaussianKernel(width,250)
y_gauss = cv2.getGaussianKernel(height,200)
kernel = x_gauss * y_gauss.T
mask = kernel * 255 / np.linalg.norm(kernel)
ou... | {"hexsha": "abb4ba64e345114c0b5be170656a0f297a42cd96", "size": 511, "ext": "py", "lang": "Python", "max_stars_repo_path": "Vignette_filter.py", "max_stars_repo_name": "OhmVikrant/Vignette-Filter-using-OpenCV", "max_stars_repo_head_hexsha": "4ffe8ad956370721cea9b648765e22d6ae56cdcc", "max_stars_repo_licenses": ["MIT"], ... |
From mathcomp Require Import all_ssreflect.
Section Rename.
Definition upren r x :=
if x is x.+1 then (r x).+1 else 0.
Definition upnren r n := iter n upren r.
Corollary upnrenS r n x : upren (upnren r n) x = upnren (upren r) n x.
Proof. by rewrite /upnren -iterSr. Qed.
Lemma upnren_unfold r n : foral... | {"author": "aplas19-13", "repo": "cbn", "sha": "c284d3042433e444b24de25d8769397039bdafe3", "save_path": "github-repos/coq/aplas19-13-cbn", "path": "github-repos/coq/aplas19-13-cbn/cbn-c284d3042433e444b24de25d8769397039bdafe3/Util.v"} |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# Use this script for ground truth integrals of the vanilla BQ Gaussian process.
from typing import List, Tuple
import GPy
import numpy as np
from emukit.model_wrappers.gpy_quadrature_wrappers import Bas... | {"hexsha": "442286bd7391c7f5c32722a22e6594e6a6f97fb1", "size": 3759, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/emukit/quadrature/ground_truth_integrals_vanilla_bq.py", "max_stars_repo_name": "lfabris-mhpc/emukit", "max_stars_repo_head_hexsha": "ccb07f6bed0e9ae41dbeefdb3ad2ab247d3991e2", "max_stars_re... |
import numpy as np
import pyworld as pw
import soundfile as sf
import tensorflow as tf
from analyzer import SPEAKERS, pw2wav, read, read_whole_features
args = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string(
'train_file_pattern',
'./dataset/vcc2016/bin/Training Set/*/*.bin',
'training dir (to *.bin)')
def... | {"hexsha": "9d39a63b964a1b98ff6fd09258e6c0c557b48c16", "size": 2822, "ext": "py", "lang": "Python", "max_stars_repo_path": "build.py", "max_stars_repo_name": "entn-at/vae-npvc", "max_stars_repo_head_hexsha": "94a83b33bf17593aa402cb38408fdfad1339a120", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 146,... |
include("Density.jl")
function calc_design_matrix(umbrella_centers, data, sigma)
design_matrix = zeros(Float64, length(umbrella_centers) * length(data[1]), length(umbrella_centers))
for i = 1:length(umbrella_centers)
for j = 1:length(data[i])
for k = 1:length(umbrella_centers)
... | {"hexsha": "8c944efb8ccfa92a33061278aa68aafa4a38c6a0", "size": 587, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "notebook/DesignMatrix.jl", "max_stars_repo_name": "yutakasi634/MDToolbox.jl", "max_stars_repo_head_hexsha": "4a61ec671910d3fe25d86818a85e7929209d065d", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
# # Instrument Line Shapes
# Using packages:
using Plots
using Plots.PlotMeasures
# This needs to be installed from https://github.com/RadiativeTransfer/RadiativeTransfer.jl
using RadiativeTransfer.Absorption
using InstrumentOperator
# ## Load HITRAN data and CO2 cross sections
hitran_data = read_hitran(artifact("CO2... | {"hexsha": "020620a675d4eca2c09be1705b10fd62cbaff603", "size": 1428, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/src/pages/tutorials/CrossSection_convolution.jl", "max_stars_repo_name": "RemoteSensingTools/InstrumentOperator.jl", "max_stars_repo_head_hexsha": "9ed373f7707f1bf93800956c1359b4425190202b", "... |
import copy
import json
import os
import uuid
from inspect import signature
import numpy as np
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
from retrying import retry
import dask
import dask.dataframe as dd
from dask import delayed
from dask.dataframe.core import get_parallel_type
from dask.d... | {"hexsha": "53d50a0a3fe107c862e66a5d02497ebb88899f8f", "size": 24478, "ext": "py", "lang": "Python", "max_stars_repo_path": "spatialpandas/dask.py", "max_stars_repo_name": "ianthomas23/spatialpandas", "max_stars_repo_head_hexsha": "b6809e79f615e0be6fda6845b9725b5f87529c56", "max_stars_repo_licenses": ["BSD-2-Clause"], ... |
import time
import sqlite3
import pandas as pd
import numpy as np
import scipy as sp
from scipy import stats
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
'''
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import (RandomTreesE... | {"hexsha": "ed071631d9c43c142778bbfe7b489b56b4e65225", "size": 6636, "ext": "py", "lang": "Python", "max_stars_repo_path": "predictionTesting/predict2.py", "max_stars_repo_name": "Silenc3IsGold3n/RS3GEPredictionModel", "max_stars_repo_head_hexsha": "d7b5e7bd701dd35912b22e0bc315441289ff9861", "max_stars_repo_licenses": ... |
module TestClockResolution
import Benchmarks
using Base.Test
using Compat
res = Benchmarks.estimate_clock_resolution(1)
@test isa(res, UInt)
@test 1 <= res <= 10_000
res_2 = Benchmarks.estimate_clock_resolution()
@test res_2 <= res
end
| {"hexsha": "e25cba14a22aeba2a0f007c2a1a788615811faee", "size": 272, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/01_clock_resolution.jl", "max_stars_repo_name": "johnmyleswhite/Benchmarks.jl", "max_stars_repo_head_hexsha": "0cb8340ce5af3e175c86154cd6202843a4960adf", "max_stars_repo_licenses": ["MIT"], "ma... |
Elliot is an Undergraduate Students undergraduate at UC Davis. He is majors majoring in Chemical Engineering and Materials Science Materials Science & Engineering.
Please send lucrative job opportunities & fan mail to MailTo(egszkup AT gmail DOT com)
Elliot is like TNT...he knows Drama!
Elliot is my special friend... | {"hexsha": "4a0587023465e8f9f55c14b79ff869cd9b54fd99", "size": 757, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/ElliotSzkup.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import numpy as np
import ttarray as tt
from ... import check_dense,random_array
from ... import DENSE_SHAPE
import pytest
SLICE_PROTOTYPE=tt.ones_slice((2,2,3),int,((2,),),2)
import functools
def _product(seq):
return functools.reduce(lambda x,y:x*y, seq,1)
def _calc_chi(cluster,lefti=1,righti=1):
left,right=... | {"hexsha": "1ec7b50d5ac247d9aed5f39c4af27458fb589958", "size": 2126, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/core/creation/test_array_r1.py", "max_stars_repo_name": "sonnerm/ttarray", "max_stars_repo_head_hexsha": "c962cb2be303dfdb6743aa802bd11b89043e7b71", "max_stars_repo_licenses": ["MIT"], "max_... |
import pandas as pd
import numpy as np
import matplotlib.cm as cm
import matplotlib
from matplotlib.colors import LinearSegmentedColormap
from sklearn.preprocessing import StandardScaler
from transformers import BertTokenizerFast
from tqdm import tqdm
tqdm.pandas()
import ast
import logging
log_fmt = '%(asctime)s -... | {"hexsha": "6c72271f3132e98b5b0c55ec0187b720a4c1f432", "size": 4821, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/visualization/visualizer.py", "max_stars_repo_name": "howewenann/fake_news", "max_stars_repo_head_hexsha": "aa69c302c5b50fad08af321e1e116ed8506ebaf6", "max_stars_repo_licenses": ["FTL"], "max_... |
#!/usr/bin/env python3
# encoding: utf-8
import os
import threading
import datetime
import time
import pandas as pd
import numpy as np
from .data_sets import TimeSeries, LiveTimeSeries, TimeSeriesForecast
def _get_example_data_set_path():
this_dir, this_filename = os.path.split(__file__)
return os.path.join(... | {"hexsha": "44a1a1c33be366ac281eb57f7c634812cd3d9b98", "size": 3379, "ext": "py", "lang": "Python", "max_stars_repo_path": "timeline/example_data_sets.py", "max_stars_repo_name": "dumfug/mmis2", "max_stars_repo_head_hexsha": "7a1ea3180ec5818407799d5685dc6240b5c68697", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
DEFINER FORTH ." FORTH" DOES> ;
DEFINER UFLOAD ." UFLOAD" DOES> ;
DEFINER FNEGATE ." FNEGATE" DOES> ;
DEFINER F/ ." F/" DOES> ;
DEFINER F* ." F*" DOES> ;
DEFINER F+ ." F+" DOES> ;
DEFINER F- ." F-" DOES> ;
DEFINER LOAD ." LOAD" DOES> ;
DEFINER BVERIFY ." BVERIFY" DOES> ;
DEFINER VERIFY ." VERIFY" DOES> ;
DEFI... | {"hexsha": "86568622a58791f487182f7e9d6ac37eabed3b2e", "size": 4211, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "h2oforth/jup.f", "max_stars_repo_name": "hemmerling/cpp-h2oforth", "max_stars_repo_head_hexsha": "d97eb2d8cc93c9b0843bc20534f1da27f06502d3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
# -*- coding: utf-8 -*-
"""Tests for single-instance prediction"""
import os
import pytest
import numpy as np
import treelite
import treelite_runtime
from treelite.util import has_sklearn
from treelite.contrib import _libext
from .metadata import dataset_db
from .util import os_compatible_toolchains, check_predictor_o... | {"hexsha": "10040bceec5b2d77432a8a520206cd458b22ee59", "size": 2816, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/python/test_single_inst.py", "max_stars_repo_name": "wphicks/treelite", "max_stars_repo_head_hexsha": "d0bf6e3277fc07a82708ca1515108e374b4b8cdb", "max_stars_repo_licenses": ["Apache-2.0"], "... |
subroutine simunpack(cpack,len,idrstmpl,ndpts,fld)
!$$$ SUBPROGRAM DOCUMENTATION BLOCK
! . . . .
! SUBPROGRAM: simunpack
! PRGMMR: Gilbert ORG: W/NP11 DATE: 2000-06-21
!
! ABSTRACT: This subroutine unpacks a data field that was packed ... | {"hexsha": "612a28355fbeb434781167d043594268e0ef6b44", "size": 1847, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ungrib/src/ngl/g2/simunpack.f", "max_stars_repo_name": "martinremy/wps", "max_stars_repo_head_hexsha": "8bddbdbb612a0e019ae110df481461d5d904053a", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma contains_predE:
assumes "Predicate.eval (contains_pred A x) y"
obtains "contains A x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (contains A x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pred.eval (contains_pred A x) y... | {"llama_tokens": 175, "file": null, "length": 2} |
import scipy.signal
import numpy as np
# ===========================
# Set rewards
# ===========================
class Reward(object):
def __init__(self, factor, gamma):
# Reward parameters
self.factor = factor
self.gamma = gamma
# Set step rewards to total episode reward
def tot... | {"hexsha": "a207f8638e1fecb593e6da37fc38cc7160e80332", "size": 4775, "ext": "py", "lang": "Python", "max_stars_repo_path": "DRL/component/reward.py", "max_stars_repo_name": "mdecourse/lightDRL", "max_stars_repo_head_hexsha": "4eff160f3797f88d20a059104c75e49d5295d932", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
import numpy as np
import os
import logging
import pickle
import ray
from ray.tune import Trainable
from ray.tune.resources import Resources
from ray.experimental.sgd.tf.tf_runner import TFRunner
logger = logging.getLogger(__name__)
class TFTrainer:
def __init__(self,
model_creator,
... | {"hexsha": "55cdbeb82567cedebc310d950201479a8c2d4112", "size": 6800, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/ray/experimental/sgd/tf/tf_trainer.py", "max_stars_repo_name": "eisber/ray", "max_stars_repo_head_hexsha": "94a286ef1d8ad5a3093b7f996a811727fa0e2d3e", "max_stars_repo_licenses": ["Apache-2.... |
"""
Filename: plotter.py
Author: Deanna Nash, dlnash@ucsb.edu
Description: Functions for plotting
"""
# Import Python modules
import os, sys
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, L... | {"hexsha": "6271e131c0b3e1bfd38f2a501ebbc7f388fe489a", "size": 12398, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/deanna_nash/modules/plotter.py", "max_stars_repo_name": "dlnash/USWest_Water", "max_stars_repo_head_hexsha": "012d286977e330f82088736599bd9d7ba7083b41", "max_stars_repo_licenses": ["MIT... |
import random
import matplotlib.pyplot as plt
import numpy as np
import time
class Trainer(object):
def __init__(self, lr, batch_size, epoch, lamda):
self.lr = lr
self.batch_size = batch_size
self.epoch = epoch
self.lamda = lamda
def gradient_ascent(self, model, batch_x, batch... | {"hexsha": "b0f7f9567aff09e43f041c95778a4eafd2b954f3", "size": 1872, "ext": "py", "lang": "Python", "max_stars_repo_path": "AML/HW3/utils/trainer.py", "max_stars_repo_name": "ZRZ-Unknow/20fall-CourseNote", "max_stars_repo_head_hexsha": "e20735fd1ca0949eaa1c50d5cd84f147ec714404", "max_stars_repo_licenses": ["MIT"], "max... |
# Imports
import os
import random
import numpy as np
from time import time
import cProfile
import io
import pstats
import sys
sys.path.append("/Users/au568658/Desktop/Academ/Projects/tomsup")
import tomsup as ts
# Set seed
random.seed(1995)
# - Simulation settings - #
n_tests = 20
n_sim = 8
n_rounds = 60
# (Short ... | {"hexsha": "6728f93bf4a76c1818388f404ac4eac2a50942b7", "size": 1722, "ext": "py", "lang": "Python", "max_stars_repo_path": "papers/introducing_tomsup/comparison/tomsup_speed_comparison.py", "max_stars_repo_name": "langner/tomsup", "max_stars_repo_head_hexsha": "8dad2e701ef797c0a1d5ea323109efae1c527fe0", "max_stars_repo... |
// Copyright Tom Westerhout 2018.
// 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 "testing.hpp"
#include <utility>
#include <boost/static_views/raw_view.hpp>
#include <boost/static_... | {"hexsha": "a0c17a9b0e662ab7c4cc77adbf937bed27d3b705", "size": 4380, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/correctness/transform_pass.cpp", "max_stars_repo_name": "BoostGSoC17/static-map", "max_stars_repo_head_hexsha": "32537a69dbf693697577816ee06450fc4ec2a6fb", "max_stars_repo_licenses": ["BSL-1.0"... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The stateless command allows to encapsulate processing logic for specic
intent's command. Allows to easy build response processing pipelines with
multiple stages of intent data processing. The stateless commands may be shared
among various intents.
"""
import rando... | {"hexsha": "b67a267db0006ae3854dad2151d6107c62ea9638", "size": 14997, "ext": "py", "lang": "Python", "max_stars_repo_path": "chatbot2/command.py", "max_stars_repo_name": "ricksaha2000/MedBay-V1", "max_stars_repo_head_hexsha": "ee8ead4c3583066c778dc76ed0749feb70f412c8", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Created on Wed Nov 22 18:34:21 2017
@author: amaya
'''
import pandas as pd
import numpy as np
import h5py
allacecols = [
'proton_density',
'proton_temp',
'He4toprotons',
'proton_speed',
'x_dot_RTN',
... | {"hexsha": "f47c944a59304afa3a2aff6e72b829b9304812be", "size": 12709, "ext": "py", "lang": "Python", "max_stars_repo_path": "acedata.py", "max_stars_repo_name": "murci3lag0/swinsom", "max_stars_repo_head_hexsha": "586e81e9b2e6829c0d56127a2209891675e29fcd", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_count": 3,... |
from cvxopt import matrix, solvers
import numpy as npy
import math
class SVM:
def __init__(self, data):
self.data = data
def constructQPMatrices(self):
N = len(self.data)
P = npy.zeros((N, N))
for n in range(N):
dn = self.data[n]
for m in range(N):
... | {"hexsha": "97312013d58dd279454ea3a5f95974e5c3320bd7", "size": 3369, "ext": "py", "lang": "Python", "max_stars_repo_path": "hw7/svm.py", "max_stars_repo_name": "hakuliu/inf552", "max_stars_repo_head_hexsha": "3fc1fbec0ea1692742b76d4fe8bd0f6946eba4f6", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 1, "ma... |
import argparse
import gym
import numpy as np
import os
# import tensorflow as tf
import time
import pickle
import json
from argparse import Namespace
from MAA2C import MAA2C
from common.utils import agg_double_list
import sys
# import matplotlib.pyplot as plt
from env_utils import make_env
MAX_EPISODES = 2500
EPI... | {"hexsha": "bb0e4a5eae5bca8d490b37fd768c83f2de06f353", "size": 2137, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/maa2c_final/run_maa2c.py", "max_stars_repo_name": "nyu-ds-2019/flatland-reinforcement-learning", "max_stars_repo_head_hexsha": "3d7b25cac24b02e73769767019815a992ddab00f", "max_stars_repo... |
import cgnsutilities as cu
import numpy as np
# BC type dictionary
BCdic = cu.BC
BClist = list(BCdic.keys())
BCval = list(BCdic.values())
print(BCdic)
# Read a grid
grid = cu.readGrid('./inputFiles/grid_absper_vis_latest_output.cgns')
#grid = cu.readGrid('./inputFiles/naca0012.cgns')
# Print some info
grid.printInfo(... | {"hexsha": "cf4c94a29ff2f7d9af2a0ed187620e4d6c10c51b", "size": 2314, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/cgns_explore.py", "max_stars_repo_name": "tianboxi/cgnsutilities", "max_stars_repo_head_hexsha": "789ddfbbada4e9eb6f96d85af731e6e71cb17305", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
[STATEMENT]
lemma wlconf_ext_list [rule_format (no_asm)]: "
\<And>X. \<lbrakk>G,s\<turnstile>l[\<sim>\<Colon>\<preceq>]L\<rbrakk> \<Longrightarrow>
\<forall>vs Ts. distinct vns \<longrightarrow> length Ts = length vns
\<longrightarrow> list_all2 (conf G s) vs Ts \<longrightarrow> G,s\<turnstile>l(vns[\<m... | {"llama_tokens": 1738, "file": null, "length": 7} |
import os
import numpy as np
from lib.utils.utils import unique
from visualization.utils_name_generation import generate_image_name
import cv2
colormap = {
0: (128, 128, 128), # Sky
1: (128, 0, 0), # Building
2: (128, 64, 128), # Road
3: (0, 0, 192), # Sidewalk
4: (64, 64, 128)... | {"hexsha": "f77edd79ddc078e2b9a97d245640262d3e0f31c8", "size": 6842, "ext": "py", "lang": "Python", "max_stars_repo_path": "visualization/kitti_visualizer.py", "max_stars_repo_name": "luca-morreale/semantic-segmentation-pytorch", "max_stars_repo_head_hexsha": "d823fb4115a7ef5c8d47b3e5995a498bbcd9a9b6", "max_stars_repo_... |
[STATEMENT]
lemma inv_in_frac:
assumes "a \<in> carrier Q\<^sub>p"
assumes "a \<noteq>\<zero>"
shows "inv\<^bsub>Q\<^sub>p\<^esub> a \<in> carrier Q\<^sub>p"
"inv\<^bsub>Q\<^sub>p\<^esub> a \<noteq>\<zero>"
"inv\<^bsub>Q\<^sub>p\<^esub> a \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (... | {"llama_tokens": 646, "file": "Padic_Field_Padic_Fields", "length": 5} |
theory Automation
imports Graph_Theory.Graph_Theory
begin
section \<open>Automation\<close>
text \<open>
The purpose of this section is to collect use cases for proof automation in the graph library.
\<close>
subsection \<open>Noschinski\<close>
lemma (in wf_digraph) "u \<rightarrow>\<^sup>+ v \<Longrightarrow> ... | {"author": "wimmers", "repo": "archive-of-graph-formalizations", "sha": "cf49dd3379174cca7f3f1de16214e1c66238841e", "save_path": "github-repos/isabelle/wimmers-archive-of-graph-formalizations", "path": "github-repos/isabelle/wimmers-archive-of-graph-formalizations/archive-of-graph-formalizations-cf49dd3379174cca7f3f1de... |
# Copyright (c) Anyi Rao. All rights reserved.
import argparse
from datetime import datetime
import numpy as np
import json
import os
import os.path as osp
import pickle
import pdb
import shutil
from tqdm import tqdm
| {"hexsha": "55fb65b0fac8dd505abb934b0ac0232832f1b60a", "size": 217, "ext": "py", "lang": "Python", "max_stars_repo_path": "raykit/package.py", "max_stars_repo_name": "AnyiRao/raykit", "max_stars_repo_head_hexsha": "7b4bf7eea7bfe444e8ef377f3f035b179e5ef4a4", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
import base64
import io
from json import load as jsonload
from os import path
import cv2
import numpy as np
from PIL import Image
from keras import backend as K
from keras.models import load_model as load
from sklearn.externals import joblib
path_prefix = path.dirname(path.abspath(__file__))
config_path = path.join(p... | {"hexsha": "cac149680175e6dbec7976ac5606e63bd081e49e", "size": 3179, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml_models.py", "max_stars_repo_name": "miguendes/mnist-api", "max_stars_repo_head_hexsha": "26ec224a3ee5f37dc7e62be4519bae4b7ef6b6a1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "ma... |
module CartesianFDM
using Base.Iterators
using LinearAlgebra
using SparseArrays
using Reexport
@reexport using Symbolics
const subscripts = ("\u2081", "\u2082", "\u2083")
const TupleN{T,N} = NTuple{N,T}
export scalar, vector
export Periodic, periodic
export NonPeriodic, nonperiodic
export Dirichlet, dir
export N... | {"hexsha": "db21aaf312f021a165e84a2b4347e26255aeb9e5", "size": 770, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/CartesianFDM.jl", "max_stars_repo_name": "JuliaCutCell/CartesianFDM.jl", "max_stars_repo_head_hexsha": "bb1b2812c9649b2b46b62ba30b3cbf60f702b3ac", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
// __BEGIN_LICENSE__
// Copyright (C) 2006-2010 United States Government as represented by
// the Administrator of the National Aeronautics and Space Administration.
// All Rights Reserved.
// __END_LICENSE__
#include <vw/Plate/Exception.h>
#include <vw/Plate/Rpc.h>
#include <vw/Plate/RpcChannel.h>
#include <vw/Plate/... | {"hexsha": "ce0e741ad7bf641cf2fab91f55f78d607c20216f", "size": 6537, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/vw/Plate/Rpc.cc", "max_stars_repo_name": "tkeemon/visionworkbench", "max_stars_repo_head_hexsha": "df59fcb31191e1fc4fecfe1901963da1614a52b1", "max_stars_repo_licenses": ["NASA-1.3"], "max_stars_c... |
import numpy as np
##### DESCRIPTION #####
# This part of the module handles the mathematic
# formulation for channel coefficients estimation
# Compute the first and second coefficients of the fft considering that the third one is 0
def get_fft_01(rss): # Vector with the 4 rrs-like values corr... | {"hexsha": "2e4147115347003fc503c383d0bbc2fb21c12061", "size": 2815, "ext": "py", "lang": "Python", "max_stars_repo_path": "py_aco/core.py", "max_stars_repo_name": "Joanguitar/ACO", "max_stars_repo_head_hexsha": "3a52ddbdb1bd8c5826b8d0fcfca02f8c4e37be74", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
module DynamicPricingExamples
end # module
| {"hexsha": "a6ae10cab1e11f1dc254bfdfb64e7fc9d8ed9a11", "size": 44, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/DynamicPricingExamples.jl", "max_stars_repo_name": "StatisticalRethinkingJulia/DynamicPricingExamples.jl", "max_stars_repo_head_hexsha": "a6fae1736bf30f7aeed22452630c3ca3f018c50a", "max_stars_rep... |
# 4. faza: Analiza podatkov
Sestevek_po_pridelkih_regijah$leto <- as.character(Sestevek_po_pridelkih_regijah$leto)
Sestevek_po_pridelkih_regijah$Kolicina <- as.character(Sestevek_po_pridelkih_regijah$Kolicina)
Sestevek_po_pridelkih_regijah <- Sestevek_po_pridelkih_regijah %>% mutate(leto = parse_integer(leto), K... | {"hexsha": "43e35bcbb24637bf9ba496c25596af9154e6fa4f", "size": 804, "ext": "r", "lang": "R", "max_stars_repo_path": "analiza/analiza.r", "max_stars_repo_name": "BlackPhoenixSlo/APPR-2020-21", "max_stars_repo_head_hexsha": "60578b3d0cad6fe9aa0aef216fa44b11330b1d91", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
from __future__ import division
# Python 3 compatibility
#from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import map
from builtins import range
import re
import math
import networkx as nx
import subprocess as s
from struct import pack
import RNA
import ribolands as r... | {"hexsha": "e618a16f7550ae3cc2e39c2b5a4b257bba5f4794", "size": 42847, "ext": "py", "lang": "Python", "max_stars_repo_path": "ribolands/trafo.py", "max_stars_repo_name": "entzian/ribolands", "max_stars_repo_head_hexsha": "04bb3274947ff81ef0d5b859b38e56b0c0709f15", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
MODULE complex_class
IMPLICIT NONE
! Type definition
TYPE,PUBLIC :: complex_ob ! This will be the name we instantiate
PRIVATE
REAL :: re ! Real part
REAL :: im ! Imaginary part
END TYPE complex_ob
! Now add methods
CONTAINS
!(Insert methods here)
SUBROUTINE ... | {"hexsha": "9bfe78c95f8d316b7c09b767c4e178b3d0f2d054", "size": 406, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Fortran952003ForScientistsandEngineers3rdStephenJChapman/chap16/complex_class.f90", "max_stars_repo_name": "yangyang14641/FortranLearning", "max_stars_repo_head_hexsha": "3d4a91aacd957361aff58730... |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Desription
# ==============================================================================
#
# Tests related to the API function to invert rotations.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
... | {"hexsha": "f246564718aee8e5b5ae50df92ba08ca59e86edb", "size": 3223, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/inv_rotations.jl", "max_stars_repo_name": "ChrisRackauckas/ReferenceFrameRotations.jl", "max_stars_repo_head_hexsha": "eded8889b66537e0907398ac53299587f8839d69", "max_stars_repo_licenses": ["M... |
# noinspection PyUnresolvedReferences
from difs import dif1, dif2, dif3, dif4
import numpy as np
def next_move(difficulty, *args):
difficulties = {
1: dif1.completely_random, # random element in avalable moves
2: dif2.winning_or_block_then_random, # Order: win, block, random in available moves
... | {"hexsha": "dd2ce438e48e1afca3564c27b6c989473efdef5d", "size": 641, "ext": "py", "lang": "Python", "max_stars_repo_path": "NaC/computer_move.py", "max_stars_repo_name": "thdb-theo/Board-Games", "max_stars_repo_head_hexsha": "0af6ca2e4c8cfbc5642070e35d91edcc899b03a8", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.