text stringlengths 6.04k 39.5k |
|---|
import gym, sys, time, os
sys.path.insert(0, '..')
from mpl_toolkits.mplot3d import Axes3D
import torch
import numpy as np
import math
import pdb
import glob
from irlmethods.deep_maxent import RewardNet
from irlmethods.irlUtils import calculate_expert_svf
from utils import reset_wrapper, step_wrapper
from matplotlib... |
#!/usr/bin/env python3.6
# HSX cog
# Yackback 2018-2019
import asyncio
import logging
import re
import time
import bs4
import discord
import requests
from redbot.core import checks, commands
from redbot.core.utils.chat_formatting import warning
from redbot.core import Config
dflt_guild = {
"runPosttrack": True,... |
"""
Data is taken from the Climate Reference Network. This is to expand validation
of the NOAA ARL model validation leveraging inhouse datasets.
Data available at https://www.ncdc.noaa.gov/crn/qcdatasets.html
Here we use the hourly data.
Field# Name Units
----------------... |
# -*- coding: utf-8 -*-
"""
A script to benchmark TEA.
@david angeles
<EMAIL>
"""
import tissue_enrichment_analysis as tea # the library to be used
import pandas as pd
import os
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import re
import matplotlib as mpl
sns.set_context('paper')
# pd... |
#
# images.py -- classes for images drawn on ginga canvases.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import time
import numpy as np
from ginga.canvas.CanvasObject import (CanvasObjectBase, _bool, _color,
Poin... |
from __future__ import division
import numpy as np
from keras.models import Sequential, Model, load_model
from keras.layers import Dense, Input, Concatenate,Reshape, Lambda, BatchNormalization
from keras.layers import LSTM, Conv1D, Flatten, Dropout, TimeDistributed, MaxPooling1D, Conv2D
from keras.layers.embeddings im... |
# -*- coding: utf-8 -*-
import random
from hypothesis import assume, example, given
import hypothesis.strategies as st
import pytest
from matchpy.expressions.expressions import Atom, Operation, Symbol, Wildcard, Pattern
from matchpy.matching.one_to_one import match
from matchpy.matching.syntactic import OPERATION_END... |
import re #regex
import os
from unidecode import unidecode #removes accented characters
from metaphone import doublemetaphone #converts a name into phonetics, allows for fuzzy name searching
student_List = [
("U1D40QFD4", "<NAME>"),
("U1HBKMW8Y", "<NAME>"),
("U1NCM4VME", "<NAME>"),
("U1T2Q3G81", "<NAME... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import time
try:
import frida
except ImportError:
sys.exit('install frida\nsudo pip3 install frida')
def sbyte2ubyte(byte):
return (byte % 256)
def print_result(message):
print ("[!] Received: [%s]" %(message))
def on_message(message, data):
... |
import argparse
import os
import numpy as np
from tqdm import tqdm
import torch
from utils.parallel import DataParallelModel, DataParallelCriterion
from apex import amp
from apex.parallel import DistributedDataParallel
from dataloaders import make_data_loader
from utils.loss import SegmentationLosses, SegmentationCELos... |
import hashlib
import math
import random
from abc import ABC
from pathlib import Path
from tqdm import tqdm
import torch
from torch.utils.data import Dataset, DataLoader
import glob
import os
from PIL import Image
import numpy as np
import cv2.cv2 as cv2
img_formats = ['bmp', 'jpg', 'jpeg', 'png', 'tif',... |
import os, glob, pickle, sys
import numpy as np
np.set_printoptions(precision=3, suppress=True)
import pandas as pd
from scipy.stats import sem, mannwhitneyu, kruskal
import statsmodels.stats.api as sms
import matplotlib.pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.patches import Re... |
"""
auther: leechh
Template:
class LayerName(Layer):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def build(self, input_shape):
super().build(input_shape)
def call(self, inputs, **kwargs):
return None
def get_config(self):
config = super().get_config()
... |
import re
import yaml
import csv
import requests
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.db.models import Count, Q, Model
from django.shortcuts import redirect, render, get_object_or_404
from d... |
# coding=utf-8
from config import *
import json
import pandas as pd
import numpy as np
import multiprocessing as mp
from functools import partial
from graph_tool.all import *
from ccig import *
from sentence_score import *
from sentence_pair_score import *
from bm25 import *
LANGUAGE = "Chinese"
W2V_VOCAB = load_W2V_... |
#!/usr/bin/env python
# we're using python 3.x style print but want it to work in python 2.x,
from __future__ import print_function
import os
import argparse
import sys
import warnings
import copy
import imp
import ast
import scipy.signal as signal
import numpy as np
nodes = imp.load_source('', 'steps/nnet3/component... |
"""All known response messages to be received from plugwise devices."""
from datetime import datetime
from ..constants import MESSAGE_FOOTER, MESSAGE_HEADER, MESSAGE_LARGE, MESSAGE_SMALL
from ..exceptions import (
InvalidMessageChecksum,
InvalidMessageFooter,
InvalidMessageHeader,
InvalidMessageLength,... |
# https://www.tensorflow.org/tutorials/structured_data/time_series
import os
import datetime
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
mpl.rcParams['figure.figsize'] = (8, 6)
mpl.rcParams['axes.grid'] = False
zip_path = tf.keras.utils.ge... |
# -*- coding: utf-8 -*-
# dicomreport.py
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import time
import os
import shutil
import json
import csv
import multiprocessing as mp
from multiprocessing imp... |
# -*- coding: utf-8 -*-
from xml.etree import ElementTree
import datetime
import logging
from pathlib import Path
from olefile import OleFileIO, isOleFile
import numpy as np
import tifffile as tf
from oxdls import OMEXML, DO_XYZCT, PT_UINT16, PT_UINT16, PT_FLOAT, PT_DOUBLE
from . import txrm_wrapper
from .annotator ... |
"""
Wrapper to the C program 'match_positions' from <NAME>.
"""
import os
import numpy as np
import subprocess
import shutil
import tempfile
from astropy.table import Table
from desimeter.io import load_metrology,fvc2fp_filename
from desimeter.transform.fvc2fp import FVC2FP
def _compute_pixel_scale(fvc2fp) :
... |
"""
This file contains a Trainer class which handles the training and evaluation of MTTR.
"""
import math
import sys
import os
from os import path
import shutil
import random
import numpy as np
import wandb
import torch
from torch.nn.parallel import DistributedDataParallel as DDP
import torch.distributed as dist
import... |
import keras
import tensorflow as tf
import numpy as np
import menpo.io as mio
import menpo
from scipy.interpolate import interp1d
import scipy as sp
from keras import backend as K
from matplotlib import pyplot as plt
from pathlib import Path
from scipy.io import loadmat
from menpo.image import Image
from menpo.shape i... |
from math import sqrt
from .util import format_number
from .vector3 import Vector3
class Vector4(object):
__slots__ = ('_v',)
_gameobjects_vector = 4
def __init__(self, *args):
"""Creates a Vector4 from 4 numeric values or a list-like object
containing at least 3 values. No... |
from pathlib import Path
from shutil import rmtree
from numpy import arange, array, ceil, floor, histogram, max, sqrt, zeros
from scipy.stats import norm, linregress
from subprocess import run
import plotly.graph_objects as go
from ..parameters import FINGER_COLOR, FINGERS_OPEN, FINGERS_CLOSED, FINGERS_EXTENSION, FING... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with th... |
## GYM imports
import gym
from gym import error, spaces, utils
from gym.utils import seeding
## Numpy/Scipy imports
import numpy as np
from scipy.integrate import solve_ivp
from numpy import sin, cos, tanh, arcsin
from scipy.spatial.transform import Rotation
from numpy.linalg import norm, inv
## Constants
DEG2RAD = n... |
"""
Plotting functions using matplotlib
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import art3d
import colorsys
def plot_warped_grid_2d(f, mins, maxes, grid_res=None, color = 'gray', flipax = True, draw=True):
xmin, ymin = mins
xmax, ymax = maxes
ncoa... |
import os
import numpy as np
import soundfile as sf
import glob
import librosa
from urllib.request import urlretrieve
EPS = np.finfo(float).eps
COEFS_SIG = np.array([9.651228012789436761e-01, 6.592637550310214145e-01,
7.572372955623894730e-02])
COEFS_BAK = np.array([-3.733460011101781717e+00,2.7... |
#ライブラリ
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import random
import itertools
from collections import defaultdict
import sys
from tqdm import tqdm
import time
import doctest
import copy
#Node Class
#information set node class definition
class Node:
#Kuhn_node_definitions
def __ini... |
"""
ReasoNet model in CNTK
@ref ReasoNet: Learning to Stop Reading in Machine Comprehension, https://posenhuang.github.io/papers/reasonet_iclr_2017.pdf
@author <EMAIL>
"""
import sys
from cntk.io import MinibatchSource, CTFDeserializer, StreamDef, StreamDefs
import cntk.ops as ops
from cntk.layers.blocks import _INFE... |
"""Welcome to ortografix.
This is the entry point of the application.
"""
import os
import argparse
import random
import time
import statistics
import logging
import logging.config
import textdistance
import torch
from torch import optim
import ortografix.utils.config as cutils
import ortografix.utils.constants as ... |
import argparse
import h5py
import imageio
import numpy as np
import skimage.transform
import time
import torch
import torch.nn.functional as torchfunc
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
import _init_paths
import utils.assocembedutil as aeutil
from config import cfg
from ... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
# cx_freeze build script
# Written for cx-Freeze==5.0
# Outputs by default to build\exe.win32-3.6\
# Modify path_platforms as required
# Usage:
# build_observer.py --mode ifqadmin
# PYTHON 3.6 build requires patch to freezer.py
# comment out lines 626-7
# C:\ ... \virtualenv\optecs-python36\Lib\site-packages\cx_Free... |
"""Construction of the master pipeline.
"""
from typing import Dict
from kedro.pipeline import Pipeline, node
from ffsc.pipeline.nodes.preprocess import (
preprocess_shippingroutes,
preprocess_ports,
preprocess_pipelines,
preprocess_coalmines,
preprocess_oilfields,
preprocess_lngterminals,
... |
''' COSMO-VIEW,
<NAME>, May 2017
Geomarker class and functions
EGL, 06/2020:
A heap variable MESSAGE has been introduce to store "print" messages
'''
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from tkinter import filedialog
import matplotlib.pyplot as plt
import n... |
#!/usr/bin/env python3
# Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
impo... |
#!/usr/bin/env python3
import copy
from typing import Tuple
import cv2
import gym
import numpy as np
import robo_gym_server_modules.robot_server.client as rs_client
import rospy
import tf2_ros
from robo_gym.envs.simulation_wrapper import Simulation
from robo_gym.envs.ur.ur_shelf_env import URBaseEnv
from robo_gym.util... |
"""
Ce programme a été entièrement développé par <NAME> dans le cadre d'un projet de fin de semestre.
Date de rendu de ce projet : 20/01/2021
"""
from tkinter import *
import smtplib
import os
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import eel
import threading
impo... |
import main
import re
import discord
import mimetypes
import requests
import asyncio
from discord.ext import commands
from cogs.help import Help
def staffr_check(self, mmember):
for x in [main.ids(8), main.ids(10), main.ids(7), main.ids(9), main.ids(6)]:
if self.bot.get_guild(main.ids(1)).get_role(x) in s... |
import discord
from discord.ext import commands
import logging; log = logging.getLogger()
from toolbox import S as Object
from typing import Union
import itertools
from . import AutoModPlugin
from ..types import Embed, Duration
LOG_OPTIONS = {
"mod": {
"db_field": "mod_log",
"i18n_type": "moder... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 7 15:19:27 2020
utilities
@author: Merten
"""
import pandas as pd
import numpy as np
import os
import scipy.interpolate as scpinter
from matplotlib import pyplot as plt
from sklearn.utils import shuffle
from sklearn.model_selection import StratifiedKFold
from sklearn.mo... |
from collections import deque
from copy import deepcopy
import numpy as np
import keras.backend as K
from keras.layers import Lambda, Input, merge
from keras.models import Model
from rl.core import Agent
from rl.policy import EpsGreedyQPolicy
from rl.util import *
def mean_q(y_true, y_pred):
return K.mean(K.max... |
#!/usr/bin/env python
"""
Collection of functions to transform audio signals : Take the envelope
"""
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: New BSD License
# =============================================================================
# Load the modules
# ===============... |
import math
import torch.autograd as autograd
import copy
import json
import pickle
import random
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from deep_dialog import dialog_config
from .agent import Agent
from .replay_buffer import ReplayBuffer
USE... |
#
# script for running SRW to create a SHADOW source
#
import json
import numpy
import srwlib as sl
import array
import sys
from scipy import interpolate
def ElectronBeam(x=0., y=0., z=0., xp=0., yp=0., e=6.04, Iavg=0.2, sigX=345e-6*1.e-20, sigY=23e-6*1.e-20, mixX=0.0, mixY=0.0, sigXp=4.e-9*1.e-20/345e-6, sigYp=4.e-11... |
import nussl
import json
import os
import constants
import numpy as np
from torch.utils.data import IterableDataset
import warnings
from torch.utils.data import Dataset
from nussl.core import AudioSignal
import transforms as tfm
import tqdm
class BaseDataset(Dataset):
"""
The BaseDataset class is the start... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Distributed under the terms of the MIT License.
"""
Functions for I/O of BRENDA DB.
Author: <NAME>
Date Created: 24 Apr 2018
"""
from ercollect import rxn_syst
import os
from ercollect import DB_functions
from ercollect import CHEBI_IO
from ercollect import PUBCHEM_... |
import pandas as pd
import re
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from sklearn.metrics.pairwise import cosine_similarity
df = pd.read_csv("amazon_data.csv")
df_cleaned = df.drop( axis=0, columns= ['bestsellers_rank_main_name', 'bestsellers_rank_main_rank', 'bestsellers_rank_sub_0_name'... |
################################################################################
## Toolbox: Transit Network Analysis Tools
## Tool name: Calculate Accessibility Matrix
## Created by: <NAME>, Esri
## Last updated: 17 June 2019
################################################################################
'''Count the... |
import math
# Static Bodies - X position, Y position, Width, Height, Surface Friction
class StaticBody():
def __init__(self, x_pos, y_pos, width, height, material):
self.x_pos = x_pos
self.y_pos = y_pos
self.width = width
self.height = height
self.material_type = material[0]
self.color = material[1]
s... |
#!/usr/bin/python
# (c) 2020, NetApp, Inc
# 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 = """
---
module: na_santricity_asup
short_description: NetApp E-Series manage aut... |
'''
Train a siamese convolution neural network on trios of digits from the MNIST dataset.
This code was adapted by Small Yellow Duck (https://github.com/small-yellow-duck/) from
https://github.com/fchollet/keras/blob/master/examples/mnist_siamese_graph.py
The similarity between two images is calculated as per Hadsel... |
# original code: https://github.com/dyhan0920/PyramidNet-PyTorch/blob/master/train.py
import argparse
import time
import os
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transforms
import to... |
import os
import torch
from scipy import io
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from sklearn.metrics import confusion_matrix
import numpy as np
import math
import argparse
import network.cnn as CNN
import network.lstm as LSTM
import ... |
"""
2D Matrix abstraction around `spixel.pixels` and helper functions.
"""
import math
from . import colors
from . import font
from . pixels import Pixels
def rotate_and_flip(coord_map, rotation, flip):
rotation = (-rotation % 360) // 90
for _ in range(rotation):
coord_map = list(zip(*coord_map[::-1]... |
# add parent dir to find package. Only needed for source code build, pip install doesn't need it.
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
os.sys.path.insert(0, parentdir)
import gym
import logging
import ran... |
# This mapping is the reverse of the mapping below: It maps 2x2 grids to states.
PREV_STATEMAP = {
# For example, this pre-image grid maps to a state of 0:
# 0 0
# 0 0
((0, 0), (0, 0)): 0,
# And this grid maps to 1.
# 0 0
# 0 1
((0, 0), (0, 1)): 1,
((0, 0), (1, 0)): 1,
((... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Easily define U-net-like architectures using Keras layers
"""
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers as L
from . import losses
def insert_activation(tensor_in, activation):
"""
:return: tensor of rank 4 (batch_siz... |
"""ResNet and BagNet implementations.
original codes
- https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py
- https://github.com/wielandbrendel/bag-of-local-features-models/blob/master/bagnets/pytorchnet.py
"""
import torch
import torch.nn as nn
import math
from torch.utils.model_zoo import load_u... |
#! /usr/bin/env python3
# Using the Slack API:
# (1) Get recent history of a specified input channel.
# (2) For each known user, note if user posted any message to the channel.
# (3) Post a report to stdout (or to a specified output slack channel,
# calling out the inactive users.
#
# Usage: python3 standup_snitch.... |
import autocomplete_light
import datetime
import sys
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.core.urlresolvers import reverse_lazy
from django.forms.fields import ChoiceField
from django.forms.models import ModelChoiceIterator
from django.forms.extras.widgets import Sel... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.optim as optim
import numpy as np
from tqdm import tqdm
from .model import gen_model_dir
import os
from functools import partial
from collections import deque, defaultdict
from torch... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchdiffeq import odeint_adjoint as odeint
import numpy as np
from lib.constants import CARDINALITY
from scipy.stats import entropy
from scipy.special import entr
from tqdm import tqdm
import torchvision.models as tv
import os
class BasicBlock(n... |
# Copyright(c) <NAME> 2009 <EMAIL>
# http://vosolok2008.narod.ru
# BSD license
__version__ = '0.2'
__versionTime__ = '2013-01-22'
__author__ = '<NAME> <<EMAIL>>'
__doc__ = '''
pybassasio.py - is ctypes python module for BASSASIO (http://www.un4seen.com).
BASSASIO is basically a wrapper for ASIO drivers, wit... |
from typing import Tuple
import json
import os
from os.path import exists as _exists
import shutil
import math
from uuid import uuid4
# noinspection PyPep8Naming
import xml.etree.ElementTree as ET
from subprocess import Popen, PIPE
import utm
import numpy as np
from osgeo import gdal, osr, ogr
from ..all_your_base... |
# -*- coding: utf-8 -*-
"""
Spyderエディタ
これは一時的なスクリプトファイルです
"""
import datetime
import pandas as pd
import math
import numpy as np
from scipy import optimize
from dateutil.relativedelta import relativedelta
def fwrd(df_s, df_e, strt, end):
return (df_s / df_e -1) * 360 / (end - strt)
Capital = 1... |
# RT - Level
from __future__ import annotations
from dataclasses import dataclass
from discord.ext import commands, tasks
import discord
from core import Cog, RT, t, DatabaseManager, cursor
from rtlib.common.cacher import Cacher
from data import (
ROLE_NOTFOUND, FORBIDDEN, SET_ALIASES, DELETE_ALIASES,
LIS... |
"""
transformation.models
Shipyard data models relating to the (abstract) definition of
Transformation.
"""
from __future__ import unicode_literals
from django.db import models
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.core.validators import MinValueValidator, MaxValueValidato... |
from __future__ import division
from pdfminer.layout import LAParams
import pandas as pd
from pdfminer.pdfpage import PDFTextExtractionNotAllowed
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfinterp import PDFPageInterpreter
from pdfminer.layout import LAParams
from pdfminer.converter import... |
#AUTHOR : <NAME>
#MATRICULATION NUMBER : 65074
#Personal Programming Project
#-------------------------------------------------------------------------------------------#
#GEOMETRY - Python file used to generate geometry parameter require to build element routine
#-------------------------------------------------------... |
# -*- coding: utf-8 -*-
# D2LValence package, auth module.
#
# Copyright (c) 2012-2016 Desire2Learn 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... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""---------------------------------------------------------------------------------*
* Copyright (c) 2010-2018 <NAME>, <NAME>, <NAME>, *
* <NAME>, <NAME>, <NAME> *
* ... |
BLACK = "BLACK"
WHITE = "WHITE"
class Move:
def __init__(self, player: str = WHITE, x: int = 0, y: int = 0):
self.x = x
self.y = y
self.player = player
self.score = 0
self.score_depth = 0
self.board = None
def __repr__(self):
return 'Move(%s, %r, %r)'... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import datetime
from time import mktime
import random
from pytimeparse.timeparse import timeparse
import parsedatetime
import calendar_events
import strings
import util
from zulip_users import ZulipUsers
class RSVPMessage(object):
"""Class ... |
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
import numpy as np
import urllib.request
import gzip
import sys
_FACTORIES = {}
def load_dataset(datasetname):
"""Load or generate a data set given its name.
If the name is unknown then it interprets it as a path to a data
file. The file should be a text file with one vector per row and
with eleme... |
"""The code for the worker thread.
Based on: https://github.com/pytorch/examples/tree/master/mnist_hogwild
See main.py for list of modifications"""
import os
import logging
import csv
import pickle
import random
import sys
import math
from time import sleep
import numpy as np
from tqdm import tqdm
import torch # py... |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 16 19:49:51 2020
@author: Medha and Jan
This module contains functions to create a list of all possible actions.
Each action corresponds to a specific configuration of a specific substation.
An action is given by a dictionary {"set_bus" : substation_config} where
substa... |
from typing import Callable, List
import numpy as np
from qcodes.instrument.base import Instrument
from qcodes.instrument.parameter import Parameter
from qcodes.instrument.channel import InstrumentChannel, ChannelList
from qcodes.utils import validators as vals
from .SD_Module import SD_Module, keysightSD1, Signadyne... |
from sistrum import ExtronDevice
from sistrum import PartNumber, SwitcherMode, InputVideoFormat
from sistrum.exceptions import InvalidInputNumberError, InvalidParameterError
from tests.protocol_simdev import simulator_classes, SimulatedDevice
import pytest # type: ignore
import logging
import re
import time
class Si... |
"""
Datapane Reports Object
Describes the `Report` object and included APIs for saving and uploading them.
"""
import dataclasses as dc
import random
import typing as t
import webbrowser
from base64 import b64encode
from enum import Enum, IntEnum
from functools import reduce
from os import path as osp
from pathlib imp... |
import pandas as pd
from astrodbkit2.astrodb import create_database
from astrodbkit2.astrodb import Database
from scripts.ingests.utils import *
from simple.schema import *
from pathlib import Path
# sys.path.append('.')
SAVE_DB = True # save the data files in addition to modifying the .db file
RECREATE_DB = False ... |
from itertools import combinations, combinations_with_replacement
from typing import Union, Optional, Sequence, overload
import networkx
import numpy as np
import scipy.stats as stats
from matplotlib import pyplot as plt
from matplotlib import ticker
@overload
def critical_difference_diagram(
data: np.ndarray,
... |
# Copyright 2021, <NAME>.
#
# Developed as a thesis project at the TORSEC research group of the Polytechnic of Turin (Italy) under the supervision
# of professor <NAME> and engineer <NAME> and with the support of engineer <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this f... |
# -*- coding: utf-8 -*-
# Copyright 2018 Etsy 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... |
from libqtile import bar, layout, widget, hook
from libqtile.config import Group, Key, Match, Screen, KeyChord
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
#from typing import List
import os, subprocess, shlex, re, time, pyautogui
import pandas as pd
# pymotion requriement: pyglet rpyc argpa... |
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: LicenseRef-.amazon.com.-AmznSL-1.0
# Licensed under the Amazon Software License http://aws.amazon.com/asl/
import csv
import json
import logging
import os
import re
import time
import shutil
from datetime import datet... |
import numpy as np
import imageio
import os
import pandas as pd
from glob import glob
import matplotlib.pyplot as plt
from brainio_base.stimuli import StimulusSet
class Stimulus:
def __init__(self, size_px=[448, 448], bit_depth=8,
stim_id=1000, save_dir='images', type_name='stimulus',
... |
# --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import os
import time
import random
import argparse
import datetime
impo... |
import math
import cupy
import numpy as np
import chainer
from chainermn.communicators import _communication_utility
from chainermn.communicators import _memory_utility
from chainermn import nccl
from chainerkfac.communicators import _utility
from chainerkfac.communicators import base
class PureNcclCommunicator(b... |
#!/usr/bin/env python
"""This script estimates :term:`P-site offsets <P-site offset>`, stratified by read length,
in a :term:`ribosome profiling` dataset. To do so, read alignments are mapped to
their fiveprime ends, and a :term:`metagene` profile surrounding the start
codon is calculated separately for each read leng... |
# Copyright (C) 2020 Alibaba Group Holding Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""
Various functions to interface with the terminal, using ANSI sequences.
Credits:
- https://wiki.bash-hackers.org/scripting/terminalcodes
- https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
"""
# The entirety of Terminal will soon be moved over to a new submodule, so
# this ignore is temporary.
# pyli... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
espider.spider
------------------------------------------------------------
This file is used to scrab objective url and save as file
Also provides class that manipulate UrlQuery spider.
:Copyright (c) 2016 MeteorKepler
:license: MIT, see LIC... |
#!/usr/bin/env python
# coding: utf-8
# # Interacting with CLIP
#
# This is a self-contained notebook that shows how to download and run CLIP models, calculate the similarity between arbitrary image and text inputs, and perform zero-shot image classifications.
# # Preparation for Colab
#
# Make sure you're running ... |
# blood slide prevalence plot
from .plot_basics import * # import packages
# Saved for MSC TV
#fig_size = (6,3)
fig_size = (15,8)
def _bsp_plot(df, locator=60):
fig, ax = plt.subplots(figsize=fig_size)
ax.grid(True, alpha=0.3)
df['bsp_in_popu'] = df['blood_slide_prev'] * 50000 / 100
df['time_in_yrs'] = df['... |
# -*- coding=utf-8 -*-
"""Movement.py covers key-value pairs in bearlibterminal associated with
movement actions. Key constants are seperated into two lists to differentiate
between arrow and numpad keys. The key-value pair matches a bearlibterminal
key to a two element tuple determining x, y directions
Movemen... |
#!/usr/bin/env python
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>, based on code from <NAME>
# --------------------------------------------------------
"""
Demo script showing detections in sample i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.