text stringlengths 3.07k 22.1k |
|---|
import tensorflow as tf
from tensorflow.python import pywrap_tensorflow
from phi.flow import *
def conv_function(scope, constants_file=None):
if constants_file is not None:
reader = pywrap_tensorflow.NewCheckpointReader(constants_file)
def conv(n, filters, kernel_size, strides=[1,1,1,1], padding="... |
import os
from tempfile import mkstemp
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.shortcuts import redirect
from django.views.decorators.clic... |
"""<NAME> (GitHub: LCS18)"""
import torch
import random
from torchvision.transforms import functional as F
from bbox_util import *
# Custom transforms (adding transforms to the boxes)
class Compose(object):
def __init__(self, transforms):
self.transforms = transforms
def __call__(self, image, targ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) The James Hutton Institute 2017-2019
# (c) University of Strathclyde 2019-2020
# Author: <NAME>
#
# Contact:
# <EMAIL>
#
# <NAME>,
# Strathclyde Institute for Pharmacy and Biomedical Sciences,
# 161 Cathedral Street,
# Glasgow,
# G4 0RE
# Scotland,
# UK
#
# The MIT L... |
"""Create a matplotlib figure"""
from lcmap_tap.Plotting.plot_specs import PlotSpecs
from lcmap_tap.Plotting import plot_functions, NAMES, COLORS
from lcmap_tap.logger import log, exc_handler
import sys
import datetime as dt
from collections import OrderedDict
from typing import Tuple
import numpy as np
from numpy im... |
import os
import os.path
import csv
from optparse import OptionParser
class CmdArgsHandler:
def validate_args(self):
parser = OptionParser()
parser.add_option("-f", "--file", dest="csvloc",
help="Specify the location and filename of the CSV file.")
parser.add_opt... |
#!/usr/bin/env python
import time,os,re,csv,sys,uuid,joblib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn')
from sklearn.model_selection import learning_curve
from sklearn.model_selection import ShuffleSplit
from sklearn.preprocessing import StandardScaler
from sklearn.p... |
from core.fast_rect_collision import *
import random
class NaiveGroupCollide:
'''
Small class only written for test purposes, to compare with FastGroupCollide.
It is used to check if FastGroupCollide class (see below) behaves correctly
'''
def __init__(self,group,max_interv=None):
self.group = set(group)
def ... |
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
import sys
import os
from .venv import VirtualEnv
from .version import __version__
class InenvException(Exception):
pass
INI_NAME = 'inenv.ini'
VENV_DIR_NAME = '.inenv'
RECURSION_LIMIT = 100
EVAL_EXIT_CODE = 200
INENV_ENV... |
# Copyright (c) 2020 <NAME>, <NAME>
import os
import re
import pickle
import shutil
from shutil import copyfile
from typing import Callable, Any, List, Tuple, Type, Optional
import pandas as pd
from src.main.util.strings_util import contains_any_of_substrings
from src.main.util.consts import ACTIVITY_TRACKER_FILE_N... |
import os
from glob import glob
import numpy as np
from matplotlib import pyplot as plt
from P13pt.rfspectrum import Network
from PyQt5.QtCore import QSignalMapper, pyqtSignal, pyqtSlot, QTimer
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import (QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QLineEdit, QLabel,
... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from __future__ import print_function
from azureml._history.utils.log_scope import LogScope
import errno
import os
import six
im... |
from typing import Dict, Any, List, Union
from skdecide.builders.discrete_optimization.generic_tools.do_problem import Problem, TypeObjective, TypeAttribute, \
ObjectiveRegister, ObjectiveHandling, EncodingRegister, Solution, ModeOptim
from copy import deepcopy
from abc import abstractmethod
import math
import nump... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.weight_norm import weight_norm
import math, copy, time
from torch.autograd import Variable
from model.modules import *
import pdb
class Encoder(nn.Module):
def __init__(self, size, nb_layers):
super(E... |
#!/usr/bin/env python3
import time
import os
def initialyse():
"""
Function that stops any running docker containers, rebuilds the image from the docker file, creates a local volume and runs the benchmark-container in detached mode. Sets sysctl settings in order to run the benchmarks.
"""
# Start docker deamon.... |
# -*- coding: utf-8 -*-
# MLToolkit (mltoolkit)
__name__="mltk"
"""
MLToolkit - a verstile helping library for machine learning
===========================================================
'MLToolkit' is a Python package providing a set of user-friendly functions to
help building machine learning models in d... |
#! /usr/bin/env python
#
"""
This routine allows one to read in a Vizer SED service output .vot file.
Routines defined:
arc_distance calculate the arc-distance between two sky positions given
in degrees (nominally RA and Dec)
get_reference_position determine reference position for a Vizier tab... |
"""py.test plugin to test with flake8."""
import fnmatch
import logging
import os
import re
from collections import namedtuple
from contextlib import redirect_stderr, redirect_stdout
from io import BytesIO, TextIOWrapper
from pathlib import Path
from typing import List
import flake8.main.application
import flake8.op... |
#Copyright (C) 2013 by <NAME>
#
#Released under the MIT license, see LICENSE.txt
'''Gene Usage Distribution
V, J, D, VJ, VDJ
ttests
'''
import os
import sys
import gzip
import cPickle as pickle
from optparse import OptionGroup
import numpy as np
import mdp
from jobTree.scriptTree.target import Target
from sonLib.bio... |
#!/usr/bin/env python
"""
(C) Copyright 2017 Nuxeo (http://nuxeo.com/) and others.
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... |
# Copyright 2018 Stanford University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
"""
SPIB: A deep learning-based framework to learn RCs
from MD trajectories. Code maintained by Dedi.
Read and cite the following when using this method:
https://aip.scitation.org/doi/abs/10.1063/5.0038198
"""
import torch
import numpy as np
import time
import os
# Data Processing
# --------------------... |
#!/usr/bin/env python
#
# Copyright 2016, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""Test the vtgate master buffer.
During a master failover, vtgate should automatically buffer (stall) requests
for a configured time and ret... |
"""Matches."""
import asyncio
from aocrecs.cache import cached, dataloader_cached
from aocrecs.util import by_key, compound_where
@cached(ttl=None)
async def get_chat(database, match_id):
"""Get match chat."""
query = """
select name, player_number, message, origination, audience, timestamp, color_id... |
import tensorflow as tf
import tensorflow.contrib as tf_contrib
# Xavier : tf_contrib.layers.xavier_initializer()
# He : tf_contrib.layers.variance_scaling_initializer()
# Normal : tf.random_normal_initializer(mean=0.0, stddev=0.02)
# l2_decay : tf_contrib.layers.l2_regularizer(0.0001)
weight_init = tf_contrib.layer... |
#
# Copyright (c) 2019 <NAME> <<EMAIL>>
#
# See the file LICENSE for your rights.
#
"""
Utilities for retrieving and processing ERA5 reanalysis data using XArray.
"""
import os
import warnings
import itertools as it
import numpy as np
import netCDF4 as nc
import pandas as pd
import xarray as xr
from datetime import d... |
#!/usr/bin/env python
"""Generate kmer counts from a methyl bed file given a reference"""
########################################################################
# File: methyl_bed_kmer_analysis.py
# executable: methyl_bed_kmer_analysis.py
#
# Author: <NAME>
# History: 06/02/19 Created
###############################... |
"""
This module provides various methods for cleaning data that has been imported into MAST-ML, prior to model fitting.
DataCleaning:
Class that enables easy use of various data cleaning methods, such as removal of missing values, different
modes of data imputation, or using principal componenet analysis to fi... |
from django.shortcuts import render
from django.http import HttpResponseRedirect
import boto3
from boto3.dynamodb.conditions import Key, Attr
import json
from django import forms
from datetime import datetime
dynamodb = boto3.resource('dynamodb')
#Creating class for passing the problem
class assignEmployee:
de... |
from skimage import io
import os
import numpy as np
DEBUG = 0
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
if DEBUG:
print(BASE_DIR)
PICS_DIR = os.path.join(BASE_DIR,"..\\pics\\test_match")
if DEBUG:
print(PICS_DIR)
GREY = [247, 247, 247]
GREEN = [148, 211, 77]
WHITE = [255, 255, 255]
vertex_top = 12... |
"""Run tests in the farm subdirectory. Designed for nose."""
import difflib, filecmp, fnmatch, glob, os, re, shutil, sys
from nose.plugins.skip import SkipTest
from tests.backtest import run_command, execfile # pylint: disable=W0622
from coverage.control import _TEST_NAME_FILE
def test_farm(clean_only=False)... |
# note -- run in virtualenv w/ command: python scripts/export.py
import numpy as np
import pandas as pd
import myfitnesspal as pal
from scripts.spreadsheet import *
import fitbit as bit
import gather_keys_oauth2 as Oauth2
import datetime
import json
from scripts.dateUtils import *
from fitbit import exceptions
def mf... |
import numpy as np
import warnings
from sfsidb import constants
import glob
def deprecation(message):
warnings.warn(message, stacklevel=3)
def create_motion_name(test_name, sensor_code, code_suffix=""):
"""
Builds the full name of the file
:param test_name: str, test name
:param sensor_code: st... |
###############################################################################
# IODR_growth_rate
#
# <NAME> 5-19-2020
# Library for measuring growth rate from optical density data
#
# Notes on use:
# copied from IODR - LL1592 ethnol adaptation.ipynb notebook
# C:\Users\Dan\Documents\Lynd Lab research\Ctherm CBP proj... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import json
import platform
import warnings
try:
from setuptools import setup
from setuptools import Extension
from setuptools import find_packages
import setuptools
setuptools_version = setuptools.__version__.split('.')
if int... |
# search/models.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from ballot.models import BallotReturnedManager
from config.base import get_environment_variable
from candidate.models import CandidateCampaign
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiv... |
"""
Core function of `tcal` command
"""
from __future__ import print_function
import re
import sys
from calendar import Calendar, SUNDAY, MONDAY
from datetime import date
from os.path import expanduser
from sys import stdout, stderr
from . import CALRCS
from .cli import parser
from .render import TinyCalRenderer, C... |
"""
ProjetPythonFirstYear - Petit jeu de labyrinthe python/turtle
Auteur: <NAME>.
Date: 18/05/2021
Rôle : ReglesDuJeu est le sous programme qui s'occupe de tout ce qui concerne les règles du jeu, les évenements comme les objets et les
portes, ainsi que la victoire.
Entrée: Import du sous programme s'oc... |
import torch
import torch.nn as nn
import torchvision
import numpy as np
#from . import resnet, resnext, mobilenet, dpn, drn
from lib.nn import SynchronizedBatchNorm2d
import math
from collections import OrderedDict
'''
I have already implemented the classes SegmentationModuleBase,
SegmentationModule, and ModelBuilder... |
import math
from collections import OrderedDict
from typing import List, Optional, Tuple, TypedDict, Union
import torch
import torch.nn as nn
import torch.nn.init as init
from torch import Tensor
from torch.nn import Parameter
from firewood import utils
_NEED_RECURSIVE = {
"AdaptiveNorm",
"DepthSepConv1d",
... |
### multibeam.py - NCEI Multibeam
##
## Copyright (c) 2010 - 2022 Regents of the University of Colorado
##
## multibeam.py is part of CUDEM
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Soft... |
from dataclasses import dataclass
from myia.compile.backends.python.python import compile_graph
from myia.ir import manage
from myia.ir.utils import print_graph
from myia.operations import (
grad,
random_initialize,
random_uint32,
value_and_grad,
)
from myia.parser import parse
def _assert_match(expe... |
#!/usr/bin/env python3
import os
import stat
import sys
import argparse
import subprocess
import hashlib
import tempfile
import tarfile
class Image(object):
def __init__(self, image=None, root=None, files=None, tmp_dir=None):
super(Image, self).__init__()
self.image = image
self.root = roo... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as F
import math
from models.submodule import *
from models.inverse_warp import inverse_warp
import pdb
from lib.config import cfg, cfg_from_file, save_config_t... |
import datetime
# import pandas as pd
# import numpy as np
import json
import math
from dispatch import config
import numpy as np
def minutes_to_time_string(minutes):
if 0 < minutes < 24 * 60:
return ":".join(str(datetime.timedelta(minutes=minutes)).split(":")[0:2])
else:
return ":".join(str... |
# Copyright 2015, Avi Networks, Inc.
#
# 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 la... |
#!/usr/bin/env python
# coding: utf-8
# In[44]:
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from PIL import Image
from scipy import ndimage
get_ipython().run_line_magic('matplotlib', 'inline')
# In[81]:
#Dataset from https://www.kaggle.com/shaunthesheep/microsoft-catsvsdogs-datase... |
#Defines analyze of ast sentence functions
import ast
from exprs import expr_args, expr_call, expr_name
import os
import util
import datamgr
import libnames
def sent_import(sentence:ast.Import,f=""):
tmp=""
for a in sentence.names:
name=a.name
name=name.replace(".","/")
if os.path.exis... |
# -*- coding: utf-8 -*-
r"""
Created on Mon Aug 20 11:23:26 2018
@author: <NAME>, florian\obersteiner\\kit\edu
"""
import numpy as np
from numba import njit
from scipy.interpolate import interp1d
###############################################################################
def mask_repeated(a, N,... |
# searchtag.py
import re
import sqlalchemy as sa
from libweasyl import staff
from weasyl import define as d
from weasyl import files
from weasyl import ignoreuser
from weasyl import macro as m
from weasyl import orm
from weasyl import welcome
from weasyl.cache import region
from weasyl.error import WeasylError
_TA... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import time
import numpy as np
import py_gamma as pg
import atexit
import glob
import zipfile
import json
def myargsparse():
import argparse
thisprog=os.path.basename(sys.argv[0])
##########################################... |
from util import *
import atexit
import babydes as bd
import diffiehellman as dh
import hash as hsh
import numpy as np
import os
import rsa
import sys
import time
attributions = """
=============================================================================================
______ _ _ ___ _ ... |
import tensorflow as tf
import cv2
import numpy as np
import matplotlib.pyplot as plt
from ..utils import get_corners_in_world_coordinates
from ..utils import transform_points
from ..utils import transform_matrix
from ..utils import road_segment_color
CV2_SHIFT = 8
CV2_SHIFT_VALUE = 2 ** CV2_SHIFT
def rasterize(pars... |
import pytest
import datetime as dt
from opsy.auth.models import User
from opsy.inventory.models import Host, Group
###############################################################################
# OpsyQuery
###############################################################################
def test_opsy_query(test_user... |
import torch
import numpy as np
class AverageMeter:
"""
Computes and stores the average and current value
"""
def __init__(self):
self.reset()
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def reset(self):
self.val = 0
self.avg = 0
... |
# constants
import argparse
import datetime
import gzip
import json
import os
import numpy as np
import torch
from torch.utils.data import DataLoader, Dataset
from torch.utils.tensorboard import SummaryWriter
# d = torchtext.datasets.EnWik9(root='.dataenwik9', split=('train', ))
#
# exit()
parser = argparse.ArgumentP... |
"""Pylint plugin for py.test"""
from os import sep
from os.path import dirname
from os.path import exists
from os.path import join
import re
from six.moves.configparser import ( # pylint: disable=import-error
ConfigParser,
NoSectionError,
NoOptionError
)
from pylint import lint
from pylint.config import P... |
# 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... |
"""Class and function to convert SXS data to LVC-NR format"""
class SimulationConverter(object):
class Log(object):
"""Object to replace `log` function that used global `history`
Instead of using a global `history` variable, just create an instance of this
class, and pass it around to any ... |
import numpy as np
from ..basic import gamma, gammaRatio
def coeff(v, N=7, method='2'):
'''
Return the fractional coefficients.
Parameters
----------
v : float
Order of the diffinetration.
N : int, optional
Length of the corresponding coefficients. Default is 7.
method : s... |
'''
DLM Models and Relevant Functionality
'''
# Libraries
import numpy as np
import matplotlib.pyplot as plt
from numpy import pi, sin, cos
from scipy.linalg import block_diag
# Local Code
from Utilities import load_data, check_shape, check_square
from Matrix_Utilities import poly_mats, trig_mats, trig_inits
class R... |
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
#!/usr/bin/env python
# encoding: utf-8
"""
Plotting utilities for androcmd
"""
import string
import numpy as np
from palettable.cubehelix import perceptual_rainbow_16
from palettable.colorbrewer.diverging import RdBu_11
import matplotlib as mpl
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
NearestBuildingsToPoint
A QGIS plugin
This plug in plots buildings that are closest to a point within a given radius
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-P... |
#!/usr/bin/env python
"""
COSMO TECHNICAL TESTSUITE
General purpose script to compare two YUPRTEST output files
"""
# built-in modules
import os, sys, string
# information
__author__ = "<NAME>, <NAME>"
__email__ = "<EMAIL>"
__maintainer__ = "<EMAIL>"
def cmp_(file1,file2, \
v_level=0,minval=... |
"""
Car Rental Problem
Two renting car locations.
-If a customer comes and rents a car the reward is 10$.
-If he is out of cars the business is lost.
-Cars are avaliable a day after they are returned
-Number of requested cars ~ Poisson(3)
-Number of returned cars ~ Poisson(4)
-No more than... |
import pytest
import stk
from stko import GulpUFFOptimizer, ExpectedMetal
pd_metal = stk.BuildingBlock(
smiles='[Pd+2]',
functional_groups=(
stk.SingleAtom(stk.Pd(0, charge=2))
for i in range(4)
),
position_matrix=[[0, 0, 0]],
)
# Define a bidentate ligand with two functional groups.... |
import re
from functools import total_ordering
from typing import Dict, Any, Mapping, Optional, Union, List, TypedDict
from django.conf import settings
from lazy import lazy
from annotation.models import Citation, CitationSource
from classification.enums import SpecialEKeys, CriteriaEvaluation
from genes.hgvs import ... |
# this is for testing.py, do not import into other modules
from guillotina import configure
from guillotina import schema
from guillotina.async_util import IAsyncUtility
from guillotina.behaviors.instance import AnnotationBehavior
from guillotina.behaviors.instance import ContextBehavior
from guillotina.behaviors.prope... |
# Copyright 2021 Aix-Marseille Université
# "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. "
import numpy as np
import os
def remove_outlier(datas, p=3):
Q1, Q3 = np.quantile(datas, q=[0.25, 0.75], axis=1)
I... |
# -*- coding: utf-8 -*-
"""
A hamming-distance-based model for predicting long term rhythmic patterns
"""
from rhythm_hmm import Rhythm, makeRhythmSamples
import math
import numpy as np
from scipy.cluster.vq import vq, kmeans
from scipy.stats import binom
import pdb
class StructuredRhythm(Rhythm):
def __init_... |
# Copyright 2013-2021 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
####################################
# Driftwood 2D Game Dev. Suite #
# areamanager.py #
# Copyright 2014-2017 #
# <NAME> & <NAME> #
####################################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and... |
from builtins import range, str
import os
import itertools
import re
import glob
import json
from collections import OrderedDict
import numpy as np
import scipy as sp
import scipy.ndimage as nd
import scipy.optimize as opt
from peri import states
from peri.priors import overlap
from peri.util import Tile
from peri.c... |
# Copyright (c) OpenMMLab. All rights reserved.
import math
from typing import Iterator, Optional, Sequence
import torch
import torch.distributed as dist
from torch.utils.data import Dataset
from torch.utils.data import DistributedSampler as _DistributedSampler
from torch.utils.data import Sampler
from mmflow.core.ut... |
#! /usr/bin/env python3
#coding: utf8
# TODO Change this to a class (?)
#import lirc
#import time
import os
import sys
import spidev
from smbus2 import SMBus
#import config
import threading
from evdev import InputDevice, categorize, ecodes
import selectors
from threading import Thread, Event
import asyncio
from queue... |
import json
import logging
import re
import socket
import traceback
from datetime import datetime
from logging.handlers import SYSLOG_UDP_PORT, SysLogHandler
SYSLOG_LEVELS = {
logging.CRITICAL: 2,
logging.ERROR: 3,
logging.WARNING: 4,
logging.INFO: 6,
logging.DEBUG: 7,
}
# The following fields ar... |
"""
A more specific database helper for the 'users' database.
To generate the database, use db_generate.py; also, this
helper inherits functions from the DBHelper class.
(coded by lickorice, 2018)
"""
import sqlite3
from data import db_helper
from conf import DATABASE_PATH
# Level config
base_exp, factor = 50, 1.5
... |
"""
MIT License (MIT)
Copyright (c) 2021-Present L0RD-ZER0
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... |
import copy
import matplotlib.pyplot as plt
import numpy as np
import typing
import gobenchplot.benchmark as benchmark
import gobenchplot.inputs as inputs
BAR_TYPE = 'bar'
SCATTER_TYPE = 'scatter'
AVG_LINE_TYPE = 'avg_line'
BEST_FIT_LINE_TYPE = 'best_fit_line'
class PlotData(typing.NamedTuple):
x: np.ndarray
... |
"""inference script to support accuracy and performance benchmark"""
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you u... |
import numpy as np
import pytest
import theanets
import theano.tensor as TT
import util as u
NI = u.NUM_INPUTS
NH = u.NUM_HID1
class TestFeedforward:
@pytest.mark.parametrize('form, name, params, count, outputs', [
('feedforward', 'feedforward', 'w b', 1 + NI, 'out pre'),
('ff', 'feedforward', '... |
########################################################################
# Author(s): <NAME>, <NAME>
# Date: 21 September 2021
# Desc: Create PyTorch DataLoader for simulated measurements
########################################################################
import sys, os, csv
import matplotlib.py... |
import time
import sys
import feedparser
import config
#Constants
logo_print_speed = 0.002
# Helper Functions
def delay(t):
time.sleep(t)
# Print Functions
def delay_print(s,t=0.03):
for c in s:
sys.stdout.write('%s' % c)
sys.stdout.flush()
time.sleep(t)
sys.stdout.write('\n'... |
"""
Copyright 2016 <NAME>
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
httpwww.apache.orglicensesLICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
# Digital sand demo uses the accelerometer to move sand particiles in a
# realistic way. Tilt the board to see the sand grains tumble around and light
# up LEDs. Based on the code created by <NAME> and <NAME>, see:
# https://learn.adafruit.com/digital-sand-dotstar-circuitpython-edition/code
# https://learn.adafru... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""NuvlaBox Self Registration script
This script is part of the NuvlaBox industrialization process.
Given the right user credentials and NuvlaBox initialization attributes,
this script will automatically register a new NuvlaBox resource in Nuvla.
Arguments:
:param nuvl... |
#!/usr/bin/env python
'''
Copyright 2015 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
import os
import string
import pickle
import time
from typing import List
import numpy as np
from dsg.base import BasePreprocessor, BaseRNN
from dsg.layers import Glove6BEmbedding, FastTextEmbedding
import nltk
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import pandas as pd
from sklearn.me... |
import csv
import MySQLdb
import sys
from meta import FIELDNAMES
from MySQLResults import Results
class Results2011(Results):
questionIndex = {
'month': 3,
'year': 4,
'biosex': 5,
'gender': 6,
'orientation': 7,
'country': 8,
'state': 9,
'race_white'... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from django.db import models
from django.utils import timezone
from django.utils.safestring import mark_safe
try:
from django.urls import reverse
except ImportError:
# Pre Django 2.x
from django.core.urlresolvers import reverse
fr... |
import click
from democli.cli import pass_context
from democli.utils.click_util import common_options
from democli.utils.log_util import create_logger
from democli.auth.session_mgr import SessionMgr
from democli.workbook.workbook_mgr import WorkbookMgr
logger = create_logger(__name__)
# common options for sub command... |
# python depedencies
import socket
# third-paty dependencies
import dill
from .analyst import Command, Pointer
from .generic import Message
from .graph import Node
from .handler import QueryHandler
from .mpc import gen_shares
# lib dependencies
from .utils import log_message
class DataOwner:
"""DataOwner class... |
import datetime
from unittest import skipIf, skipUnless
from django.core import mail
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.encoding import force_str
from django.utils.translation import gettext as _
from django.forms.fields import Field
from django.conf im... |
# Memorization of two 50-bit binary patterns per episode, with LSTMs. Takes a very long time to learn the task, and even then imperfectly. 2050 neurons (fewer neurons = worse performance).
#
#
# Copyright (c) 2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... |
#!/usr/bin/python
# local
from unix_socket import UnixSocket
from logger import logger
sock_keyboard = UnixSocket("/tmp/evdev_keypress.sock", 100)
sock_gui = UnixSocket("/tmp/speech_gui.sock", 100)
modifiers = set()
hold_modifiers = False
pause_engine = False
confirm_function = None
# direct communicators
def send... |
#!/usr/bin/python
# Copyright: (c) 2021, <NAME> (@oukooveu)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
---
module: aws_msk_config
short_description: Manage Ama... |
# Copyright (c) 2020-2021 by Phase Advanced Sensor Systems Corp.
import threading
import errno
import usb
import usb.util
import btype
FC_FLAGS_VALID = (1 << 15)
FC_FLAG_NO_TEMP_PRESSURE = (1 << 4)
FC_FLAG_PRESSURE_FAILED = (1 << 3)
FC_FLAG_TEMP_FAILED = (1 << 2)
FC_FLAG_PRESSURE_UPDATE ... |
import os
import zipfile as zp
import pandas as pd
import numpy as np
import core
import requests
class Labels:
init_cols = [
'station_id', 'station_name', 'riv_or_lake', 'hydroy', 'hydrom', 'day',
'lvl', 'flow', 'temp', 'month']
trans_cols = [
'date', 'year', 'month', 'day', 'hydroy', 'hydrom', 'station_id'... |
#!/usr/bin/env python
# Copyright <NAME>, 2012, License: GPL-2.0
# Adaption and generalization for xdis use by <NAME>
# Dropbox Python bytecode decryption tool for Dropbox versions of 1.1x
# (and possibly earlier) which uses Python bytecode 2.5.
from __future__ import print_function
import types
import struct
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.