text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | {"hexsha": "c31d9fc5064fbf3ea92af0b2e7606a16cac05291", "size": 5619, "ext": "py", "lang": "Python", "max_stars_repo_path": "language/mentionmemory/modules/entity_attention_layer_test.py", "max_stars_repo_name": "urikz/language", "max_stars_repo_head_hexsha": "503aca178c98fed4c606cf83e58ae0f84012a4d9", "max_stars_repo_l... |
#TO Use:
# calculates a file based on the number of cores in total, across multiple nodes
#Example With Input Args:
# mpirun -c 12 python runpyCGM_MPI_Frames.py -o MPIFramesOutput -i Sample_ROM.c3d -v Sample_SM.vsk -x Sample_Static.c3d
import time
import numpy as np
import sys
import getopt
import pycgmIO
import pyc... | {"hexsha": "40dd35b73c2c41408a45fd46d5d04ca63fbd6e1d", "size": 6875, "ext": "py", "lang": "Python", "max_stars_repo_path": "HPC/runpyCGM_MPI.py", "max_stars_repo_name": "niravkin/pyCGM", "max_stars_repo_head_hexsha": "53e4a65a5ba70fe51b130adbe32ed0e732d63f74", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 21, ... |
#import matplotlib
#matplotlib.use('Agg')
#import matplotlib.pyplot as plt
#import matplotlib.cm as CM
import numpy as np
import time
import torch
import torch.nn as nn
import os
#import visdom
import random
#from tqdm import tqdm as tqdm
import sys;
import math
#import skimage.io as io
#from scipy import ndimage
#fro... | {"hexsha": "1bb361a0f3d8c20d63987d00f167fd2186de9c99", "size": 3289, "ext": "py", "lang": "Python", "max_stars_repo_path": "u24_lymphocyte/prediction/pytorch_resnet34_model/load_til_resnet34_external_input.py", "max_stars_repo_name": "ShahiraAbousamra/til_classification", "max_stars_repo_head_hexsha": "cede5453cb46b9c1... |
```python
import igraph as ig
import numpy as np
from sympy.solvers import nsolve
from sympy import *
```
```python
from scipy.stats import rankdata
```
```python
from matplotlib.font_manager import FontProperties
import matplotlib.gridspec as gridspec
```
```python
from math import radians, cos, sin, asin, sqrt
... | {"hexsha": "7ff4252337bee6d112a8b01f9d7db59bfc4a6441", "size": 14533, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "turing_instability_for_language_dynamics_galicia.ipynb", "max_stars_repo_name": "sayat-mimar/language_dynamics", "max_stars_repo_head_hexsha": "c84e1c69cf6751a5a1785341738ec3125f7a98... |
# -*- coding: utf-8 -*-
################################################################################
######################### NAMING CONVENTIONS ###################################
################################################################################
# Constants are in capital letters separated by unde... | {"hexsha": "5767ec7fe360d300d9a5484c033ace7bc1c063cc", "size": 1361, "ext": "py", "lang": "Python", "max_stars_repo_path": "plasticitygrain/PopModel.py", "max_stars_repo_name": "alfredorago/PlasticityStructure", "max_stars_repo_head_hexsha": "d43bd9734f1fe4626d6aa7c968cb4e8380546690", "max_stars_repo_licenses": ["MIT"]... |
__author__ = 'Marcelo Ferreira da Costa Gomes'
import numpy as np
import datetime
'''
Return Brazilian epidemiological week from passed date
'''
def extractweekday(x=datetime.datetime):
# Extract weekday as [Sun-Sat] |-> [0-6]
w = x.isoweekday() % 7 # isoweekday() returns weekday with [Mon-Sun] as [1-7]
... | {"hexsha": "cf1dfb3edda57129b261707e729a6cb5b37ee863", "size": 2980, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/episem.py", "max_stars_repo_name": "nahumsa/covidash", "max_stars_repo_head_hexsha": "24f3fdabb41ceeaadc4582ed2820f6f7f1a392a1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 12... |
/* tests for using boost::hash with boost::array
* (C) Copyright Marshall Clow 2012
* 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 <string>
#include <iostream>
#include <boost/array.hpp>
... | {"hexsha": "b4741c2e17e93248b79177639f3c165360f6d64a", "size": 1332, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libs/array/test/array_hash.cpp", "max_stars_repo_name": "jmuskaan72/Boost", "max_stars_repo_head_hexsha": "047e36c01841a8cd6a5c74d4e3034da46e327bc1", "max_stars_repo_licenses": ["BSL-1.0"], "max_sta... |
[STATEMENT]
lemma Sym: assumes "H \<turnstile> t EQ u" shows "H \<turnstile> u EQ t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. H \<turnstile> u EQ t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. H \<turnstile> u EQ t
[PROOF STEP]
have "{} \<turnstile> (t EQ u AND t EQ t) IMP (t EQ t IM... | {"llama_tokens": 935, "file": "Incompleteness_SyntaxN", "length": 12} |
import os
import re
import pandas as pd
import numpy as np
import sklearn
import nltk
from sklearn.model_selection import train_test_split
from sklearn.metrics import f1_score,accuracy_score,confusion_matrix
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.utils import shuffle
nltk.download('pu... | {"hexsha": "add933a569e3769d140c493f7aebfe0b1b22e7b9", "size": 4236, "ext": "py", "lang": "Python", "max_stars_repo_path": "Neural Network/CNN.py", "max_stars_repo_name": "avinashsai/Sentiment-Prediction-using-word-Embeddings", "max_stars_repo_head_hexsha": "fbf341e35b10fb4670c4627ddbbe7e4b217b742a", "max_stars_repo_li... |
#ifndef BOOST_THREAD_PROVIDES_FUTURE
#define BOOST_THREAD_PROVIDES_FUTURE
#endif
// #ifndef BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
// #define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
// #endif
// #ifndef BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
// #define BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
// #end... | {"hexsha": "811dcb8b0b6d80ab3bb4365287e6319427764d47", "size": 1114, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "examples/Boost-thread/foo.cpp", "max_stars_repo_name": "Costallat/hunter", "max_stars_repo_head_hexsha": "dc0d79cb37b30cad6d6472d7143fe27be67e26d5", "max_stars_repo_licenses": ["BSD-2-Clause"], "max... |
C
C***********************************************************************
C *
C NACHOS II - A Finite Element Computer Program *
C for Incompressible Flow Problems *
C ... | {"hexsha": "61af62b6ea8954d246e9558ece890b97c16ed734", "size": 1870, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/seg1.f", "max_stars_repo_name": "nachos-ii/nachos-ii", "max_stars_repo_head_hexsha": "f7479fc36919de64136c1aaa4c420ad1bcebb004", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":... |
"""
Example of the Python binding of the Gpufit library which implements
Levenberg Marquardt curve fitting in CUDA
https://github.com/gpufit/Gpufit
Multiple fits of a 2D Gaussian peak function with Poisson distributed noise
http://gpufit.readthedocs.io/en/latest/bindings.html#python
This examp... | {"hexsha": "435c4deca4ab6dc00cad077f278ed2a601b534b6", "size": 3889, "ext": "py", "lang": "Python", "max_stars_repo_path": "Gpufit/python/examples/gauss2d.py", "max_stars_repo_name": "yongdengzhang/Gpufit", "max_stars_repo_head_hexsha": "6e719585badff1c40488a1439fa04da1792e41b8", "max_stars_repo_licenses": ["MIT"], "ma... |
!! R468 array-constructor
! is (/ ac-spec /)
! or lbracket ac-spec rbracket
!
! NOTE 4.68
!
dimension X(3), Y(3,2)
X = (/ 3.2, 4.01, 6.5 /)
Y = RESHAPE (SOURCE = [ 2.0, [4.5, 4.5 ], X ], SHAPE = [ 3, 2 ])
end
| {"hexsha": "2e0aff26bf2875cbd0cd9c0e6a614e2a746cc4e6", "size": 215, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/rule-tests/R468.f90", "max_stars_repo_name": "OpenFortranProject/ofp-sdf", "max_stars_repo_head_hexsha": "202591cf4ac4981b21ddc38c7077f9c4d1c16f54", "max_stars_repo_licenses": ["BSD-3-Claus... |
import sympy
def para_bhat():
tht = sympy.symbols('theta', real=True)
xhat = 2*sympy.cos(tht)**2 - sympy.sin(tht)**2
yhat = 3*sympy.cos(tht)* sympy.sin(tht)
sympy.pprint(xhat)
xhat = xhat.simplify()
yhat = yhat.simplify()
print('simpler xhat, yhat')
sympy.pprint([xhat, yhat])
r2 =... | {"hexsha": "54e60b28632f914bf1cc716389bcddba16a2fa8f", "size": 2995, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/analytic/alpha_limit.py", "max_stars_repo_name": "wolfram74/magnetic_symmetry_project", "max_stars_repo_head_hexsha": "6008c8253a6275b6e602739fc7a36f7a313fd994", "max_stars_repo_licenses": ["M... |
(*
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: BSD-2-Clause
*)
(* WP-specific Eisbach methods *)
theory Eisbach_WP
imports
Eisbach_Tools.Eisbach_Methods
NonDetMonadVCG
Eisbach_Tools.Conjuncts
Eisbach_Tools.Rule_By_Method
WPI
begin
text \<open>
Methods for manip... | {"author": "seL4", "repo": "l4v", "sha": "9ba34e269008732d4f89fb7a7e32337ffdd09ff9", "save_path": "github-repos/isabelle/seL4-l4v", "path": "github-repos/isabelle/seL4-l4v/l4v-9ba34e269008732d4f89fb7a7e32337ffdd09ff9/lib/Monads/wp/Eisbach_WP.thy"} |
import numpy as np
class SplineIntegralSimple:
@staticmethod
def validation_entry(p, sides):
try:
p = int(p)
except Exception:
raise TypeError("p must be an integer. Type = " + str(type(p)))
if p < 2:
if sides is None:
p... | {"hexsha": "b7fb73082c632a25b1b6675bd0aed4364c421509", "size": 9039, "ext": "py", "lang": "Python", "max_stars_repo_path": "femnurbs/SplineSimpleIntegral.py", "max_stars_repo_name": "carlos-adir/FEM-Nurbs", "max_stars_repo_head_hexsha": "0c63d736fe6b49b0aec3f0a63573548eae8b65f2", "max_stars_repo_licenses": ["MIT"], "ma... |
#define BOOST_TEST_MODULE QIDORSRequest
#include <boost/test/unit_test.hpp>
#include <set>
#include "odil/json_converter.h"
#include "odil/DataSet.h"
#include "odil/Tag.h"
#include "odil/webservices/HTTPRequest.h"
#include "odil/webservices/Utils.h"
#include "odil/webservices/QIDORSRequest.h"
#include "odil/webserv... | {"hexsha": "4d9856793da0786cf6e82e81a78f205f98c2ea55", "size": 8881, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/code/webservices/QIDORSRequest.cpp", "max_stars_repo_name": "icryrainix/odil", "max_stars_repo_head_hexsha": "7fbcf7bb00af159c2e500bd0c3da1519a4806fb4", "max_stars_repo_licenses": ["CECILL-B"]... |
import pyglet.gl as gl
from ctypes import pointer, cast, create_string_buffer, POINTER, c_char, byref, c_int
import numpy as np
import ctypes
# The Shader class takes as input a list of (path, shader type) tuples
class Shader:
program = -1
uniform_locations = {}
def __init__(self, shader_input):
... | {"hexsha": "63abb1afe894d36a364ef9ddb8a30cd4f31d0413", "size": 5578, "ext": "py", "lang": "Python", "max_stars_repo_path": "shaderpy/__init__.py", "max_stars_repo_name": "samuelkarabetian/shaderpy", "max_stars_repo_head_hexsha": "5bd976dd43c0bbe666fc1f587a03a01b33f0024c", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
\chapter{Glossary of notations}
\section{General}
\begin{itemize}
\ii $\forall$: for all
\ii $\exists$: there exists
\ii $\sign(\sigma)$: sign of permutation $\sigma$
\ii $X \implies Y$: $X$ implies $Y$
\end{itemize}
\section{Functions and sets}
\begin{itemize}
\ii $f\im(S)$ is the image of $f : X \to Y$ for $S \s... | {"hexsha": "0b3ffd46c6cc03c3a2869f5b10606674deaae50e", "size": 14769, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "corpus/napkin/tex/backmatter/notation.tex", "max_stars_repo_name": "aDotInTheVoid/ltxmk", "max_stars_repo_head_hexsha": "ee461679e51e92a0e4b121f28ae5fe17d5e5319e", "max_stars_repo_licenses": ["Apac... |
import warnings
try:
import matplotlib.pyplot as pl
except ImportError:
warnings.warn("matplotlib could not be loaded!")
pass
from ._labels import labels
from ..utils import format_value, ordinal_str
from ._utils import convert_ordering, convert_color, merge_nodes, get_sort_order, sort_inds, dendrogram_coor... | {"hexsha": "4868b2b6b173a8ebbc8dd63361f19d963e50b327", "size": 17212, "ext": "py", "lang": "Python", "max_stars_repo_path": "shap/plots/_bar.py", "max_stars_repo_name": "giancarloGiuffra/shap", "max_stars_repo_head_hexsha": "eea48b494e9305c59055c3dce4a71e62ba0f96da", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import base64
import io
import pandas as pd
import numpy as np
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import plotly.express as px
# Velocity conversion table
convel = pd.DataFrame(data={'m/s':[1.0, 1/3.6, 1/2.237, 1/1.944],... | {"hexsha": "497ecc86a2afe0c2dd60ce00b702f1341cfe6abb", "size": 10712, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "gborelli89/WindroseDash", "max_stars_repo_head_hexsha": "3b9d2efce4430167927a3732f84f290b3de70599", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
#!/usr/bin/env python3
"""
INPUT
Expected input file format (pileup):
Each line consists of 5 (or optionally 6) tab-separated columns:
1. Sequence identifier
2. Position in sequence (starting from 1)
3. Reference nucleotide at that position
4. Number of aligned reads covering that position (depth of co... | {"hexsha": "6c6809d9a46a9b2520e0dfc340e9f98fdd36cfa3", "size": 4414, "ext": "py", "lang": "Python", "max_stars_repo_path": "sandbox/jorvis/generate_read_coverage_figure.py", "max_stars_repo_name": "senjoro/biocode", "max_stars_repo_head_hexsha": "6697c17570126d99fb1cbeabf5b8322db006643d", "max_stars_repo_licenses": ["M... |
# General imports and helper functions
import os, sys
import pandas as pd
import numpy as np
import math
import requests
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import PIL
from IPython.display import Image
def show_gallery(data, num_images=12, randomize=True, add_name=False, add_prob=False, fl... | {"hexsha": "32c7d7dc4bcd1819970a05bd5d1bc51bb4c9189b", "size": 2657, "ext": "py", "lang": "Python", "max_stars_repo_path": "Part3/tutorial_helper.py", "max_stars_repo_name": "zurCocaP/NimbusML-Presentation", "max_stars_repo_head_hexsha": "ed39bc74be8235a05095868e5a518f7ff341de0b", "max_stars_repo_licenses": ["MIT"], "m... |
!
! Copyright 2011 Sebastian Heimann
!
! 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... | {"hexsha": "6929167aadb834ae1f0b3c1fb81798956a32585f", "size": 3811, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "source_info.f90", "max_stars_repo_name": "emolch/kiwi", "max_stars_repo_head_hexsha": "8aa37d74b578afadb344a34117a99b8d144f4a6b", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 23... |
"""
This script runs a policy gradient algorithm
"""
from gym.envs import make
from modular_rl import *
import argparse, sys, cPickle
from tabulate import tabulate
import shutil, os, logging
import gym
import numpy as np
if __name__ == "__main__":
parser = argparse.ArgumentParser(formatter_class=argparse.Argumen... | {"hexsha": "0777841de29483871c7f301d9973bae71040557a", "size": 2415, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_pg.py", "max_stars_repo_name": "domluna/ml_p5_capstone", "max_stars_repo_head_hexsha": "eb80007b21813826ef52c23b6b2676f4812cfb66", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""ploting tools."""
from re import A
import numpy as np
import nibabel as nb
import pandas as pd
from nilearn.signal import clean
import matplotlib.pyplot as plt
from matplotlib import gridspec as mgs
imp... | {"hexsha": "8982cd9550135dd09ca0281e6de05563396c6422", "size": 22749, "ext": "py", "lang": "Python", "max_stars_repo_path": "xcp_abcd/utils/plot.py", "max_stars_repo_name": "PennLINC/xcp-abcd", "max_stars_repo_head_hexsha": "408d26eb6c84bea3fd0419faefd67082af57806a", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#ifndef __GSLEXTRA_H__
#define __GSLEXTRA_H__
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <gsl/gsl_sf.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_permutation.h>
#include <gsl/gsl_complex.h>
#include <gsl/gsl_complex_math.h>
#include <gsl/gsl_matr... | {"hexsha": "eb404d7654c27b204c73acf9d7a808e653ff237d", "size": 3558, "ext": "h", "lang": "C", "max_stars_repo_path": "include/gslextra.h", "max_stars_repo_name": "Walter-Feng/Overlap", "max_stars_repo_head_hexsha": "daddeb4b81bd93cd5450b1a172c8653dbbfc26d6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
clear;
% Setarea formatului de scriere a randurilor
format compact
% Definirea functiei de integrat
F=inline('1./x');
% Incarcarea vectorului x cu elementele cuprinse
% intre limitele de integrare
x=1:1e-2:2;
% Evaluarea functiei de integrat in aceste puncte
y=feval(F,x);
% Incarcarea solutiei exacte
... | {"author": "Sable", "repo": "mcbench-benchmarks", "sha": "ba13b2f0296ef49491b95e3f984c7c41fccdb6d8", "save_path": "github-repos/MATLAB/Sable-mcbench-benchmarks", "path": "github-repos/MATLAB/Sable-mcbench-benchmarks/mcbench-benchmarks-ba13b2f0296ef49491b95e3f984c7c41fccdb6d8/8416-widely-used-programming-environments-in... |
import onnx
import logging
import numpy as np
from onnx import numpy_helper
def count_param(model: onnx.ModelProto) -> int:
onnx_weights = model.graph.initializer
params = 0
for onnx_w in onnx_weights:
try:
weight = numpy_helper.to_array(onnx_w)
params += np.prod(weight.sha... | {"hexsha": "e95d72e8c98cd77e445dfcb8285ad3e90d91590a", "size": 446, "ext": "py", "lang": "Python", "max_stars_repo_path": "onnx_analyzer/param_counter.py", "max_stars_repo_name": "ksang/onnx-analyzer", "max_stars_repo_head_hexsha": "35f95eea570ffb6a77e45113dc0e507eb654bc12", "max_stars_repo_licenses": ["MIT"], "max_sta... |
#=
- Open this script from Atom
- Install package uber-Juno
- restart Atom and open again
- cmd+shift+enter will start
=#
using Plots
pyplot()
plot(rand(4,4))
| {"hexsha": "587479f04f0080202ec95d38cc19f6fad268bc6e", "size": 159, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "plotExer/juno_sample.jl", "max_stars_repo_name": "terasakisatoshi/juliaExer", "max_stars_repo_head_hexsha": "e3c2195f39de858915a3dcd47684eccbb7ecb552", "max_stars_repo_licenses": ["MIT"], "max_stars... |
from __future__ import print_function
import tensorflow as tf
import tensorflow.contrib.slim as slim
import os
import sys
from absl import flags
import numpy as np
npa = np.array
DEFAULT_IMAGE_SHAPE = (1, 299, 299, 1)
class Model(object):
def __init__(self, checkpoint_path, model_name, image=None, num_classes=10... | {"hexsha": "38b4c33809ee45a8a5606aae56d2b29ac961b8b4", "size": 6942, "ext": "py", "lang": "Python", "max_stars_repo_path": "npc/model.py", "max_stars_repo_name": "dicarlolab/npc", "max_stars_repo_head_hexsha": "0df9a905a39e9d8675638126c94dbb14eb16fc43", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 13, "max_st... |
\documentclass[journal,twoside,web]{ieeecolor}
\usepackage{tmi}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\markboth{\journa... | {"hexsha": "8f7d8c3ef98439d79c1e79cea168d9d15c19c316", "size": 36264, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "TMI2021/tmi.tex", "max_stars_repo_name": "Liuhongzhi2018/Medical-Images", "max_stars_repo_head_hexsha": "7bd14a1cbe9fb68a40ebe8c94510a6c5c57a89ef", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
from configs import cfg
from src.utils.record_log import _logger
from src.utils.file import load_glove, save_file, load_file
from src.utils.nlp import dynamic_length, dynamic_keep
from src.utils.tree.shift_reduce import shift_reduce_constituency_forest
from os.path import join as pjoin
import os
import random
import ma... | {"hexsha": "fb6424ce7d360a36d0f6d5e983463aaba41f1b58", "size": 17186, "ext": "py", "lang": "Python", "max_stars_repo_path": "BiBloSA/exp_SST/src/dataset.py", "max_stars_repo_name": "mikimaus78/ml_monorepo", "max_stars_repo_head_hexsha": "b2c2627ff0e86e27f6829170d0dac168d8e5783b", "max_stars_repo_licenses": ["BSD-3-Clau... |
[STATEMENT]
lemma three_step_Suc:
"three_step r = 0 \<Longrightarrow> three_step (Suc (Suc r)) = 2"
"three_step r = 0 \<Longrightarrow> three_step (Suc r) = 1"
"three_step r = (Suc 0) \<Longrightarrow> three_step (Suc r) = 2"
"three_step r = (Suc 0) \<Longrightarrow> three_step (Suc (Suc r)) = 0"
"three_step ... | {"llama_tokens": 351, "file": "Consensus_Refined_MRU_Three_Steps", "length": 1} |
% This LaTeX was auto-generated from an M-file by MATLAB.
% To make changes, update the M-file and republish this document.
%%% \documentclass{article}
%%% \usepackage{graphicx}
%%% \usepackage{color}
%%% \sloppy
%%% \definecolor{lightgray}{gray}{0.5}
\setlength{\parindent}{0pt}
%%% \begin{document}
\sub... | {"hexsha": "45856fa6eca4c0d1ebff697459d66a622345ea39", "size": 2858, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/algs_examples_published/doc_FPNLSF.tex", "max_stars_repo_name": "qwtb/qwtb", "max_stars_repo_head_hexsha": "f6c79c7dca4065fd85d6f1c05257c1af34e85e34", "max_stars_repo_licenses": ["MIT"], "max_st... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | {"hexsha": "e2711ef5d2661e2bb1d6d13702d635a8c11cb263", "size": 8981, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/ut/python/optimizer/test_bprop_mindir.py", "max_stars_repo_name": "mindspore-ai/mindspore", "max_stars_repo_head_hexsha": "a9fbb25530a2874166ff0045ddcdfc73207bf5eb", "max_stars_repo_licenses... |
#redirect Front Page/Talk
| {"hexsha": "a2e2920437f905d439eb6b82cbce1df8ff8b09dc", "size": 26, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Front_Page_Sandbox.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import gym
import numpy as np
import argparse
import pygame, sys
from pygame.locals import *
import manimalai
BLACK = (0, 0, 0)
class Display(object):
def __init__(self, display_size, task_id):
self.width = display_size[0]
self.height = display_size[1]
self.env = gym.make('Manim... | {"hexsha": "5c11be3a3a2a2fbfcf0a07201a13844e250223dc", "size": 2324, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/manual_control.py", "max_stars_repo_name": "miyosuda/manimalai", "max_stars_repo_head_hexsha": "cb22bea810260e6be38348e4278d6cf94df3ddaf", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
[STATEMENT]
lemma min_per_pos: "w \<noteq> \<epsilon> \<Longrightarrow> 0 < min_period w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. w \<noteq> \<epsilon> \<Longrightarrow> 0 < min_period w
[PROOF STEP]
using min_per_per
[PROOF STATE]
proof (prove)
using this:
?w \<noteq> \<epsilon> \<Longrightarrow> period ?w (... | {"llama_tokens": 170, "file": "Combinatorics_Words_CoWBasic", "length": 2} |
#include <CoreServices/CoreServices.r>
resource 'STR#' (126) { {
"PPAPI NativeClient",
"PPAPI NativeClient Plug-in"
} };
resource 'STR#' (127) { {
"PPAPI NativeClient Module - SRPC",
} };
resource 'STR#' (128) { {
"application/x-ppapi-nacl-srpc",
"nexe",
} };
| {"hexsha": "d19778ddfd73effe91ad8e425dff2246bca36f6d", "size": 273, "ext": "r", "lang": "R", "max_stars_repo_path": "src/trusted/plugin/osx_ppapi/ppNaClPlugin.r", "max_stars_repo_name": "eseidel/native_client_patches", "max_stars_repo_head_hexsha": "c699f77e085b91fcc1684ecb63e2e211733afbde", "max_stars_repo_licenses": ... |
from pynq import Overlay
from pynq import Xlnk
from pynq import MMIO
from spec_plot import SpecPlot
from dma_timer import DmaTimer
from timer import Timer
import xrfclk
import xrfdc
import os
import numpy as np
import ipywidgets as ipw
import spectrum_widgets as sipw
import transmitter, bandwidth_selector, spectrum_ff... | {"hexsha": "054a4c1d0ef8326a5c08f2639247856c0a1620ba", "size": 19957, "ext": "py", "lang": "Python", "max_stars_repo_path": "rfsoc_sam/rfsoc_sam.py", "max_stars_repo_name": "plysaght/rfsoc_sam", "max_stars_repo_head_hexsha": "e299303fce67ba5f682b7fc96c582ec25af739f9", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
function pdf = triangle_pdf ( x, a, b, c )
%*****************************************************************************80
%
%% TRIANGLE_PDF evaluates the Triangle PDF.
%
% Discussion:
%
% Given points A <= B <= C, the probability is 0 to the left of A,
% rises linearly to a maximum of 2/(C-A) at B, drops line... | {"author": "johannesgerer", "repo": "jburkardt-m", "sha": "1726deb4a34dd08a49c26359d44ef47253f006c1", "save_path": "github-repos/MATLAB/johannesgerer-jburkardt-m", "path": "github-repos/MATLAB/johannesgerer-jburkardt-m/jburkardt-m-1726deb4a34dd08a49c26359d44ef47253f006c1/prob/triangle_pdf.m"} |
// This file is part of the dune-stuff project:
// https://github.com/wwu-numerik/dune-stuff
// Copyright holders: Rene Milk, Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include "config.h"
#include <boost/format.hpp>
#include <dune/common/unused.hh>
#include "me... | {"hexsha": "257eba1ab5d262a35dd065136c90bf368d9bc5e9", "size": 3437, "ext": "cc", "lang": "C++", "max_stars_repo_path": "dune/stuff/common/logging.cc", "max_stars_repo_name": "ftalbrecht/dune-stuff-simplified", "max_stars_repo_head_hexsha": "fc1f80dedaa78fae6e6d67e8f5424a6b3ec86b5d", "max_stars_repo_licenses": ["BSD-2-... |
[STATEMENT]
lemma condition_true_triv [simp]:
"condition (\<lambda>_. True) A B = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. condition (\<lambda>_. True)
A
B = A
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>x. condition (\<lambda>_. True)
A
B x = A x
[PROOF S... | {"llama_tokens": 182, "file": "Planarity_Certificates_l4v_lib_wp_NonDetMonadLemmas", "length": 3} |
"""
parse_difflist(data, offset, bytes_per_sample_id, has_genotypes)
Parses a single `DiffList` from `data`, starting with `offset + 1`-th byte.
"""
function parse_difflist(data::AbstractVector{UInt8},
offset::Integer,
bytes_per_sample_id::Integer,
has_genotype::Bool)
# length
len, offset = d... | {"hexsha": "3a4f900c78a4e91a1119952295a9f41c40a26d89", "size": 3894, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/difflist.jl", "max_stars_repo_name": "OpenMendel/PGEN.jl", "max_stars_repo_head_hexsha": "97a069470fd96c3799525c5399224d90d5371cc4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m... |
"""
Test Transformers whether they understand the masks correctly.
"""
import numpy
import paddle
from nntrainer.models import TransformerEncoder, TransformerEncoderConfig
# dont change these or else the test will break
BATCH_SIZE = 3
QUERY_LEN = 8
KEY_LEN = 2 * QUERY_LEN
# this can be changed
HIDDEN... | {"hexsha": "51a0a56dfb2c2fdd33b6b2e3ddc3f9e5b2cdc33a", "size": 3220, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests_nntrainer/test_transformers.py", "max_stars_repo_name": "ttjygbtj/coot", "max_stars_repo_head_hexsha": "231c574746b5a2afb11f05be19db0a8992d9f931", "max_stars_repo_licenses": ["Apache-2.0"], ... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 Sylko Olzscher
*
*/
#include "writer.hpp"
#include <smf/sml/protocol/value.hpp>
#include <limits>
#include <cyng/io/swap.h>
#include <cyng/io/serializer/binary.hpp>
#include <boost/numeric/conversion/cast.hpp>
namespace node
{
namespace sml
{
void write_len... | {"hexsha": "430f20d7c66e9b0baed33b09502142323498b8b7", "size": 6758, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "lib/sml/protocol/src/writer.cpp", "max_stars_repo_name": "solosTec/node", "max_stars_repo_head_hexsha": "e35e127867a4f66129477b780cbd09c5231fc7da", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
[STATEMENT]
lemma interleavings_filter_eq1:
assumes "interleavings xs ys zs"
assumes "(\<forall>x\<in>set xs. P x) \<and> (\<forall>y\<in>set ys. \<not> P y)"
shows "filter P zs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. filter P zs = xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this... | {"llama_tokens": 225, "file": "Falling_Factorial_Sum_Falling_Factorial_Sum_Combinatorics", "length": 2} |
export add, ∑
"""
add(x::Int64, y::Int64)
Returns x + y
# Examples
```jldoctest
julia> x, y = 1, 3; add(x, y)
4
julia> @assert "add(x::Int64, y::Int64)" == which_sig(add, x, y)
```
"""
add(x::Int64, y::Int64) = x + y
"""
add(x::T, y::T) where {T<:Number}
Returns x + y
# Examples
```jldoctest
julia> x,... | {"hexsha": "43ee34520992f9a6619da1dc5fe1ab8f3ade4222", "size": 1518, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/stuff.jl", "max_stars_repo_name": "binnisb/JuliaLearn", "max_stars_repo_head_hexsha": "cbaa4e32e716af2586ab9545f2c829803c3c97bc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
from scipy.stats import norm
import numpy as np
class Brownian:
"""
Brownian: Generate brownian motion. Remembers the last position.
This class caches a large number of samples drawn from a normal
distribution to compute noise faster.
Usage: brownian = Brownian(x0=0);
Brownian() # Yi... | {"hexsha": "c198ad6d65724c2cc79f4432bfd3c8452ba00a51", "size": 1891, "ext": "py", "lang": "Python", "max_stars_repo_path": "traja/stats/brownian.py", "max_stars_repo_name": "jootten/traja", "max_stars_repo_head_hexsha": "4c4a689bd99dde88d521e647ae8bc9ef9c2f2396", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4... |
#include "PluginProcessor.h"
#include "PluginEditor.h"
#include "AboutDialog.h"
#include <algorithm>
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/image_io.h>
#include <dlib/image_processing.h>
#define WAHWTH_USE_IMAGE_PROCESSING_THREAD 1
bool kShowFace = true;
constexpr int kMi... | {"hexsha": "15fd9a9412ced0082ac7dd1f8d067af68bd02b7e", "size": 32708, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "PluginEditor.cpp", "max_stars_repo_name": "hotwatermorning/wahwth", "max_stars_repo_head_hexsha": "e507c80d05543245e85938c36a63da34eb4b2f08", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import pandas as pd
import numpy as np
import xarray as xr
from timeflux_ml.nodes.fit import Fit
from timeflux_ml.nodes.transform import Transform
# ------------------------------------------------------
# Use-case #2 : Supervised fit Pipeline on xarray data
# ------------------------------------------------------
# ... | {"hexsha": "456728a8774b486f033a2c3ba988224928e5fc34", "size": 3293, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_fit_transform_xarray.py", "max_stars_repo_name": "sylvchev/timeflux_ml", "max_stars_repo_head_hexsha": "31fefc41ff5f62fc770e87c2963e872768301de3", "max_stars_repo_licenses": ["MIT"], "ma... |
"""
Module that stores global random state for SafeLife.
Note that this uses the new numpy 1.17 random generators.
"""
import numpy as np
from . import speedups
random_gen = np.random.default_rng() # global random generator object
def get_rng():
return random_gen
class set_rng(object):
def __init__(se... | {"hexsha": "edd4250239811921926aab2ec234ccfa79d0fe83", "size": 1017, "ext": "py", "lang": "Python", "max_stars_repo_path": "safelife/random.py", "max_stars_repo_name": "JohnBurden/SafelifeExperiments", "max_stars_repo_head_hexsha": "08e52de246097971da784384cfff30c216d225a2", "max_stars_repo_licenses": ["Apache-2.0"], "... |
# coding: utf-8
# This is the combination of several scripts that download data from the
# NASA NSRDB database and process.
# The propose of this code it to run experiments around adaptive multitenancy
# driven ENO WSN for an EWSN submission.
import pandas as pd
import time
import math
import simplejson
from NREL im... | {"hexsha": "6ab327374139b38fc93b3513418e4f144a3761a3", "size": 22979, "ext": "py", "lang": "Python", "max_stars_repo_path": "sensecheck.py", "max_stars_repo_name": "lessalgorithm/LESSAlgorithm", "max_stars_repo_head_hexsha": "39918ee903389a3105f552b42dea205788e77f8e", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
#include <cstdlib>
#include <iostream>
#include <stdexcept>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/program_options.hpp>
#include <boost/thread.hpp>
int main( int argc, char* argv[])
{
try
{
std::string host, msg, port;
int timeout = 1;
... | {"hexsha": "a20d5d3774e817e195439ebb326f6fe8a6212e80", "size": 2330, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libs/coroutine/example/asio/stream_client.cpp", "max_stars_repo_name": "ai-nikolaev/repo-cppboost", "max_stars_repo_head_hexsha": "218c4a977c6d8cd6f2864cdcea1b6ab53160d203", "max_stars_repo_licenses... |
// Copyright (C) 2015 The Regents of the University of California (Regents).
// 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... | {"hexsha": "9c093a7c4c7807e3d9ae85d27b9ed4730e55a2d4", "size": 81781, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/pytheia/sfm/sfm.cc", "max_stars_repo_name": "urbste/pyTheiaSfM", "max_stars_repo_head_hexsha": "814034c96b602fef1dc76ae6692278d61179ebcc", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars... |
% ECEF2LLA - convert earth-centered earth-fixed (ECEF)
% cartesian coordinates to latitude, longitude,
% and altitude
%
% USAGE:
% [lat,lon,alt] = ecef2lla(x,y,z)
%
% lat = geodetic latitude (radians)
% lon = longitude (radians)
% alt = height above WGS84 ellipsoid (m)
% x = ECEF X-coordinate (m)
... | {"author": "Sable", "repo": "mcbench-benchmarks", "sha": "ba13b2f0296ef49491b95e3f984c7c41fccdb6d8", "save_path": "github-repos/MATLAB/Sable-mcbench-benchmarks", "path": "github-repos/MATLAB/Sable-mcbench-benchmarks/mcbench-benchmarks-ba13b2f0296ef49491b95e3f984c7c41fccdb6d8/7941-convert-cartesian-ecef-coordinates-to-l... |
import numpy as np
import numpy.random as npr
from copy import deepcopy
from numpy.random import multivariate_normal as mvn
from mimo.distributions import MatrixNormalWishart
from mimo.distributions import MatrixNormalWithPrecision
# npr.seed(1337)
d, m = 1, 1
N, T = 25, 100
M = npr.uniform(-10., 10.) * np.ones((... | {"hexsha": "2f02c37f6716764dac3a21dbc2d95f1bf278ea66", "size": 5905, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/hbr/vi_test.py", "max_stars_repo_name": "hanyas/mimo", "max_stars_repo_head_hexsha": "6f9b327a1a202a88b33a419520474ef4f10749e8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16,... |
from unittest import SkipTest
import numpy as np
import pandas as pd
from numpy.testing import assert_allclose
from trackpy.utils import validate_tuple, is_scipy_15
from trackpy.refine import refine_com, refine_leastsq
from trackpy.artificial import (feat_gauss, rot_2d, rot_3d, draw_feature,
... | {"hexsha": "91d1f617f6066cad522842cf320021460cf92186", "size": 43330, "ext": "py", "lang": "Python", "max_stars_repo_path": "trackpy/tests/test_leastsq.py", "max_stars_repo_name": "freemansw1/trackpy", "max_stars_repo_head_hexsha": "a316c658ffd03d4b6fe705b9bedd63c1ab8276c0", "max_stars_repo_licenses": ["BSD-3-Clause"],... |
import numpy as np
def non_max_suppression_fast(boxes, probabilities=None, overlap_threshold=0.3):
"""
Algorithm to filter bounding box proposals by removing the ones with a too low confidence score
and with too much overlap.
Source: https://www.pyimagesearch.com/2015/02/16/faster-non-maximum-suppres... | {"hexsha": "aff39971e03ce215d858dc2bc35d9fa8536f9b75", "size": 2731, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiment/gesture_recognizer/util/box.py", "max_stars_repo_name": "TsingJyujing/gesture-recognition", "max_stars_repo_head_hexsha": "9898e1418382fdf248945272157972552a72c984", "max_stars_repo_lic... |
#!/usr/local/bin/python
#coding=utf-8
# 趋势追踪策略
"""
http://t.cn/RqQv0JW
"""
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from data_process.data_get import get_stock_k_line
from tushare.util import dateu as du
import datetime
import tushare as ts
import cwavelet
#参数
prama_ma_short = 12 # 短均线
p... | {"hexsha": "e42c720c1e9ad6851928d77e2bddf3c771e76edf", "size": 18708, "ext": "py", "lang": "Python", "max_stars_repo_path": "trade_process/strategy/tread_tracking.py", "max_stars_repo_name": "cbbing/stock", "max_stars_repo_head_hexsha": "6bde95c447544b719094f045817690c54c6e730f", "max_stars_repo_licenses": ["Apache-2.0... |
subsection \<open>Binary orthogonality is Diophantine\<close>
theory Binary_Orthogonal
imports Binomial_Coefficient "Digit_Expansions.Binary_Operations" "Lucas_Theorem.Lucas_Theorem"
begin
lemma equiv_with_lucas: "nth_digit = Lucas_Theorem.nth_digit_general"
unfolding nth_digit_def Lucas_Theorem.nth_digit_general... | {"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/DPRM_Theorem/... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 2 16:39:25 2019
@author: Shane
"""
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import scipy
import scipy.stats
import glob
import statsmodels.stats.api as sms
#import matplotlib for plotting
import matplotlib.pyplot as plt
... | {"hexsha": "7c339db6d2289f3b0011d48edf69e9c83ce02a4d", "size": 17651, "ext": "py", "lang": "Python", "max_stars_repo_path": "201210_cable_length_plots.py", "max_stars_repo_name": "shanemc11/Yeast_actin_cables", "max_stars_repo_head_hexsha": "dc305ab622110b7fd0b9504322dceb782577945b", "max_stars_repo_licenses": ["MIT"],... |
[STATEMENT]
lemma filter_M_filter: "h \<turnstile> filter_M P xs \<rightarrow>\<^sub>r ys \<Longrightarrow> (\<And>x. x \<in> set xs \<Longrightarrow> pure (P x) h)
\<Longrightarrow> (\<forall>x \<in> set xs. h \<turnstile> ok P x) \<and> ys = filter (\<lambda>x. |h \<turnstile> P x|\<^sub>r) xs... | {"llama_tokens": 650, "file": "Core_DOM_common_preliminaries_Heap_Error_Monad", "length": 2} |
# -*- coding: utf-8 -*-
"""
# Software License Agreement (BSD License)
#
# Copyright (c) 2017, Toshiba Corporation,
# Toshiba Infrastructure Systems & Solutions Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pr... | {"hexsha": "08671d0b1e0dd4238d7e0fc8aa649194ff167b76", "size": 7509, "ext": "py", "lang": "Python", "max_stars_repo_path": "TeamT2_ARC2017_src/t2_robot_vision/src/dist_learning_rcg.py", "max_stars_repo_name": "warehouse-picking-automation-challenges/Team_T2", "max_stars_repo_head_hexsha": "7cf4c211dcd5726fbe876ff555b76... |
import numpy as np
import pandas as pd
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_absolute_error, mean_squared_error
from PyEMD import CEEMDAN # Empirical Mode Decomposition (EMD). Most popular expan... | {"hexsha": "e9a57c48ed0076de6f930365e968623c1f3086b8", "size": 16965, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/scripts/data_handler_lstm.py", "max_stars_repo_name": "ss-github-code/stock_prediction", "max_stars_repo_head_hexsha": "8b10bddb6bf8a4ff0fe0467e5f30feb9d6bc36b0", "max_stars_repo_licenses": [... |
/*
* _Portfolio.cpp
*
* Created on: 2016年3月29日
* Author: fasiondog
*/
#include <boost/python.hpp>
#include <hikyuu/trade_sys/portfolio/build_in.h>
#include "../_Parameter.h"
#include "../pickle_support.h"
using namespace boost::python;
using namespace hku;
void (Portfolio::*pf_set_name)(const string&) = &... | {"hexsha": "beebd869edf35d5641dde5b2ae42ac216ff96f4c", "size": 1529, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libs/hikyuu_python/trade_sys/_Portfolio.cpp", "max_stars_repo_name": "koktf23/hikyuu", "max_stars_repo_head_hexsha": "7a728592465b5789dca381f75171fc5591e34671", "max_stars_repo_licenses": ["MIT"], "... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 4 08:18:42 2022
@author: willi och gojja
"""
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn import linear_model
import numpy as np
from xgboost.sklearn import XGBRegressor
from sklearn.model_selection import GridSearchCV
from sklearn.m... | {"hexsha": "b33dcd96219a060e63da6d8cea60a9703cbd8606", "size": 11253, "ext": "py", "lang": "Python", "max_stars_repo_path": "Dev/xgb_paremeter_tuning.py", "max_stars_repo_name": "williantleite/DML_in_Finance", "max_stars_repo_head_hexsha": "8c09c7e0533d011997cc11b9c09e1925a60fe7ae", "max_stars_repo_licenses": ["MIT"], ... |
#! /usr/bin/env python
import argparse
import os
import json
import struct
import numpy as np
import tensorflow as tf
from keras import backend as K
from ..backbone.frontend import YOLO
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
argparser = argparse.ArgumentParser(
de... | {"hexsha": "e9e06f692e08a1724d4375a3409b3aca1804bc97", "size": 5100, "ext": "py", "lang": "Python", "max_stars_repo_path": "detect/util/convert_tiny_darknet_v1.py", "max_stars_repo_name": "jyyang42/sonic", "max_stars_repo_head_hexsha": "50a5a53f4eec88604207975bcc914c3faa8d3a51", "max_stars_repo_licenses": ["MIT"], "max... |
function a = getBestAction(Q, state, actions)
% Select the best action a in state s
n_actions = length(actions);
status = find(Q(state,:), 1);
if isempty(status)
a = randi(n_actions);
else
[Q_value, a] = max(Q(state,:));
end
end | {"author": "kennydl", "repo": "Reinforcment-Learning-With-Q-Learning", "sha": "d9aff50bfaa57bedd59134e3eeab029ba4e42c8c", "save_path": "github-repos/MATLAB/kennydl-Reinforcment-Learning-With-Q-Learning", "path": "github-repos/MATLAB/kennydl-Reinforcment-Learning-With-Q-Learning/Reinforcment-Learning-With-Q-Learning-d9a... |
from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Core(Benchmark):
def setup(self):
self.l100 = range(100)
self.l50 = range(50)
self.l = [np.arange(1000), np.arange(1000)]
self.l10x10 = np.ones((10, 10))
d... | {"hexsha": "b595ae469333f123c2b37e549713dbe60a71ca68", "size": 2386, "ext": "py", "lang": "Python", "max_stars_repo_path": "benchmarks/benchmarks/bench_core.py", "max_stars_repo_name": "akesandgren/numpy", "max_stars_repo_head_hexsha": "08fc49e1b33e4da9e14e375f399ba92c615eb569", "max_stars_repo_licenses": ["BSD-3-Claus... |
#!/usr/bin/env julia
## help statement
function printUsage()
println("==================USAGE===================")
println("julia aicontrolScript.jl [bamfile] [option1] [option2] ...")
println("\t\t --ctrlfolder=[path]: path to a control folder [default:.]")
println("\t\t --name=[string]: prefix for o... | {"hexsha": "f3e902cbed446613dc507b8d99ab2e238da91023", "size": 7687, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "aicontrolScript.jl", "max_stars_repo_name": "UnofficialJuliaMirror/AIControl.jl-3868d828-178d-56af-83e1-d523478a73cd", "max_stars_repo_head_hexsha": "804a8a66dc8f9a73adb201c7c8bac04a301b84ed", "max... |
[STATEMENT]
lemma akra_bazzi_term_floor_add [akra_bazzi_term_intros]:
assumes "(b::real) > 0" "b < 1" "real x\<^sub>0 \<le> b * real x\<^sub>1 + c" "c < (1 - b) * real x\<^sub>1" "x\<^sub>1 > 0"
shows "akra_bazzi_term x\<^sub>0 x\<^sub>1 b (\<lambda>x. nat \<lfloor>b*real x + c\<rfloor>)"
[PROOF STATE]
proof (pro... | {"llama_tokens": 5883, "file": "Akra_Bazzi_Akra_Bazzi", "length": 41} |
from computeCost import computeCost
import numpy as np
def gradientDescent(X, y, theta, alpha, num_iters):
"""
Performs gradient descent to learn theta
theta = gradientDescent(x, y, theta, alpha, num_iters) updates theta by
taking num_iters gradient steps with learning rate alpha
"""
#... | {"hexsha": "c9d7733f9828a2b31eb0df2a5684b087ed96a88d", "size": 1112, "ext": "py", "lang": "Python", "max_stars_repo_path": "supervised/gradDescent/gradientDescent.py", "max_stars_repo_name": "robotenique/mlAlgorithms", "max_stars_repo_head_hexsha": "612d7fb2dcf4430528f63d35d6f1d10a33fee1af", "max_stars_repo_licenses": ... |
import unittest
import os
import numpy as np
import tensorflow as tf
import nnutil as nn
class Layer_Cyinder(unittest.TestCase):
def test_layer_cyinder(self):
tf.set_random_seed(42)
with tf.Session() as sess:
layer = nn.layers.Cylinder([
tf.layers.AveragePooling1D(pool_... | {"hexsha": "fd6c00fb13f2d689a5f2e7ecff684758bdd872ef", "size": 771, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/layers_cylinder.py", "max_stars_repo_name": "aroig/nnutil", "max_stars_repo_head_hexsha": "88df41ee89f592a28c1661ee8837dd8e8ca42cf3", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c... |
from __future__ import absolute_import, division, print_function, unicode_literals
import cv2
import math
import numpy as np
def make_montage(n, frames, frame_width=64, frames_per_row=16):
frame = next(frames)
(frame_h, frame_w, _) = frame.shape
target_w = frame_width
target_h = int(target_w / float(fr... | {"hexsha": "07b9b3ac7d4a65f021f202889b45ebd094a9ea92", "size": 878, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/scannerpy/stdlib/montage.py", "max_stars_repo_name": "qinglan233/scanner", "max_stars_repo_head_hexsha": "61ce0d35e49c92cab265b746bd55ae75ab57fb42", "max_stars_repo_licenses": ["Apache-2.0"]... |
"""
PCME
Copyright (c) 2021-present NAVER Corp.
MIT license
"""
import numpy as np
import torch
import torch.nn.functional as F
def to_numpy(tensor, n_dims=2):
"""Convert a torch tensor to numpy array.
Args:
tensor (Tensor): a tensor object to convert.
n_dims (int): size of numpy array shape... | {"hexsha": "4348c273287a0a4b4fa4c5585eacba38d2cae8bb", "size": 1004, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/tensor_utils.py", "max_stars_repo_name": "naver-ai/pcme", "max_stars_repo_head_hexsha": "587aa0de710f3f40eac42cd97657c1a9dcfc6ebc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 57,... |
# Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
import numpy as np
import pandas as pd
from erroranalysis._internal.constants import (PRED_Y,
TRUE_Y,
ROW_INDEX,
... | {"hexsha": "37c8501dd764ba5e0813024a026942ed767e616c", "size": 4897, "ext": "py", "lang": "Python", "max_stars_repo_path": "erroranalysis/erroranalysis/_internal/cohort_filter.py", "max_stars_repo_name": "ShabadVaswani/responsible-ai-widgets", "max_stars_repo_head_hexsha": "fdf5ac3a869fdeef24bb4964f3b0ee8111f26fec", "m... |
import numpy as np
import tensorflow as tf
from meta_model import batchers
from meta_model import pipeline as pl
def pre_cache_map(xy, label):
return xy, label
def pre_batch_map(xy, label):
x, y = xy
return x * y, label
def post_batch_map(z, label):
f = z ** 2
return (f,), label
def model_f... | {"hexsha": "bd1aa8f96fd46e417312ba64d655baa2bbc1e690", "size": 3523, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/pipeline_test.py", "max_stars_repo_name": "jackd/meta-model", "max_stars_repo_head_hexsha": "3ad44c3e12011d4a2309725d05b8678d19f1e23f", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
import scipy.io
import numpy as np
from sklearn.decomposition import PCA
def five(filename, dim):
print(filename, dim)
data = scipy.io.loadmat(filename)
vs = []
for v in data['X'][0]:
if v.shape[1] > 0:
vs.append(v.T)
X = np.vstack(vs)
pca = PCA(n_components=dim)
X_p... | {"hexsha": "8268b74758669ba0dc6a835a13d0b56eda613296", "size": 1877, "ext": "py", "lang": "Python", "max_stars_repo_path": "create_lowdim.py", "max_stars_repo_name": "joisino/reeval-wmd", "max_stars_repo_head_hexsha": "2577cf22dd3e5bbf24cd5877de6ff972bfad8718", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 9, ... |
!***********************************************************************
! *
SUBROUTINE SETCON
! *
! This subprogram sets the values of the fundamental and derived *
! ... | {"hexsha": "4b48e42749c5e7743c5f0d317f42159e3d109e07", "size": 5139, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/lib/lib9290/setcon.f90", "max_stars_repo_name": "sylas/grasp-continuum", "max_stars_repo_head_hexsha": "f5e2fb18bb2bca4f715072190bf455fba889320f", "max_stars_repo_licenses": ["MIT"], "max_st... |
from numpy import *
class Game:
def __init__(self, N, M, numMines):
self.N = N
self.M = M
self.numMines = min(numMines, N * M - 1)
self.isMine = [False] * (N * M)
# vector of directions
self.directions = [-M - 1, -M, -M + 1, -1, 1, M - 1, M, M + 1]
# getting unique values
self.directions = list(set(... | {"hexsha": "e31b52f937531fe54d7f40d5911eeaa7e3fbdbe2", "size": 3538, "ext": "py", "lang": "Python", "max_stars_repo_path": "game.py", "max_stars_repo_name": "pedroteosousa/minesweeper", "max_stars_repo_head_hexsha": "1ec0ebfd3c9468f8886445986a6b97a8a41cc244", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
function clc()
if Sys.islinux()
Base.run(`clear`)
end
return
end
clc();
| {"hexsha": "48e4b4e2fb3abbec4c6d25a09af1a4b76e35d338", "size": 92, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Utilities/clc.jl", "max_stars_repo_name": "manuelmontesinos/Econometrics", "max_stars_repo_head_hexsha": "d4176e1f737bcb2b3163b5b381d0bf9773013742", "max_stars_repo_licenses": ["MIT"], "max_stars... |
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
=============================================
fMRI: OpenfMRI.org data, FSL, ANTS, c3daffine
=============================================
A growing number of datasets are availabl... | {"hexsha": "4852f03e1cadcb2a3b70046d1f3c5175ccc962f2", "size": 44712, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/fmri_ants_openfmri.py", "max_stars_repo_name": "dPys/nipype", "max_stars_repo_head_hexsha": "75030b29297808e7c9a9e91b411b685154dff60b", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
[STATEMENT]
lemma lformula_RESTRICT: "lformula \<phi> \<Longrightarrow> lformula (RESTRICT \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lformula \<phi> \<Longrightarrow> lformula (RESTRICT \<phi>)
[PROOF STEP]
unfolding RESTRICT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lformula \<phi> \<Longr... | {"llama_tokens": 190, "file": "Formula_Derivatives_Abstract_Formula", "length": 2} |
import numpy as np
from scipy.stats import spearmanr
from brainio.assemblies import DataAssembly, walk_coords
from brainscore.metrics import Score
from brainscore.metrics.transformations import TestOnlyCrossValidation
from brainscore.metrics.xarray_utils import Defaults as XarrayDefaults
class RDMCrossValidated:
... | {"hexsha": "5dc623d799b977a785988db1d1774a8986bd0f9c", "size": 5295, "ext": "py", "lang": "Python", "max_stars_repo_path": "brainscore/metrics/rdm.py", "max_stars_repo_name": "dmayo/brain-score", "max_stars_repo_head_hexsha": "3ab4258152c9e3f8c7d29afb10158b184dbcebbe", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
from io import StringIO
from collections import OrderedDict
import numpy as np
import scipy.linalg as sl
import pandas as pd
import pytest
import matmodlab2 as mml
runid = 'simulation_output'
solution_filename = runid + "_solution.csv"
solution_string = """Time,E.XX,E.YY,E.ZZ,E.XY,E.YZ,E.XZ
0.00, 0.000, 0.000, 0.000,... | {"hexsha": "44f096f724d5d2a113c6c1b08711d696fb7428fe", "size": 4808, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/swan/test_correct_strain_evolution.py", "max_stars_repo_name": "matmodlab/matmodlab2", "max_stars_repo_head_hexsha": "97bb858e2b625cca5f3291db5d50bdbb6352e976", "max_stars_repo_licenses": ["... |
# -*- coding: utf-8 -*-
# @Time : 2020/11/29 11:59
# @Author : chensi
# @File : execute_model.py
# @Software : PyCharm
# @Desciption : None
import random
import numpy as np
import torch
tf = None
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except:
import tensorflow as... | {"hexsha": "4ef0d16b0608d8ffdba136d02212dd3e82e4b77e", "size": 2183, "ext": "py", "lang": "Python", "max_stars_repo_path": "Leg-UP/execute_model.py", "max_stars_repo_name": "sharanmayank/ShillingAttack", "max_stars_repo_head_hexsha": "783f135a4fcc709e7ce478c2e6f2e7e6c5ad2ace", "max_stars_repo_licenses": ["MIT"], "max_s... |
[STATEMENT]
lemma lowner_le_traceD:
assumes "A \<in> carrier_mat n n" "B \<in> carrier_mat n n" "\<rho> \<in> carrier_mat n n"
and "A \<le>\<^sub>L B"
and "partial_density_operator \<rho>"
shows "trace (A * \<rho>) \<le> trace (B * \<rho>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. trace (A * \<rho>... | {"llama_tokens": 372, "file": "QHLProver_Complex_Matrix", "length": 2} |
/* vector/gsl_vector_complex_double.h
*
* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either vers... | {"hexsha": "8d9274b9ae11fa22794849accec0ea1a6b180ac3", "size": 8966, "ext": "h", "lang": "C", "max_stars_repo_path": "deps/include/gsl/gsl_vector_complex_double.h", "max_stars_repo_name": "berkus/music-cs", "max_stars_repo_head_hexsha": "099b66cb1285d19955e953f916ec6c12c68f2242", "max_stars_repo_licenses": ["MIT"], "ma... |
import cv2
import numpy as np
#img = cv2.imread('')
img = cv2.imread('images/004.png')
#img = cv2.resize(img,(400,500))
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
ret,gray = cv2.threshold(gray,127,255,0)
gray2 = gray.copy()
mask = np.zeros(gray.shape,np.uint8)
_, contours, hier = cv2.findContours(gray,cv2.RETR_LIST,c... | {"hexsha": "675ffe1d20b1b004d71e168f7107e0aa0aa43015", "size": 557, "ext": "py", "lang": "Python", "max_stars_repo_path": "y.py", "max_stars_repo_name": "philipgreat/image-backend-editor", "max_stars_repo_head_hexsha": "8d31ccd3588f349e514ab256b0e7e29816923a54", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
"""
This is the module for testing learning strategies.
cost function: 1/2m * sum 1 to M(h(x^i) - y^i)^2
"""
import Pokereval as pe
import Classes as cl
import numpy as np
import random
import collections
def softmax(x):
return np.exp(x) / np.sum(np.exp(x), axis=0)
def newsoftmax(x):
return 1.0 / (1.0 + np.exp... | {"hexsha": "7ba9cce8386c7e49c53aff87a9999c3c95f5862c", "size": 3687, "ext": "py", "lang": "Python", "max_stars_repo_path": "legacy/AI.py", "max_stars_repo_name": "MorGriffiths/PokerAI", "max_stars_repo_head_hexsha": "a68400f4918f10dde82574ad19654243c9a65024", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "m... |
[STATEMENT]
lemma all_intersection_of:
"(\<forall>S. (P intersection_of Q) S \<longrightarrow> R S) \<longleftrightarrow> (\<forall>T. P T \<and> T \<subseteq> Collect Q \<longrightarrow> R(\<Inter>T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<forall>S. (P intersection_of Q) S \<longrightarrow> R S) = ... | {"llama_tokens": 157, "file": null, "length": 1} |
import torch
import numpy as np
import torch.nn as nn
# Create batches with positive samples in first half and negative examples in second half
class BatchSamplerWithNegativeSamples(torch.utils.data.Sampler):
def __init__(self, pos_sampler, neg_sampler, batch_size, items):
self._pos_sampler = pos_sampler
... | {"hexsha": "75b25ac2730e5a5e89fb236b7b1dd7426ec1c87e", "size": 2946, "ext": "py", "lang": "Python", "max_stars_repo_path": "default-approach/sampling/.ipynb_checkpoints/sampler_util-checkpoint.py", "max_stars_repo_name": "the-browser/recommending-interesting-writing", "max_stars_repo_head_hexsha": "9ff4771d3f437d33c26d... |
module Network.HTTP.Path
import Data.String
import Data.String.Extra
import Data.List1
import Data.List
import Generics.Derive
%language ElabReflection
data PathComponent : Type where
Root : PathComponent
Parent : PathComponent
Current : PathComponent
End : PathComponent
Named : String -> PathComponent
%r... | {"hexsha": "c676d3456a31b074e0c37ea79a570ce01ca3dab6", "size": 3020, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "src/Network/HTTP/Path.idr", "max_stars_repo_name": "octeep/idris2-http", "max_stars_repo_head_hexsha": "7afdce354be2a5eddef843b99c775d7939e94253", "max_stars_repo_licenses": ["0BSD"], "max_stars_c... |
# Copyright (c) 2018 PaddlePaddle 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 app... | {"hexsha": "912df563fcdbf83f763d1d87b3256e11d1ad43af", "size": 29705, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/paddle/fluid/tests/unittests/test_reduce_op.py", "max_stars_repo_name": "TingquanGao/Paddle", "max_stars_repo_head_hexsha": "9b1015d90b4d498ab58df7cff2c3ed27863ce970", "max_stars_repo_lice... |
/*****************************************************************************
* CACTI 7.0
* SOFTWARE LICENSE AGREEMENT
* Copyright 2015 Hewlett-Packard Development Company, L.P.
* All Rights Reserved
*
* Redistribution and us... | {"hexsha": "8a2618e032296ee4aba1a4ab8f883534321b5833", "size": 78168, "ext": "cc", "lang": "C++", "max_stars_repo_path": "CryoMEM/cacti/io.cc", "max_stars_repo_name": "SNU-HPCS/CryoModel", "max_stars_repo_head_hexsha": "07a3fbe3f3d44c7960b5aed562a90e204014eea0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2.... |
import numpy
from torch.utils.data import Dataset, DataLoader
class AbstractHumanDataset(Dataset):
def __init__(self, x_labeled, y_labeled, x_unlabeled=[], y_unlabeled=[], x_metric=[], y_metric=[], batch_size=32):
# base dataset
self.x = x_labeled
self.y = y_labeled
self.batch_si... | {"hexsha": "d174461c3f0bfbe53688f78e103c7e0cbdb70072", "size": 3021, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dataset/abstract_human_dataset.py", "max_stars_repo_name": "Franco7Scala/exploiting_gradient", "max_stars_repo_head_hexsha": "390c79dcdb25e2a5d8e496bacbe760aa91345f4e", "max_stars_repo_license... |
INTEGER :: cptr1, cptr2, cptr3
POINTER (cptr1,obj1)
POINTER (cptr2,obj2), (cptr3,obj3(13))
END PROGRAM
| {"hexsha": "7b31e6428452d09cc9f51f2928fb832b976c569b", "size": 103, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/issues/issue-34.f90", "max_stars_repo_name": "OpenFortranProject/ofp-sdf", "max_stars_repo_head_hexsha": "202591cf4ac4981b21ddc38c7077f9c4d1c16f54", "max_stars_repo_licenses": ["BSD-3-Claus... |
[STATEMENT]
lemma skip_hoare_r [hoare_safe]: "\<lbrace>p\<rbrace>II\<lbrace>p\<rbrace>\<^sub>u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrace>p\<rbrace> II \<lbrace>p\<rbrace>\<^sub>u
[PROOF STEP]
by rel_auto | {"llama_tokens": 100, "file": "UTP_utp_utp_hoare", "length": 1} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.