text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
from dataclasses import dataclass
from abc import ABC, abstractmethod
from schema import Schema
from typing import Dict, Any, Type, List, Sequence
import numpy as np
REGISTERED_TRANSFORM_CLASSES = {}
class Transform(ABC):
@property
def name(self) -> str:
return type(self).__name__
@property
... | {"hexsha": "2bf2d2ef9acf3cdb7da2e88e650515fc8ed42318", "size": 3521, "ext": "py", "lang": "Python", "max_stars_repo_path": "datafeed/transforms.py", "max_stars_repo_name": "jacobbieker/3dml", "max_stars_repo_head_hexsha": "f4b0e49343a18b4935c1502112e7bef0ff448986", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import random
import numpy as np
import os
import torch
class Agent:
def __init__(self):
self.model = torch.load(__file__[:-8] + "/agent.pkl")
def act(self, state):
with torch.no_grad():
state = torch.tensor(np.array(state)).float()
a, _, _ = self.model.act(sta... | {"hexsha": "be20fd409dd26815109d1dfc70dd8a0ad753a48c", "size": 380, "ext": "py", "lang": "Python", "max_stars_repo_path": "PPO/agent.py", "max_stars_repo_name": "mahkons/RL-algorithms", "max_stars_repo_head_hexsha": "bc5da6734263184e6229d34cd68f092feb94e9a3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
# load the data for time-series
import numpy as np
from scipy import signal
from load_time_series import load_data
np.random.seed(231)
x = np.array([1, 2, 3, 4])
# print("train_set_x[0]: ", x)
print("len of x: ", len(x))
filter_size = 2
corr_filter = np.array([1, 2])
standard_corr = signal.correlate(x, corr_filter... | {"hexsha": "32b358bf07ed7c32a04000018d897c690e012c2a", "size": 1557, "ext": "py", "lang": "Python", "max_stars_repo_path": "cnns/nnlib/test/CorrDirectFFTReduceEnergySimple.py", "max_stars_repo_name": "adam-dziedzic/time-series-ml", "max_stars_repo_head_hexsha": "81aaa27f1dd9ea3d7d62b661dac40cac6c1ef77a", "max_stars_rep... |
[STATEMENT]
lemma continuous_blinfun_matrix:
fixes f:: "'b::t2_space \<Rightarrow> 'a::real_normed_vector \<Rightarrow>\<^sub>L 'c::real_inner"
assumes "continuous F f"
shows "continuous F (\<lambda>x. (f x) j \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. continuous F (\<lambda>x. blinfun_apply ... | {"llama_tokens": 160, "file": null, "length": 1} |
function [P,N,check]=plane_intersect(N1,A1,N2,A2)
%plane_intersect computes the intersection of two planes(if any)
% Inputs:
% N1: normal vector to Plane 1
% A1: any point that belongs to Plane 1
% N2: normal vector to Plane 2
% A2: any point that belongs to Plane 2
%
%Outputs:
% P is a po... | {"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/17618-plane-intersection/plane_intersect.m"} |
%!TEX root = labo.tex
\chapter{Single-Segment IP Networks}
What you will learn in this lab:
\begin{itemize}
\item How to capture and filter network traffic
\item How to configure a network interface for IP networking
\item How to access IP statistics and settings with the netstat command
\item How ARP works
\ite... | {"hexsha": "9362b143016ae83e7eb3e9accf55e2b094900676", "size": 32910, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Lab 2/lab2.tex", "max_stars_repo_name": "arminnh/lab-computer-networks", "max_stars_repo_head_hexsha": "f900d3e74e5e225791a537c3a4e7bbc5afb1d93b", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
//
// MongoDBHAConnection.cpp
// CHAOSFramework
//
// Created by Claudio Bisegni on 22/04/14.
// Copyright (c) 2014 INFN. All rights reserved.
//
#include "MongoDBHAConnectionManager.h"
#include <chaos/common/utility/TimingUtil.h>
#include <boost/format.hpp>
#define RETRIVE_MIN_TIME 500
#define RETRIVE_MAX_TIME... | {"hexsha": "246ac0c3b8bb87a647cf0664c7225fb12d264e13", "size": 12887, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "ChaosDataService/db_system/MongoDBHAConnectionManager.cpp", "max_stars_repo_name": "fast01/chaosframework", "max_stars_repo_head_hexsha": "28194bcca5f976fd5cf61448ca84ce545e94d822", "max_stars_repo... |
from airflow.operators.python_operator import PythonOperator
from airflow.operators.bash_operator import BashOperator
from airflow import DAG
from airflow.utils.dates import days_ago
import airflow.hooks.S3_hook
from airflow.hooks.base_hook import BaseHook
from datetime import timedelta
from datetime import datetime
fr... | {"hexsha": "461e5a5672d438c012a20c89ea4fe585a1030606", "size": 5006, "ext": "py", "lang": "Python", "max_stars_repo_path": "Final_Project/Airflow_Dag/final_project_dag.py", "max_stars_repo_name": "JKocher13/DataZCW-Final-Project", "max_stars_repo_head_hexsha": "9749825a3b106879e1e1536172d6adafc888b843", "max_stars_repo... |
import numpy as np
import pandas as pd
dates = pd.date_range('20130101',periods=6)
df = pd.DataFrame(np.arange(24).reshape((6,4)),index=dates,columns=['A','B','C','D'])
print(df)
df.loc['20130102','B'] = 222
df.iloc[2,2] = 111
df.A[df.A<10] = 0
# df.F=np.nan 这种不能加新列
df['F'] = 0 # 这种可以加新列 np.nan
df['E'] = pd... | {"hexsha": "08b10eddbe22b7400f04f4fc6c9a69a14452a9b5", "size": 407, "ext": "py", "lang": "Python", "max_stars_repo_path": "01-python/source code/04/01.py", "max_stars_repo_name": "lizhangjie316/ComputerVision", "max_stars_repo_head_hexsha": "86d82358bd160074d154773df0284e1154a6d077", "max_stars_repo_licenses": ["Apache... |
import numpy as np
import torch.nn as nn
import torch
import pickle
from datetime import datetime
import os
import glob
class BaseLayer(nn.Module):
def __init__(self):
super(BaseLayer, self).__init__()
self.cuda = True if torch.cuda.is_available() else False
self.Tensor = torch.cuda.FloatTe... | {"hexsha": "127004f4b88f1b6a3be9972c1a8870e4f512d9bc", "size": 2949, "ext": "py", "lang": "Python", "max_stars_repo_path": "chapter7/stylegan2_pytorch/base_layer.py", "max_stars_repo_name": "tms-byte/gan_sample", "max_stars_repo_head_hexsha": "1ff723cf37af902b400dbb68777a52e6e3dfcc89", "max_stars_repo_licenses": ["MIT"... |
import os
from PIL import ImageGrab
import time
import win32api, win32con
from PIL import ImageOps
from numpy import *
import pyautogui
import random
from ctypes import windll
user32 = windll.user32
user32.SetProcessDPIAware()
#some sort of DPS problem unrelated to project
#this stops the images from be... | {"hexsha": "2764e8cf2af125cde1e1dea98f00be38d0e21369", "size": 6205, "ext": "py", "lang": "Python", "max_stars_repo_path": "FlightRisingColiseum/Bot_FR.py", "max_stars_repo_name": "Eternal05/Flightrising-Coliseum-Bot", "max_stars_repo_head_hexsha": "8f4895ff8a2d5533fe6a6546e09361738fd54910", "max_stars_repo_licenses": ... |
#!/usr/bin/env python
import os, sys
import numpy as np
import IO
def read_OBJ(filename):
'''Read an OBJ file from disk. Returns a geom dict.'''
return decode_OBJ(parse_OBJ(open(filename,'r').readlines()))
def parse_OBJ(obj_strings):
'''Parse an OBJ file into a dict of group:dict of str:list one of (str,list of d... | {"hexsha": "813894db8b8d69a2f9b922451f207c10c66a81a2", "size": 32131, "ext": "py", "lang": "Python", "max_stars_repo_path": "IO/OBJReader.py", "max_stars_repo_name": "davidsoncolin/IMS", "max_stars_repo_head_hexsha": "7a9c44275b4ebf5b16c04338628425ec876e3a0f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
// Copyright (c) 2010 by BBNT Solutions LLC
// All Rights Reserved.
#include <boost/algorithm/string.hpp>
#include "Generic/common/leak_detection.h" // This must be the first #include
#include "Generic/theories/Parse.h"
#include "Generic/theories/RelMention.h"
#include "Generic/theories/RelMentionSet.h"
#inc... | {"hexsha": "f537240a48dd0edf59e1a58fe0f4215d3e712dc8", "size": 22149, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/Generic/icews/TenseDetection.cpp", "max_stars_repo_name": "BBN-E/serif", "max_stars_repo_head_hexsha": "1e2662d82fb1c377ec3c79355a5a9b0644606cb4", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
Require Import Coq.Arith.Peano_dec.
Require Import Coq.Structures.OrderedType.
Require Import Coq.Logic.FunctionalExtensionality.
Require Import Coq.Sets.Ensembles.
Require Import Ascii.
Require Import Coq.ZArith.Znat.
Require Import Coq.Program.Equality.
Add LoadPath "." as Top0.
Require Import Top0.Tactics.
Require ... | {"author": "esmifro", "repo": "SurfaceEffects", "sha": "3450e4b771de4062ab73ee20947adf3f9de579ba", "save_path": "github-repos/coq/esmifro-SurfaceEffects", "path": "github-repos/coq/esmifro-SurfaceEffects/SurfaceEffects-3450e4b771de4062ab73ee20947adf3f9de579ba/TypeSystem.v"} |
# -*- coding: utf-8 -*-
import json
import os
from typing import List
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import user_events as uev
from user_events import UserEvents
import event_type as et
def retention_by_period(events: UserEvents):
"""
Args:
events - UserEvents ... | {"hexsha": "6a95a0b102fcaca38ee23ff5cc7c564bc4a9dd0d", "size": 2868, "ext": "py", "lang": "Python", "max_stars_repo_path": "retention/retention_by_period.py", "max_stars_repo_name": "bibamur/prodoct-analytics-suite", "max_stars_repo_head_hexsha": "4c65124809a754ff2013a1a709d7e67aaaeb3346", "max_stars_repo_licenses": ["... |
import sys
import numpy as np
from Keyword import Keyword
from Utterance import Utterance
import Distance
import log
def spoken_term_detection_truncated(keywords, utterances, left_encode_num, right_encode_num, distance_type, output_dir):
for i in range(len(keywords)):
keyword_sampling_feature = keywords[i].... | {"hexsha": "e77cd51f3f4f5f61940dd55b0e12f4534101f14e", "size": 6004, "ext": "py", "lang": "Python", "max_stars_repo_path": "Encode_STD_v2/std.py", "max_stars_repo_name": "jingyonghou/TIMIT_STD", "max_stars_repo_head_hexsha": "743112e79115ddc31ed3ebd7c4f7d1d361dfd7e7", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
! This module provides the burner for the dvode test problem. This burner
! should not be used in any real MAESTRO run.
!
! More information in the README file
!
module burner_module
use bl_types
use bl_constants_module
use network
use bl_error_module
contains
subroutine burner(Xin, dt, tol, Xout)
i... | {"hexsha": "3fd89340c49fb4755d6195205d52f836a829cf3a", "size": 3380, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Microphysics/networks/dvode_test/burner.f90", "max_stars_repo_name": "sailoridy/MAESTRO", "max_stars_repo_head_hexsha": "f957d148d2028324a2a1076be244f73dad63fd67", "max_stars_repo_licenses": ["B... |
#!/usr/bin/env python
###########################
# Required Pacakges
##########################
import math
import random
import os
import shutil
import sys
import warnings
import argparse
import collections
import csv
from timeit import default_timer as timer
import numpy as np
import pandas as pd
from scipy.stats... | {"hexsha": "16630b9f3bb0332bfe92da7e7b81e871be1e404d", "size": 18309, "ext": "py", "lang": "Python", "max_stars_repo_path": "staNMF/staNMF.py", "max_stars_repo_name": "greenelab/staNMF", "max_stars_repo_head_hexsha": "2e5a8ed322d4221a5907ce5a479cbbe5ff8653ad", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_cou... |
"""
This file implements the class for Burgers equation.
"""
import numpy
class Burgers(object):
def __init__(self):
pass
def flux(self, q):
return q**2 / 2
def max_lambda(self, q):
return numpy.max(numpy.abs(q))
| {"hexsha": "d9267c397e7656ef627624a99db2cee60612fbb1", "size": 271, "ext": "py", "lang": "Python", "max_stars_repo_path": "coding_exercises/solutions/systems/burgers.py", "max_stars_repo_name": "IanHawke/icts-2020", "max_stars_repo_head_hexsha": "531d0d505fc83b709223f1c924b5e7e08f8c08a4", "max_stars_repo_licenses": ["M... |
from .. import get_endpoint
from .cases_func import f_3p_1im_dep
import math
import numpy as np
import unittest
method = "CICO_ONE_PASS"
class getEndpointTest(unittest.TestCase):
def test_default_options(self):
res0 = [get_endpoint(
[3., 2., 2.1],
i,
lambda x: f_3p_1im_... | {"hexsha": "69f59b051def9686d4205db451a108aabab1520b", "size": 3109, "ext": "py", "lang": "Python", "max_stars_repo_path": "likelihoodprofiler/tests/test_get_endpoint.py", "max_stars_repo_name": "vetedde/lhp.py", "max_stars_repo_head_hexsha": "fd73c1cd24ae66f2be89833ab3f6c9c7bae68a72", "max_stars_repo_licenses": ["MIT"... |
#!/usr/bin/env python
# marker_track.py: Code to track AR marker with respect to Kinect and Baxter
# Author: Nishanth Koganti
# Date: 2016/06/15
# Source: https://github.com/osrf/baxter_demos/blob/master/scripts/get_ar_calib.py
import tf
import yaml
import math
import rospy
import numpy as np
from math import pi
# g... | {"hexsha": "0f85550572a815ec57628f7ce1d2c235c6e87380", "size": 2571, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/marker_track.py", "max_stars_repo_name": "ShibataLabPrivate/kinect_baxter_calibration", "max_stars_repo_head_hexsha": "f969e6bfdab691da928d4ea1b7512b19c66a20b3", "max_stars_repo_licenses":... |
[STATEMENT]
lemma univ_basic_semialg_set_to_semialg_set:
assumes "P \<in> carrier Q\<^sub>p_x"
assumes "m \<noteq> 0"
shows "to_R1 ` (univ_basic_semialg_set m P) = basic_semialg_set 1 m (from_Qp_x P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<lambda>a. [a]) ` univ_basic_semialg_set m P = basic_semialg_... | {"llama_tokens": 5695, "file": "Padic_Field_Padic_Field_Powers", "length": 42} |
'''
This script makes a hdf5 style dataset with all images in a chosen directory.
Gram matrices computed here are never normalized by the number of channels.
Normalization is done if necessary on the training stage.
'''
import numpy as np
import h5py
import keras
import keras.backend as K
from keras.applications impor... | {"hexsha": "1693b7da3017be130519e3f413a10aba6738fcf2", "size": 3010, "ext": "py", "lang": "Python", "max_stars_repo_path": "make_gram_dataset.py", "max_stars_repo_name": "Antinomy20001/neural-style-keras", "max_stars_repo_head_hexsha": "a7fe77db3f565813c2fb8cfd35c533b52928a13e", "max_stars_repo_licenses": ["MIT"], "max... |
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow_docs.vis import embed
import numpy as np
import cv2
# Import matplotlib libraries
from matplotlib import pyplot as plt
from matplotlib.collections import LineCollection
import matplotlib.patches as patches
# Some modules to display an animation usin... | {"hexsha": "6b3b0b9476fa6dfe88275cdd40ce07bcd8791a0b", "size": 1397, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tools/tflite_weight_viewer.py", "max_stars_repo_name": "flymin/movenet", "max_stars_repo_head_hexsha": "a3a74593f622370570506302b04153968abbd1ff", "max_stars_repo_licenses": ["MIT"], "max_star... |
#include <boost/test/unit_test.hpp>
#include "../../src/shared/state.h"
BOOST_AUTO_TEST_CASE(TestStaticAssert)
{
BOOST_CHECK(1);
}
BOOST_AUTO_TEST_CASE(TestGameObject)
{
{
state::ApparitionArea apparitionArea {};
BOOST_CHECK_EQUAL(apparitionArea.getX(), 0);
BOOST_CHECK_EQUAL(apparitionArea.getY(), 0)... | {"hexsha": "505d8af097dfe2438310ef8ae6feb2efcc39037f", "size": 519, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/shared/test_apparition_area.cpp", "max_stars_repo_name": "Welteam/Projet-IS", "max_stars_repo_head_hexsha": "4feeeb39aca9af720f22c8bb3a41f2583fb8cb9b", "max_stars_repo_licenses": ["Unlicense"], ... |
### A Pluto.jl notebook ###
# v0.19.3
using Markdown
using InteractiveUtils
# ╔═╡ 19afaf4e-b19b-47a3-8c4c-31b8879f392d
using JSON, StanSample, Statistics, NamedTupleTools, Random
# ╔═╡ f19cee90-c255-4760-abdc-3c3da106ff9b
stan_chris = "
data {
int n_rows;
int<lower=1> n_cols;
matrix<lower=0>[n_rows,n_co... | {"hexsha": "e48002ec22f2172f9c4abbb93de72a3bea818203", "size": 24088, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/Examples_Test_Cases/matrixinput_nt.jl", "max_stars_repo_name": "goedman/Stan.jl", "max_stars_repo_head_hexsha": "197c60555b14ab90b4efb9b2902e151b9944eb52", "max_stars_repo_licenses": ["MIT"],... |
import unittest
from rasp.model import *
from rasp.core import Primitive, get_vocab
def set_seed(seed):
if seed is not None:
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
class TestTransformer(unittest.TestCase):
def test_model_string_input(self):
set_seed(4)
model = get_model()
o... | {"hexsha": "cbdee39dbe1ee231335a32a4e11ea8764ff3ab63", "size": 2114, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/model_test.py", "max_stars_repo_name": "evelynmitchell/rasp", "max_stars_repo_head_hexsha": "9b33bbf911e6c4ff018c9883c39eb698c0abe803", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import time
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import pathlib, shutil, os
from typing import overload, Callable, Dict, Generic, Iterable, Iterator, List, Mapping, Sequence, \
Tuple, TypeVar, Union
from collections import abc
try:
from typing import Protoc... | {"hexsha": "204d0c8d69aa4fff761073923b9b1ac4dc501081", "size": 6579, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/robbytorch/utils.py", "max_stars_repo_name": "badochov/robbytorch", "max_stars_repo_head_hexsha": "460617eace7d89e093c62051490fa05b86373d64", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
from itertools import *
import networkx as nx
import random
def powerset(iterable):
s = list(iterable)
return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))
def number_of_cuts(G):
edge_list = G.edges()
count = 0
for e in powerset(range(len(edge_list))):
H = nx.Graph()
... | {"hexsha": "31adb7c7b24a637703fee7f0cd205a5846bcc16a", "size": 4599, "ext": "py", "lang": "Python", "max_stars_repo_path": "testdata/makegraph.py", "max_stars_repo_name": "junkawahara/frontier", "max_stars_repo_head_hexsha": "4ae3eb360c96511ec5f3592b8bc85a1d8bce3aec", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#' Tidy Starting Lineups
#'
#' @param j msf object
#' @param ... additional arguments. currently unused
#' @export
tidy.msf_lineup <- function(j, ...) {
# game
game_id <- j[["game"]][["id"]]
game_time <- msf_time(j[["game"]][["startTime"]])
# lineups
team_lineups <- j[["teamLineups"]]
team1 <- parse_game_... | {"hexsha": "180d941c9259c6f60f7d3879c19f612897e0ab40", "size": 3697, "ext": "r", "lang": "R", "max_stars_repo_path": "R/parse-msf-by-game.r", "max_stars_repo_name": "zamorarr/msf2", "max_stars_repo_head_hexsha": "afad5cedf1eb87c83795154d345b8c4860823bc1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_s... |
from pygenetic import Population, Evolution, Statistics
import random
import collections
import bisect
import math
import numpy as np
class GAEngine:
"""
This Class is the main driver program which contains and invokes the operators used in Genetic algorithm
GAEngine keeps track of specific type of operators the u... | {"hexsha": "bc3a9675f3a1dd3e6b37cfd4eabd27e12f6ac8e7", "size": 17899, "ext": "py", "lang": "Python", "max_stars_repo_path": "pygenetic/GAEngine.py", "max_stars_repo_name": "QuailAutomation/pygenetic", "max_stars_repo_head_hexsha": "93b0240a1942b882df30b53d856a87becca1d7ec", "max_stars_repo_licenses": ["MIT"], "max_star... |
[STATEMENT]
lemma map_add_restrict_comm:
"S \<inter> T = {} \<Longrightarrow> h |` S ++ h' |` T = h' |` T ++ h |` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. S \<inter> T = {} \<Longrightarrow> h |` S ++ h' |` T = h' |` T ++ h |` S
[PROOF STEP]
apply (drule restrict_map_disj')
[PROOF STATE]
proof (prove)
goa... | {"llama_tokens": 238, "file": "Separation_Algebra_ex_capDL_Abstract_Separation_D", "length": 3} |
"""Test the module under sampler."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
from collections import Counter
import pytest
import numpy as np
from sklearn.utils.testing import assert_allclose
from sklearn.utils.testing import assert_array_equal
from imblearn.o... | {"hexsha": "65bbc58aebb350e85c80b48710255a65d6e2f934", "size": 4126, "ext": "py", "lang": "Python", "max_stars_repo_path": "exl_env/lib/python3.6/site-packages/imblearn/over_sampling/tests/test_random_over_sampler.py", "max_stars_repo_name": "verma-varsha/fraud-detection", "max_stars_repo_head_hexsha": "13c5b0c274dfa2b... |
import numpy as np
import torch
from matplotlib import pyplot as plt
from matplotlib.pyplot import figure
import json
import argparse
from collections import OrderedDict
import matplotlib.pyplot as plt
from torch import nn
from torch import optim
import torch.nn.functional as F
from PIL import Image
import glob, o... | {"hexsha": "bcb9d41055c4adf9b1fd9069b10f17b7c3608835", "size": 6184, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "MostafaKhaled2017/AI-project", "max_stars_repo_head_hexsha": "1c56f2d0c7a8d99d9b7baa7505f84892aa4f88dd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import os
import json
import shutil
import torch
import numpy as np
from collections import Counter, OrderedDict
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
... | {"hexsha": "16da1cab525b52ea9b45765ed202b981d83ae3e6", "size": 1644, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/utils/utils.py", "max_stars_repo_name": "mhw32/contrastive-learning-scaffold", "max_stars_repo_head_hexsha": "3173c736969da7f1a218cdbe3da039a7ddb8c541", "max_stars_repo_licenses": ["MIT"], "ma... |
''' 5-statistics-error.py
=========================
AIM: Perform basic statistics on the data and gets the maximal stray light flux for one orbit
INPUT: files: - <orbit_id>_misc/orbits.dat
variables: see section PARAMETERS (below)
OUTPUT: in <orbit_id>_misc/ : file one stat file
in <orbit_id>_figures/ : error evo... | {"hexsha": "06f767275f3bdeb2f69907096e11cdb3a0ad90d0", "size": 5532, "ext": "py", "lang": "Python", "max_stars_repo_path": "5_statistics_error.py", "max_stars_repo_name": "kuntzer/SALSA-public", "max_stars_repo_head_hexsha": "79fd601d3999ac977bbc97be010b2c4ef81e4c35", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
#!/usr/bin/env python
__date__ = '2019-March-6'
__version__ = '0.9.43a'
import sys
import numpy
import scipy
import matplotlib
import lmfit
try:
import wx
except:
wx = None
def make_banner():
authors = "M. Newville, M. Koker, B. Ravel, and others"
sysvers = sys.version
if '\n' in sysvers:
... | {"hexsha": "b7091c0436f4a857b8b3f57bc1facb0bc22df692", "size": 954, "ext": "py", "lang": "Python", "max_stars_repo_path": "larch/version.py", "max_stars_repo_name": "Bob620/xraylarch", "max_stars_repo_head_hexsha": "f8d38e6122cc0e8c990b0f024db3b503a5fbf057", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count... |
module zFunOriginal
contains
subroutine zfun(z,fu)
!
! routine which evaluates the plasma dispersion function. uses
! numerical integration (absolute value of the complex argument, z,
! less than 5) or asymptotic expansion.
!
complex z,fu,temp1,temp2,z2,tpiiod
dimension c(21),d(21),e(21... | {"hexsha": "3fd2dc5643c5bb1bb1a7d55533f8aea90b129a52", "size": 3837, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/zfunOriginal.f90", "max_stars_repo_name": "efdazedo/aorsa2d", "max_stars_repo_head_hexsha": "ce0b8c930715277eeb4d23e60cc88434ffdaa583", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import pioneer.common.constants as Constants
from pioneer.common.logging_manager import LoggingManager
from pioneer.das.api.sources.filesource import FileSource, try_all_patterns
from pioneer.das.api.loaders import pickle_loader
from ruamel.std import zipfile
import multiprocessing
import numpy as np
import pandas as... | {"hexsha": "e691c29491733542a4eaffeff4811e6241fc7885", "size": 8861, "ext": "py", "lang": "Python", "max_stars_repo_path": "pioneer/das/api/sources/zip_filesource.py", "max_stars_repo_name": "leddartech/pioneer.das.api", "max_stars_repo_head_hexsha": "35f2c541ea8d1768d5f4612ea8d29cb2ba8345b7", "max_stars_repo_licenses"... |
<html><head>
<meta charset="utf-8">
<title>Dr.J</title>
<link href="style/main.css" rel="stylesheet" type="text/css">
<link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" size... | {"hexsha": "921e14245e4675c0887212f04a5b07189896e357", "size": 5713, "ext": "r", "lang": "R", "max_stars_repo_path": "mrs.r", "max_stars_repo_name": "aboodmw3/mrs.r", "max_stars_repo_head_hexsha": "031417e07499a0d60daad22d95024791c3c74697", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": null, "max_stars_... |
#!/usr/bin/env python
import numpy as np
from matplotlib import *
import matplotlib.pyplot as plt
import sys
import os
swin_hdr = np.dtype([ ('sync', 'i4'), \
('ver', 'i4'), \
('no_bl','i4'), \
('mjd', 'i4'), \
('sec',... | {"hexsha": "bf10d83bbf4d6b4184c359a6c19c590c46b47790", "size": 2810, "ext": "py", "lang": "Python", "max_stars_repo_path": "difxfile.py", "max_stars_repo_name": "liulei/VOLKS", "max_stars_repo_head_hexsha": "eb459cef8f10a8f27a37eb633c5d070fa39f5279", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": null, "... |
from __future__ import print_function
import argparse
import os
import h5py
import numpy as np
import sys
from molecules.model import MoleculeVAE
from molecules.utils import one_hot_array, one_hot_index, from_one_hot_array, \
decode_smiles_from_indexes, load_dataset
from pylab import figure, axes, scatter, title... | {"hexsha": "1302c3af20250ec051789aab7f12a2b1273ff78a", "size": 3281, "ext": "py", "lang": "Python", "max_stars_repo_path": "sample.py", "max_stars_repo_name": "jeammimi/chem2", "max_stars_repo_head_hexsha": "4580f802f50b511937c40f3063d3878c509a9e62", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 537, "max_star... |
import cv2
import mediapipe as mp
import numpy as np
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_face_mesh = mp.solutions.face_mesh
def stack_images(scale, imgArray):
rows = len(imgArray)
cols = len(imgArray[0])
rowsAvailable = isinstance(imgArray[0], list)
... | {"hexsha": "2b0ece6399a0f90aae257cde9b3dbda76d12c859", "size": 9877, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python/OpenCV/Face Mesh/eye_tracking.py", "max_stars_repo_name": "S-c-r-a-t-c-h-y/coding-projects", "max_stars_repo_head_hexsha": "cad33aedb72720c3e3a37c7529e55abd3edb291a", "max_stars_repo_licens... |
import os
import torch
import torch.utils.data
from torchvision.datasets.utils import download_url
import numpy as np
from .abstract import StandardVisionDataset
from .base import print_loaded_dataset_shapes, log_call_parameters
class GermanDataset(torch.utils.data.Dataset):
base_folder = "german"
relevan... | {"hexsha": "415c07880420b78fadc17132abecf0ccdd3ad175", "size": 3540, "ext": "py", "lang": "Python", "max_stars_repo_path": "nnlib/data_utils/german.py", "max_stars_repo_name": "amf272/nnlib", "max_stars_repo_head_hexsha": "6a14b73cc5bb2761b41c07931ba1c66ec2c4d75b", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
from __future__ import division
from scipy.signal import blackmanharris
from numpy.fft import rfft, irfft
from numpy import argmax, sqrt, mean, absolute, arange, log10
import numpy as np
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import Sndfile
def rms_flat(a):
"""
Return the root mea... | {"hexsha": "13dd5085a8e0460da13fc270546c5522b0774239", "size": 3674, "ext": "py", "lang": "Python", "max_stars_repo_path": "task/thdncalculator.py", "max_stars_repo_name": "joseph9991/Milestone1", "max_stars_repo_head_hexsha": "08f95e845a743539160e9a7330ca58ea20240229", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
from subprocess import PIPE, run
import pandas as pd
import uuid
import numpy as np
import matplotlib.pyplot as plt
from perf import PerfObj
from sys import argv
import os
def plot_barchart_against(dfs: list, y_axis="L1-dcache-load-misses", test_names=None, save_file="bars.png"):
df1 = dfs[0][1]
if test_names ... | {"hexsha": "427099b54065c95d459f974c588420ed365a7ad3", "size": 4246, "ext": "py", "lang": "Python", "max_stars_repo_path": "benchmark.py", "max_stars_repo_name": "6851-2021/Cache-Oblivious-Data-Structures", "max_stars_repo_head_hexsha": "07cbddeb175f6d838ae9ebb3bc86d4820d7a21ea", "max_stars_repo_licenses": ["MIT"], "ma... |
import itertools
import os.path
import sys
import subprocess
import time
import fileinput
import numpy as np
import pandas as pd
# Enter 1 parameter: otu table with reads
path = sys.argv[1]
cond = path.split('/')[-1].split('.')[0]
def teach_predictor(path, params, same, job, wait):
time.sleep(1)
if not(wait ... | {"hexsha": "0de5fba780ebd3ffebaffd61672cd928716c2d72", "size": 6181, "ext": "py", "lang": "Python", "max_stars_repo_path": "linear_model/model_pick/rational/parallel_script.py", "max_stars_repo_name": "lotrus28/TaboCom", "max_stars_repo_head_hexsha": "b67d66e4c410375a9efa08c5e637301e78e9204b", "max_stars_repo_licenses"... |
from itertools import product
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
import pytest
from sklearn import datasets
from sklearn import manifold
from sklearn import neighbors
from sklearn import pipeline
from sklearn import preprocessing
from scipy.sparse import rand a... | {"hexsha": "18133719bf85a5ae51f753065456a81ab5781017", "size": 6487, "ext": "py", "lang": "Python", "max_stars_repo_path": "chatbot_env/Lib/site-packages/sklearn/manifold/tests/test_isomap.py", "max_stars_repo_name": "rakmakan/Chatbot", "max_stars_repo_head_hexsha": "d04bc1526b56961a16c25148d9ef18c4f157e9c4", "max_star... |
import numpy as np
from components.transforms import _underscore_to_cap
class BasicLearner():
"""
basis class for learners
"""
def _add_stat(self, name, value, T_env):
if isinstance(value, np.ndarray) and value.size == 1:
value = float(value)
if not hasattr(self, "_stats... | {"hexsha": "4908c9ce50a702261bd0469396ee71f535ec6e61", "size": 1467, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/learners/basic.py", "max_stars_repo_name": "ewanlee/mackrl", "max_stars_repo_head_hexsha": "6dd505aa09830f16c35a022f67e255db935c807e", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
////////////////////////////////////////////////////////////////////////////////////////////////////
// literals.hpp
//
// Copyright 2012 Eric Niebler.
// 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)
#ifndef BOO... | {"hexsha": "db32c7ba6dc764a422a3729f33507dac6a674b94", "size": 2644, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "boost/proto/v5/literals.hpp", "max_stars_repo_name": "ericniebler/proto-0x", "max_stars_repo_head_hexsha": "b8d80f1434e37a2a32613cdf58b02b5f7143cc1f", "max_stars_repo_licenses": ["BSL-1.0"], "max_st... |
(** Generated by coq-of-ocaml *)
Require Import OCaml.OCaml.
Local Set Primitive Projections.
Local Open Scope string_scope.
Local Open Scope Z_scope.
Local Open Scope type_scope.
Import ListNotations.
Unset Positivity Checking.
Unset Guard Checking.
Inductive nat : Set :=
| O : nat
| S : nat -> nat.
Inductive natu... | {"author": "yalhessi", "repo": "lemmaranker", "sha": "53bc2ad63ad7faba0d7fc9af4e1e34216173574a", "save_path": "github-repos/coq/yalhessi-lemmaranker", "path": "github-repos/coq/yalhessi-lemmaranker/lemmaranker-53bc2ad63ad7faba0d7fc9af4e1e34216173574a/benchmark/clam/_lfind_clam_lf_goal33_distrib_100_plus_assoc/goal33con... |
from __future__ import division
import time
import sys
import math
import numpy as np
import torch
import torch.nn as nn
from onmt.Trainer import Statistics as BaseStatistics
from onmt.Utils import use_gpu
from cocoa.io.utils import create_path
class Statistics(BaseStatistics):
def output(self, epoch, batch, n... | {"hexsha": "be7c8410c4250b92bece70ecdec69b6445f350a5", "size": 9652, "ext": "py", "lang": "Python", "max_stars_repo_path": "cocoa_folder/cocoa/neural/trainer.py", "max_stars_repo_name": "s-akanksha/DialoGraph_ICLR21", "max_stars_repo_head_hexsha": "d5bbc10b2623c9f84d21a99a5e54e7dcfdfb1bcc", "max_stars_repo_licenses": [... |
module kind_module
implicit none
integer, parameter, public :: isp = selected_int_kind(9)
integer, parameter, public :: idp = selected_int_kind(18)
#ifdef QUAD_PRECISION
integer, parameter, public :: dp = 16
#elsif TEN_DIGIT_PRECISION
integer, parameter, public :: dp = selected_real_kind(10)
#else
intege... | {"hexsha": "230fc222741c051aded7db28b1bf77c976453d7d", "size": 577, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "src/libAtoms/kind_module.f95", "max_stars_repo_name": "Sideboard/QUIP", "max_stars_repo_head_hexsha": "f41372609e4a92fcda9f33b695a666de3886822b", "max_stars_repo_licenses": ["NRL"], "max_stars_co... |
#ifndef QUBUS_UTIL_INDEX_TUPLE_HPP
#define QUBUS_UTIL_INDEX_TUPLE_HPP
#include <boost/container/small_vector.hpp>
namespace qubus
{
namespace util
{
template <typename T>
using index_tuple = boost::small_vector<T, 10>;
}
}
#endif
| {"hexsha": "92f7f442a4a889b49d4a4d080fb9edeedd658ba1", "size": 235, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "util/include/qubus/util/index_tuple.hpp", "max_stars_repo_name": "qubusproject/Qubus", "max_stars_repo_head_hexsha": "0feb8d6df00459c5af402545dbe7c82ee3ec4b7c", "max_stars_repo_licenses": ["BSL-1.0"]... |
using Pkg
Pkg.activate(".")
Pkg.instantiate()
##
using DataFrames
using CSV
using Plots
using StatsPlots
using Plots.PlotMeasures
using Statistics
using StatsFuns
##
fpairs = CSV.read("../data/fpairs.txt", DataFrame, header=false)[:,1]
##
theme(:solarized_light)
#
upscale = 2 #8x upscaling in resolution
fntsm = Plo... | {"hexsha": "f61b32e7d204f0da86c1d2bd23e4db7a1d366114", "size": 1409, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "code/visualizeBS.jl", "max_stars_repo_name": "erathorn/phylogeneticTypology", "max_stars_repo_head_hexsha": "ba1fb23eed99b63708291bbbbdf49f1c2a3c1b07", "max_stars_repo_licenses": ["MIT"], "max_star... |
import argparse
import gym
from gym import wrappers
import os.path as osp
import random
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as layers
import dqn
from dqn_utils import *
from atari_wrappers import *
def cartpole_model(img_in, num_actions, scope, reuse=False):
# as described... | {"hexsha": "3609e444b8c5bb2fb6f02e058031389515ff2334", "size": 4129, "ext": "py", "lang": "Python", "max_stars_repo_path": "hw3/run_dqn_cartpole.py", "max_stars_repo_name": "akashin/BerkeleyDeepRL", "max_stars_repo_head_hexsha": "62292fe932b0b6dbf06c5baa0b8b7dad75792142", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
#!/usr/bin/env python3.7
"""
The copyrights of this software are owned by Duke University.
Please refer to the LICENSE.txt and README.txt files for licensing instructions.
The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent
"""
import random
import warnings
from typi... | {"hexsha": "90b9279b746e8d80f9c8fe26531545d3baaf5e5e", "size": 31199, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/core/fiberset.py", "max_stars_repo_name": "wmglab-duke/ascent", "max_stars_repo_head_hexsha": "2ca8c39a4462a728108038294ddac27488e9758b", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
from unittest import TestCase
import time
import shutil
import os
from dat_analysis.dat_object.attributes.transition import Transition, default_transition_params, i_sense
from dat_analysis.dat_object.dat_hdf import DatHDF
from dat_analysis.hdf_file_handler import HDFFileHandler
import h5py
from dat_analysis.hdf_util im... | {"hexsha": "ee75c861f3005603ddc277e94c20bb4f2ec82830", "size": 2262, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_Transition.py", "max_stars_repo_name": "TimChild/dat_analysis", "max_stars_repo_head_hexsha": "2902e5cb2f2823a1c7a26faf6b3b6dfeb7633c73", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
From hahn Require Import Hahn.
Require Import Exec.
Require Import Events.
Section Scdrf.
Lemma drf_tot__hb_sc e X Y :
well_formed e ->
consistent e ->
data_race_free e ->
tot e X Y ->
overlap X Y ->
writes e X \/ writes e Y ->
hb e X Y \/ (same_loc X Y /\ sc e X /\ sc e Y).
Proof.
intros wf cst drf t... | {"author": "Biebar", "repo": "jsrelaxedmemorymodel_coq", "sha": "b0e5d5e470d7fcc579121f9013bf1df4ad5afe69", "save_path": "github-repos/coq/Biebar-jsrelaxedmemorymodel_coq", "path": "github-repos/coq/Biebar-jsrelaxedmemorymodel_coq/jsrelaxedmemorymodel_coq-b0e5d5e470d7fcc579121f9013bf1df4ad5afe69/Scdrf.v"} |
#PyQt imports
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLineEdit
import sys
import os
from time import sleep
import pyrealsense2 as rs;
import numpy as np;
import cv2 as cv;
class Container(QWidget):
def __init__(self):
super().__init__();
self.__textField = "";
... | {"hexsha": "0baaf93812456c6387128205b87e12449765ee40", "size": 4951, "ext": "py", "lang": "Python", "max_stars_repo_path": "addToDataset.py", "max_stars_repo_name": "ShaneClancy/gesture-recognition", "max_stars_repo_head_hexsha": "d6b3e14f6001fda71bb798435896529e2fc54750", "max_stars_repo_licenses": ["MIT"], "max_stars... |
Set Warnings "-notation-overridden".
Require Import Coq.Program.Basics.
From Equations Require Import Equations.
Unset Equations With Funext.
Require Import Category.Lib.
Require Import Category.Theory.
Require Import Embed.Theory.Btree.
Require Import Embed.Theory.Lattice.
Generalizable All Variables.
Set Univers... | {"author": "michaeljklein", "repo": "btree-lattice-experiments", "sha": "769670d3c98591a4ddb3854feea22eae554323f5", "save_path": "github-repos/coq/michaeljklein-btree-lattice-experiments", "path": "github-repos/coq/michaeljklein-btree-lattice-experiments/btree-lattice-experiments-769670d3c98591a4ddb3854feea22eae554323f... |
[STATEMENT]
lemma take_takefill [simp]: "m \<le> n \<Longrightarrow> take m (takefill fill n w) = takefill fill m w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. m \<le> n \<Longrightarrow> take m (takefill fill n w) = takefill fill m w
[PROOF STEP]
by (auto simp: le_iff_add take_takefill') | {"llama_tokens": 109, "file": "Word_Lib_Reversed_Bit_Lists", "length": 1} |
# <center>Multiscale Geographically Weighted Regression - Binomial dependent variable</center>
The model has been explored and tested for multiple parameters on real and simulated datasets. The research includes the following outline with separate notebooks for each part.
**Notebook Outline:**
**Introduction N... | {"hexsha": "97840b37f3f5f1e13e2650b54faea4bb1e127598", "size": 8779, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "Notebooks/.ipynb_checkpoints/Binomial_MGWR-checkpoint.ipynb", "max_stars_repo_name": "TaylorOshan/MGWR_workshop_book", "max_stars_repo_head_hexsha": "4c0be5cb08dfc669c8da0d1c074f3c505... |
/*
// Licensed to DynamoBI Corporation (DynamoBI) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. DynamoBI licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may ... | {"hexsha": "472694931896c10e11f0f01799fae2da8924d3e5", "size": 4253, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "fennel/test/PseudoUuidTest.cpp", "max_stars_repo_name": "alexavila150/luciddb", "max_stars_repo_head_hexsha": "e3125564eb18238677e6efb384b630cab17bb472", "max_stars_repo_licenses": ["Apache-2.0"], "... |
# ***************************************************************
# Copyright (c) 2020 Jittor. Authors: Dun Liang <randonlang@gmail.com>. All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ********************************... | {"hexsha": "b19e5c95327b8877e09f39d5a7fe58fcfd2b150a", "size": 2228, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/jittor/test/test_code_op.py", "max_stars_repo_name": "xmyqsh/jittor", "max_stars_repo_head_hexsha": "1260e19235e301a67cba57aebbc187a5c1386e1a", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
from pyBRML import Array, utils
import pyBRML as brml
import numpy as np
class TestPyBRMLCore:
def test_multiply_potentials(self):
knife_index = [0,2,1]
knife_table = np.zeros((2,2,2))
knife_table[1,0,0] = 0.0
knife_table[1,1,0] = 0.04
knife_table[1,0,1] = 0.64
knife... | {"hexsha": "80816db0710c926e8e911992f36edc04a827499a", "size": 803, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyBRML/tests/test_core.py", "max_stars_repo_name": "anich003/brml_toolkit", "max_stars_repo_head_hexsha": "de8218bdf333902431d4c0055fcf5cb3dc47d0c1", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# Обратная задача динамики
Рассмотрим обратную задачу динамики на примере двузвенного робота:
```python
from sympy import *
t = Symbol("t")
g = Symbol("g")
```
Создадим свое собственное описание положения:
```python
class Position:
def __init__(self, x, y, a):
super(Position, self).__init__()
... | {"hexsha": "155d5b3f4fc72209fa57d74d7fadf1973d32e169", "size": 6845, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "7 - Dynamics.ipynb", "max_stars_repo_name": "red-hara/jupyter-dh-notation", "max_stars_repo_head_hexsha": "0ffd305b3e67ce7dd3c20f2d1c719b53251dbf58", "max_stars_repo_licenses": ["MIT"... |
! SUBROUTINE DDAWTS(RTOL,ATOL)
SUBROUTINE DDAWTS(function_parameter)
! IMPLICIT DOUBLE PRECISION(A-H,O-Z)
! DIMENSION RTOL(*),ATOL(*)
! DIMENSION ATOL(*)
! DIMENSION RTOL(*)
function_variable = function_parameter(1)
10 continue
END
| {"hexsha": "2bc15dedd0f306623f78d33499b0c10eb8a6048e", "size": 280, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "tests/CompileTests/Fortran_tests/test2007_200.f", "max_stars_repo_name": "maurizioabba/rose", "max_stars_repo_head_hexsha": "7597292cf14da292bdb9a4ef573001b6c5b9b6c0", "max_stars_repo_licenses": ["... |
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2004-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)
//
// See http://www.boost.org/libs/c... | {"hexsha": "33f268336ddf83392f374cbd26be6fe7eb8f2137", "size": 17137, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libs/container/test/string_test.cpp", "max_stars_repo_name": "jmuskaan72/Boost", "max_stars_repo_head_hexsha": "047e36c01841a8cd6a5c74d4e3034da46e327bc1", "max_stars_repo_licenses": ["BSL-1.0"], "m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 2 15:36:28 2017
@author: Anderson Banihirwe
Simple Particle Swarm Optimization (PSO)
"""
import random
import math
import time
import numpy as np
#---------- COST FUNCTION -----------------------------#
# function to optimize (minimize)
def c... | {"hexsha": "439175715410eb88e031dc56443461452625ff61", "size": 4520, "ext": "py", "lang": "Python", "max_stars_repo_path": "projects/TSP/pyswarm.py", "max_stars_repo_name": "andersy005/artificial-intelligence", "max_stars_repo_head_hexsha": "dcf5ebb1959835aee7dacdb5a2cea14790f2cf01", "max_stars_repo_licenses": ["MIT"],... |
#!/usr/bin/env python3
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
import argparse
import logging
import os
import math
from tqdm import tqdm
import numpy as np
from PIL import Image
from typing import List, Optional
import cv2
from enum import auto
from functools import lru_cache
import path_to_k... | {"hexsha": "12426e04cc883745e179601ccf8d68acfc5e04fe", "size": 14785, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/kapture_create_3D_model_from_depth.py", "max_stars_repo_name": "jkabalar/kapture-localization", "max_stars_repo_head_hexsha": "647ef7cfdfbdac37297682baca1bf13608b6d6e8", "max_stars_repo_lic... |
import logging
log = logging.getLogger(__name__)
def generate_data_dict(dataset, source, name='dict', verbose=False):
import numpy as np
import theano
dtype = theano.config.floatX
# get data into a dict, need to use the full dataset (no subset!)
state = dataset.open()
request = slice(0, datas... | {"hexsha": "9b3426d322129cdfc7333999672103231b66a411", "size": 923, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepthought/bricks/data_dict.py", "max_stars_repo_name": "maosenGao/openmiir-rl-2016", "max_stars_repo_head_hexsha": "d2e5744b1fa503a896994d8a70b3ca45d521db14", "max_stars_repo_licenses": ["BSD-3-C... |
import sklearn.cluster
from kmeans_gap import GAP
import grace
import grace.mask
import numpy as np
import sys
parallel = int(sys.argv[1] if (len(sys.argv) > 1) else 1)
if __name__=='__main__':
shape = grace.grids.shape
X = grace.grids.reshape(shape[0] * shape[1], shape[2])
mask = grace.mask.world().reshape(shape... | {"hexsha": "c93674f8b241375f9622e15ee5b80e96c86806b6", "size": 641, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/kmeans_gap_job.py", "max_stars_repo_name": "AndreasMadsen/grace", "max_stars_repo_head_hexsha": "bf472d30a2fac76145d3f68e819c92da4a1970ba", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#include <boost/python/converter/arg_to_python_base.hpp>
| {"hexsha": "250c907857fc0d9dfe2a93bd951bb4739e93c847", "size": 57, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_python_converter_arg_to_python_base.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licens... |
using Random
using LinearAlgebra, Krylov
using Plots
using RandomizedLasso
const RL = RandomizedLasso
## Compare "best" vs random preconditioner on random example
# Data
n, r = 1000, 500
A = randn(n, r)
A = A*A'
μ = 1e-2
xtrue = randn(n)
b = A*xtrue
D, V = eigen(A)
function true_preconditioner(k, D, V, μ)
return... | {"hexsha": "d01c6c129ba962dbc75a848b11beedfcfd89dcca", "size": 2333, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/pcg.jl", "max_stars_repo_name": "tjdiamandis/RandomizedLasso.jl", "max_stars_repo_head_hexsha": "13336c81c82a83b8a5889badae2195fbdd0da0af", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# Crypto API testing script
import pandas_datareader as web
import pandas as ps
import numpy as np
import matplotlib.pyplot as plt
| {"hexsha": "5088239026618421a0aab3a3ec20888978aa1e83", "size": 135, "ext": "py", "lang": "Python", "max_stars_repo_path": "crypto.py", "max_stars_repo_name": "andrewbowen19/stonkify", "max_stars_repo_head_hexsha": "31fd9bd8abd04f7f78b149396d4600613734ca0b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
import torch
from torch import Tensor
import torch.nn as nn
import numpy as np
import torchvision
import torchaudio
class ToSampleCoords(nn.Module):
"""
Pytorch module to convert coordinates measured in seconds
into coordinates measured in sample Nos,
Default sample rate is 16kHz unless this is set th... | {"hexsha": "c5b7e2e11947b7b1375a8247d57278669aac1f63", "size": 18664, "ext": "py", "lang": "Python", "max_stars_repo_path": "classifier/data/transform/transforms.py", "max_stars_repo_name": "bendikbo/SSED", "max_stars_repo_head_hexsha": "fdd0e74d419687bc8cba65341d7248ca6ccd1a4e", "max_stars_repo_licenses": ["MIT"], "ma... |
from __future__ import absolute_import, division, print_function
import numpy as np
import theano
import theano.tensor as T
from theano.ifelse import ifelse
from models import rhn
from models import rnn
from models import lstm
from utils import shared_uniform, get_dropout_noise, shared_zeros, cast_floatX
floatX =... | {"hexsha": "a5c009a62dde46740979b9ff5d0bd80070dc51f2", "size": 3353, "ext": "py", "lang": "Python", "max_stars_repo_path": "Chapter10/models/stacked.py", "max_stars_repo_name": "PacktPublishing/Deep-Learning-with-Theano", "max_stars_repo_head_hexsha": "39b940f7c6993533a9744d0c1b792e408486e89a", "max_stars_repo_licenses... |
<center>
<h1> ILI285 - Computación Científica I / INF285 - Computación Científica </h1>
<h2> Least Squares </h2>
<h2> [[S]cientific [C]omputing [T]eam](#acknowledgements)</h2>
<h2> Version: 1.24</h2>
</center>
## Table of Contents
* [Introduction](#intro)
* [QR Factorization](#qr)
* [Examples](#ex)
* ... | {"hexsha": "b7541f259dc24c305057b0ea1f0c142e66b32e34", "size": 15155, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "SC1/09_Least_Squares.ipynb", "max_stars_repo_name": "cristopherarenas/Scientific-Computing", "max_stars_repo_head_hexsha": "7bbcd67aee343ad4561165fed21c3963307b3c14", "max_stars_repo... |
from __future__ import print_function
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.optim as optim
from tensorboardX import SummaryWriter
import os
import time
import argparse
import numpy as np
from loss_functions import alpha_loss, foreground_loss, error_map_loss
#CUDA
print... | {"hexsha": "7859b025e7faec0916a38cce84f0f586e730e86e", "size": 1242, "ext": "py", "lang": "Python", "max_stars_repo_path": "training/train_fake.py", "max_stars_repo_name": "kie4280/bg-matting-with-depth", "max_stars_repo_head_hexsha": "99cb87eb05342c7c6e3c871c6bccd8aef06a5451", "max_stars_repo_licenses": ["MIT"], "max_... |
import unittest
import skrf
import numpy as np
import tempfile
import os
class VectorFittingTestCase(unittest.TestCase):
def test_vectorfitting_ring_slot(self):
# expected fitting parameters for skrf.data.ring_slot with 2 initial real poles
expected_poles = np.array([-7.80605445e+10+5.32645184e+1... | {"hexsha": "d68c06ed714e1c5d2eb89d8082fa37a0925827d7", "size": 5041, "ext": "py", "lang": "Python", "max_stars_repo_path": "skrf/tests/test_vectorfitting.py", "max_stars_repo_name": "DavidLutton/scikit-rf", "max_stars_repo_head_hexsha": "1e0dfb2c560058ae21ddf255f395a753b6ea696f", "max_stars_repo_licenses": ["BSD-3-Clau... |
from omegaconf import DictConfig, OmegaConf
import hydra
from hydra.core.hydra_config import HydraConfig
import itertools as it
import os.path as osp
import os
from subprocess import Popen, PIPE
from datetime import datetime
import numpy as np
import pandas as pd
from shutil import copy
import re
import ruamel.yaml
@h... | {"hexsha": "7da3d4ef67298fd5cd819b74be2b20f1c353a301", "size": 9348, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/run_experiments.py", "max_stars_repo_name": "FionaLippert/FluxRGNN", "max_stars_repo_head_hexsha": "176f8f6bf24f65b9822e406f5de173cc5a17960a", "max_stars_repo_licenses": ["MIT"], "max_star... |
#!/usr/bin/env python
# coding: utf-8
"""
@Time : 19-9-15 上午11:05
@Author : yangzh
@Email : 1725457378@qq.com
@File : image_util.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
def preprocess_input(x):
x = x.asty... | {"hexsha": "3409d61be5a8ebc804130e53149993e98216857e", "size": 574, "ext": "py", "lang": "Python", "max_stars_repo_path": "image_util.py", "max_stars_repo_name": "Yangget/Weath_classification", "max_stars_repo_head_hexsha": "6cab35de07f0b7bcdcf9cf5d4e4ec47d2eb890c7", "max_stars_repo_licenses": ["Apache-2.0"], "max_star... |
import numpy as np
from scipy.special import logsumexp
import ctypes
import os
import platform
if platform.system() == "Linux":
lpm_lib = np.ctypeslib.load_library("liblpm_lib.so", "bin/")
elif platform.system() == "Darwin":
lpm_lib = np.ctypeslib.load_library("liblpm_lib.dylib", "bin/")
np.random.seed(1... | {"hexsha": "bca8673a2d48425768377a61b961e1397513b291", "size": 1104, "ext": "py", "lang": "Python", "max_stars_repo_path": "generate_data.py", "max_stars_repo_name": "junseonghwan/linear-progression", "max_stars_repo_head_hexsha": "feda9f18d44f2ccc54a3750d1fe9a9ad323dcd36", "max_stars_repo_licenses": ["BSD-2-Clause"], ... |
import os
import glob
import scipy
import shutil
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data as data
import torch.nn.utils.rnn as rnn_utils
from tqdm import tqdm
def collate_fn(batch):
batch.sort(key=lambda x: len(x[1]), reverse=True)
seq, label = zip(*batch)
seq_length =... | {"hexsha": "dffa19bed81466ebe56e33bcf1e203089c94eabb", "size": 2497, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_load.py", "max_stars_repo_name": "ishine/E2E-langauge-diarization", "max_stars_repo_head_hexsha": "0bcb3ec82bd6de6fac848c66fd5ad8fe7b284f0e", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import os
import numpy as np
from . import tf
from phi import math
from phi.physics.pressuresolver.solver_api import PoissonSolver
# --- Load Custom Ops ---
current_dir = os.path.dirname(os.path.realpath(__file__))
kernel_path = os.path.join(current_dir, 'cuda/build/pressure_solve_op.so')
if not os.path.isfile(kernel... | {"hexsha": "ad0fc2b967c8cac23558472635aace59e697524a", "size": 2217, "ext": "py", "lang": "Python", "max_stars_repo_path": "phi/tf/tf_cuda_pressuresolver.py", "max_stars_repo_name": "VemburajYadav/PhiFlow", "max_stars_repo_head_hexsha": "842c113d1850569b97e30ab0632866bb5bc4b300", "max_stars_repo_licenses": ["MIT"], "ma... |
import sys
from collections import Counter
import math
import datetime
import re
import numpy as np
filepath = str(sys.argv[1])
output = str(sys.argv[2])
time = []
i = 0
for ar in sys.argv :
i = i + 1
if ar == "-h" :
time.append(sys.argv[i])
time.append(sys.argv[i+1])
if len(time) > 0 :
dfrom = dateti... | {"hexsha": "6e71cb5ec6b278fa4c39bd2b78f7a9f774560ad9", "size": 2132, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/manual_labelization.py", "max_stars_repo_name": "jwheatp/twitter-riots", "max_stars_repo_head_hexsha": "cc3aa5586560e1195e0adc4c58eb881446356958", "max_stars_repo_licenses": ["MIT"], "max... |
! PR fortran/64528
! { dg-do compile }
! { dg-options "-O -fno-tree-dce -fno-tree-ccp" }
program pr64528
interface
subroutine foo(x)
integer, value :: x
end subroutine foo
end interface
integer :: x
x = 10
call foo(x)
if(x .ne. 10) then
endif
end program pr64528
subroutine foo(x)
integ... | {"hexsha": "f6cca4f73e002e5f62d3fee7fe13293db6b75c2e", "size": 363, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "validation_tests/llvm/f18/gfortran.dg/pr64528.f90", "max_stars_repo_name": "brugger1/testsuite", "max_stars_repo_head_hexsha": "9b504db668cdeaf7c561f15b76c95d05bfdd1517", "max_stars_repo_licenses... |
'''
This file might work differently in the future! Don't reuse it
'''
import scipy as sp
import mesh
import myOS
import FMM.inputDat as inputDat
base_folder = 'expected_new'
# Flagellum
def write_flag():
folder_expected = base_folder + '/flagellum'
s = sp.linspace(0, 2, 10)
radius = 0.1
azimuth_... | {"hexsha": "4cd979db8f9304a901e07e45859e6d48b11aee58", "size": 7240, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/data/triangulation/create_input_for_test.py", "max_stars_repo_name": "icemtel/stokes", "max_stars_repo_head_hexsha": "022de2417919a18ed5b0262111e430384053137d", "max_stars_repo_licenses": ["M... |
import pandas as pd
import numpy as np
import lightgbm as lgb
from sklearn import model_selection
from functools import partial
import optuna
from . import regression_metrics
def optimize(trial, df):
n_estimators = trial.suggest_int("n_estimators", 50, 1000)
num_leaves = trial.suggest_int("num_leaves", 10,... | {"hexsha": "946581382aa0406357c81abaecbfe9399cdbfa14", "size": 1972, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/search_optuna.py", "max_stars_repo_name": "BAfsharmanesh/New_project", "max_stars_repo_head_hexsha": "766e43494bd55217abf9f8be22df42e2bc7e678c", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import numpy as np
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import average_precision_score
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import datetime
from keras im... | {"hexsha": "176386321422adb476c5455a04952a065bd88616", "size": 2907, "ext": "py", "lang": "Python", "max_stars_repo_path": "W2V_NN.py", "max_stars_repo_name": "nivedit1/TwitterSentimentAnalysis", "max_stars_repo_head_hexsha": "972fdb46fab6f07748d685b94b80450cb5131c5f", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
# indicator of the L0 norm ball with given (integer) radius
"""
IndBallL0(r::Int=1)
Returns the function `g = ind{x : countnz(x) ⩽ r}`, for an integer parameter `r > 0`.
"""
immutable IndBallL0{I <: Integer} <: IndicatorNonconvex
r::I
function IndBallL0(r::I)
if r <= 0
error("parameter r must be a po... | {"hexsha": "a325fd66e8290bc029a55a02d2e30fbeaa8747e0", "size": 1406, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/functions/indBallL0.jl", "max_stars_repo_name": "mfalt/ProximalOperators.jl", "max_stars_repo_head_hexsha": "ab76ed9c93f9ec778281ad14f7bd3208b94c705d", "max_stars_repo_licenses": ["MIT"], "max_... |
include("./MT1D.jl")
module MT1DGeneticInversion
using MT1D
export LayerBC, Inversion, evolve!
"""
Description
===========
`LayerBC` defines a set of boundary conditions for a layer. One instance
represents either the resistivity or depth boundaries.
Fields
======
- `min::Integer`: Lower boundary for the layer.
- ... | {"hexsha": "f5e69382464a409a959d1b682f8b35081e66001c", "size": 502, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/MT1DGeneticInversion.jl", "max_stars_repo_name": "alexjohnj/genetic-mt1d", "max_stars_repo_head_hexsha": "0822ae95ae0d239b54a7b094cbd7c25a51557325", "max_stars_repo_licenses": ["MIT"], "max_star... |
C***********************************************************************
C***********************************************************************
C
C Version: 0.3
C Last modified: December 27, 1994
C Authors: Esmond G. Ng and Barry W. Peyton
C
C Mathematical Sciences Section, Oak Ridge National L... | {"hexsha": "73b0c7560800186dde973d620e0f784f269d4683", "size": 1578, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "LIB/dscal.f", "max_stars_repo_name": "Pangqiyuangh/SeIInv", "max_stars_repo_head_hexsha": "2a6713dc19f0f816ecbc5d20c77b5c0a1974b852", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": 2... |
[STATEMENT]
theorem wls_fresh_vsubst_ident[simp]:
assumes "wls s X" and "fresh ys y X"
shows "(X #[y1 // y]_ys) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. X #[y1 // y]_ys = X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
fresh ys y X
goal (1 subgoal):
1. X #[y1 // y]_ys = X
[PRO... | {"llama_tokens": 171, "file": "Binding_Syntax_Theory_Well_Sorted_Terms", "length": 2} |
# [Introductory applied machine learning (INFR10069)](https://www.learn.ed.ac.uk/webapps/blackboard/execute/content/blankPage?cmd=view&content_id=_2651677_1&course_id=_53633_1)
# Lab 5: Neural Networks
*by [James Owers](https://jamesowers.github.io/), University of Edinburgh 2017*
1. [Introduction](#Introduction)
... | {"hexsha": "dc40600618bddbce6df2462713976c0c11fd42c4", "size": 44364, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "10_Lab_5_Neural_Networks.ipynb", "max_stars_repo_name": "CaesarZhang070497/Iaml", "max_stars_repo_head_hexsha": "cb13d2aa50c37563d50eaf380542578994effd91", "max_stars_repo_licenses":... |
# coding: utf-8
# @时间 : 2022/1/18 2:09 下午
# @作者 : 文山
# @邮箱 : wolaizhinidexin@163.com
# @作用 :
# @文件 : model.py
# @微信 :qwentest123
import tensorflow as tf
import numpy as np
import pandas as pd
from tensorflow.keras import Model, Sequential, layers
from tensorflow.keras import Model
import time, json, os
fro... | {"hexsha": "c3530b1153a221ebd0d40e23f8c01b56127cbd76", "size": 7707, "ext": "py", "lang": "Python", "max_stars_repo_path": "EfficientNet/model.py", "max_stars_repo_name": "qwentest/qwenAILearn", "max_stars_repo_head_hexsha": "c94e10417da9c5cd8e14e22bdcc884fb9142be68", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
from __future__ import print_function
import os
import sys
import numpy as np
import torch
import networkx as nx
import random
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
from copy i... | {"hexsha": "1126d37997241bdc2b9432076811d6e00a224494", "size": 4380, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/node_attack/node_grad_attack.py", "max_stars_repo_name": "HenryKenlay/graph_adversarial_attack", "max_stars_repo_head_hexsha": "5282d1269aa637ecafb0af239c53fa8396e5ef66", "max_stars_repo_lice... |
import numpy as np
from IMLearn.base import BaseEstimator
from typing import Callable, NoReturn
from IMLearn.metrics.loss_functions import misclassification_error
class AdaBoost(BaseEstimator):
"""
AdaBoost class for boosting a specified weak learner
Attributes
----------
self.wl_: Callable[[], ... | {"hexsha": "b75f44cf16b6f0421ae5e047e3e3b279b71ffca5", "size": 5099, "ext": "py", "lang": "Python", "max_stars_repo_path": "IMLearn/metalearners/adaboost.py", "max_stars_repo_name": "DanitYanowsky/IML.HUJI", "max_stars_repo_head_hexsha": "391b661ede3fdbb72ecdf900c32df69445b3868b", "max_stars_repo_licenses": ["MIT"], "m... |
import datetime as dt
import tempfile
import numpy as np
from ravenpy.config.commands import LU
from ravenpy.models import BLENDED, BLENDED_OST
from ravenpy.utilities.testdata import get_local_testdata
from .common import _convert_2d
TS = get_local_testdata(
"raven-gr4j-cemaneige/Salmon-River-Near-Prince-George... | {"hexsha": "f836c4c15852706aa484113ee11e6b8097f32bbd", "size": 9775, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_blended.py", "max_stars_repo_name": "CSHS-CWRA/RavenPy", "max_stars_repo_head_hexsha": "279505d7270c3f796500f2cb992af1cd66dfb44c", "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.