text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 17 14:14:53 2019
@author: vonGostev
Epsilon-constraint algorithm with arbitrary number of variables
<NAME>., & <NAME>. (2014).
A new algorithm for generating all nondominated solutions
of multiobjective discrete optimization problems.
European Journal of Operational Res... |
#!/usr/bin/env python3
"""
project: https://github.com/think3t/godzilla_decoder
author: think3t
usage:
mitmweb -s godzilla_decoder.py [-p 9090] [--set pas=SHELL_PASS] [--set key=SHELL_KEY] [--set charset=gb2312]
optional arguments:
--set help show this help message and exit
-p PORT, --listen-p... |
from __future__ import division
import numpy as np
from numpy import log10
from scipy.interpolate import PchipInterpolator as interp1d
def seismic(f, ifo):
"""Seismic noise.
"""
return seismicAll(f, ifo)[0]
def seismicAll(f, ifo):
"""Seismic noise.
Return (noise, noise_vertical, noise_horizonta... |
# Credit: This file is originally written by <NAME>, modified by <NAME>
import os
import json
import numpy as np
current_path = os.path.dirname(os.path.realpath(__file__))
root_folder = os.path.join(current_path, '../script/dataset/partnet_segmentation')
convert_tfrecords = os.path.join(current_path, '../util/convert... |
# coding: utf-8
"""
:copyright: 2017-2018 H2O.ai, Inc.
:license: Apache License Version 2.0 (see LICENSE for details)
"""
# # Experiment 01: Airline dataset (GPU version)
#
# In this experiment we use [the airline dataset](http://kt.ijs.si/elena_ikonomovska/data.html) to predict arrival delay. The dataset consists o... |
"""
Author: <NAME>
PyTorch implementation of the PointCNN paper, as specified in:
https://arxiv.org/pdf/1801.07791.pdf
Original paper by: <NAME>, <NAME>, <NAME>, <NAME>
"""
import os, sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
# External Modules
import torch
import torch.nn ... |
import string
import threading
import librosa
import numpy as np
import scipy
from numpy.fft import rfft, irfft
from scipy import signal
from scipy.io.wavfile import write as wav_write
from fgnt.utils import segment_axis
def _samples_to_stft_frames(samples, size, shift):
"""
Calculates STFT frames from samp... |
'''
MIT License
Copyright (c) 2017-2018 Cree-Py
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, modify, merge, publish, ... |
from evaluation.inception import InceptionScore
import re
import cv2
import numpy as np
import pandas as pd
import matplotlib
from sg2im.data import deprocess_batch, imagenet_deprocess
from sg2im.data.utils import decode_image
matplotlib.use('Agg')
from sg2im.meta_models import MetaGeneratorModel
import argparse, os
im... |
#! /usr/bin/env python3
"""
Allow the user to track where they went to lunch.
"""
import shelve
import os
from operator import itemgetter
print(" Starting lunch traker")
"""
Opening Save File
"""
print(" Opening storage")
days = {0:"Monday", 1:"Tuesday", 2:"Wednesday", 3:"Thursday", 4:"Friday"}
storage = shelve.open("... |
import sys
from pathlib import Path
from typing import Union
import logging
import pandas as pd
from cascade_at.context.model_context import Context
from cascade_at.core.log import get_loggers, LEVELS
from cascade_at.dismod.api.dismod_io import DismodIO
from cascade_at.dismod.api.multithreading import _DismodThread, ... |
"""A test suite for solverwrappers that implement solve methods for
canonical linear constraints. Wrapppers considered include:
'cvxpy', 'qpOASES', "ecos", 'hotqpOASES', 'seidel'.
"""
import pytest
import numpy as np
import numpy.testing as npt
import toppra
import toppra.constraint as constraint
import cvxpy
from ..... |
#!/usr/bin/env python3
import json
import logging
import os
import pytz
import requests
import sys
import urllib.request, urllib.parse, urllib.error
import time
if os.path.dirname(__file__) == "matrixbot/plugins":
sys.path.append(os.path.abspath("."))
from matrixbot import utils
pp, puts, set_property = utils.p... |
import warnings
import os
import functools
import pandas as pd
import numpy as np
from tqdm import tqdm
from sklearn.utils.validation import check_array
import enricher.regulon.regulon_enrichment as regulon_enrichment
import enricher.features.expression_utils as expression_utils
import enricher.regulon.regulon_utils a... |
"""Functions to prepare and run beamformers.
AUTHOR: <NAME> <britta.wstnr[at]gmail.com>
"""
import mne
import numpy as np
from mne.beamformer import make_lcmv, apply_lcmv, apply_lcmv_epochs
from matrix_transforms import get_coord_from_peak, get_distance
def compute_grid(subject, subjects_dir, bem_name, t1_fname=None... |
#! /usr/bin/env python3
import argparse
import io
import os
import re
import shutil
import struct
import subprocess
import sys
import tempfile
from textwrap import dedent
class ShaderCompileError(RuntimeError):
def __init__(self, *args):
super(ShaderCompileError, self).__init__(*args)
class Shader:
d... |
from django.views.generic import TemplateView, FormView, View
from django.http import JsonResponse, HttpResponseRedirect
from django.core.cache import cache
from django.template.response import TemplateResponse
from django.views.generic.detail import SingleObjectMixin
from django.urls import reverse_lazy, reverse
from ... |
# Copyright 2019 Intel Corporation
#
# 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 wri... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
from collections import namedtuple
from jinja2 import Environment
from jinja2 import FileSystemLoader
from psycopg2.extras import RealDictCursor
from tilequeue.query import DBConnectionPool
from tilequeue.transform import calculate_padded_bounds
import sys
TemplateSpec = namedtuple('TemplateSpec', 'template start_zoo... |
import sqlite3
from aiogram import Dispatcher, types, Bot
from aiogram.dispatcher.filters.state import State, StatesGroup
from aiogram.utils.exceptions import MessageNotModified
from app.config_reader import load_config
from app.keyboards import DAYS_keyboard
from app.localization import lang
from app.utc_ti... |
from caffe import layers as L
from caffe import params as P
from ssd_config import config as CF
from caffe.model_libs import *
import math
def reduceVGGNetBody(net, from_layer, need_fc=True, fully_conv=False, reduced=False,
dilated=False, nopool=False, dropout=True, freeze_layers=[], dilate_pool4=False):
k... |
import math
import torch
from torch import nn
import torch.nn.functional as F
import io
from omegaconf import OmegaConf
from taming.models import cond_transformer, vqgan
from PIL import Image
from torchvision.transforms import functional as TF
import requests
import sys
sys.path.append("./taming-transformers")
def s... |
#for extraction
from telethon import TelegramClient
from telethon.tl import functions as f, types as t
import configparser
import asyncio
import os
#for analysis
import pandas as pd
import numpy as np
import emoji
import seaborn as sns
import matplotlib.pyplot as plt
from wordcloud import WordCloud
#for export
from fpd... |
from setup import *
from logger import LOGGER
import pandas as pd
import os
import json
import subprocess
import nltk
import string
import numpy as np
from typing import Dict, List
from nltk.corpus import stopwords
from tqdm import tqdm
DIRECTORIES_TO_SUMMARIZE = [NEWSWCL50, ECB_PLUS]
nltk.download('stopwords')
MU... |
import codecs
import multiprocessing
import os
from collections import Counter
from typing import List, Optional
import numpy as np
from nltk.tokenize import word_tokenize
from tqdm import tqdm
from utils.data_util import (
load_json,
load_lines,
load_pickle,
save_pickle,
time_to_index,
)
PAD, UN... |
#! /usr/bin/env python
"""
## =========================================================================== ##
MIT License
Copyright (c) 2020 <NAME>
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 w... |
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, ButtonHolder, Submit
from django import forms
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.shortcuts import redirect
from django.utils i... |
import logging
import random
import os
import json
from transformers import DataProcessor, InputExample, InputFeatures, PreTrainedTokenizer
from typing import List, Optional, Union
class PodcastProcessor(DataProcessor):
def __init__(self, query_field):
self.max_test_depth = 1000 # for testing, we re-ran... |
import re
from pathlib import Path
import logging
from collections import OrderedDict
import subprocess
import shutil
import mtscomp
from ibllib.io import ffmpeg, spikeglx
from ibllib.io.extractors import ephys_fpga
from ibllib.pipes import tasks
from ibllib.ephys import ephysqc, sync_probes, spikes
from ibllib.pipes... |
#!/usr/bin/env python3
# -*- coding: ascii -*-
"""
A script for locating Java source files in need of a recompile.
"""
import sys, os, re
import stat
COMMENT_RE = re.compile(r'^\s*(#.*)?$')
MAP_LINE_RE = re.compile(r'^([^\s:#]+):((?:\s*[^\s:#]+)*)\s*$')
class FSCache:
"A caching wrapper around select filesystem... |
#! /usr/bin/env python3
import sys
def translate_sequence(rna_sequence, genetic_code):
"""Translates a sequence of RNA into a sequence of amino acids.
Translates `rna_sequence` into string of amino acids, according to the
`genetic_code` given as a dict. Translation begins at the first position of
the... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 27 18:21:32 2021
@author: TSAI, TUNG-CHEN
@update: 2021/10/06
"""
MODEL_DIRECTORY = r"models/"
import os
import sys
import contextlib
import numpy as np
import tensorflow as tf
from tabulate import tabulate
from typing import Optional, Union
fro... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
# Copyright 2020 Google LLC.
#
# 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 writing, ... |
'''
MIT License
Copyright (c) 2020 <NAME> & <NAME>
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, modify, merge, publis... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 o... |
import torch
import torch.nn as nn
import random
import numpy as np
import torchvision
import imp
import time
from models.pretrained_vgg import customCNN2
from models.pretrained_vgg import customCNN
from models.cnn import CNN
import models.soft_attention as soft_attention
import torch.nn.functional as f
cla... |
import torch.nn as nn
import torch.nn.functional as F
import torch
try:
from .sync_batchnorm import SynchronizedBatchNorm3d
except:
pass
def normalization(planes, norm='bn'):
if norm == 'bn':
m = nn.BatchNorm3d(planes)
elif norm == 'gn':
m = nn.GroupNorm(4, planes)
elif norm == 'i... |
import argparse
import time
import os
import glob
import sys
import json
import shutil
import itertools
import numpy as np
import pandas as pd
import csv
import torch
from torch import nn
from torch.autograd import Variable
from sklearn.metrics import confusion_matrix
from torch.nn import functional as F
from opts i... |
#########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... |
import struct
from .enums import *
import datetime
class ObjectType:
NONE = 0
BOOL = 1
BYTE = 2
UINT16 = 3
UINT32 = 4
UINT64 = 5
SBYTE = 6
INT16 = 7
INT32 = 8
INT64 = 9
CHAR = 10
STRING = 11
FLOAT = 12
DOUBLE = 13
DECIMAL = 14 # 16 bytes float
DATETIME = 15
BYTEARR = 16
CHARARR = 17
OTHER = 18
clas... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import io
import os
import select
import threading
from builtins import zip
from contextl... |
import torch
import os
import json
from transformers import TrainingArguments
# def get_optimizers(
# self, num_training_steps: int
# ) -> Tuple[torch.optim.Optimizer, torch.optim.lr_scheduler.LambdaLR]:
# """
# Setup the optimizer and the learning rate scheduler.
#
# We provide a reasonable defaul... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of the Wapiti project (http://wapiti.sourceforge.io)
# Copyright (C) 2008-2020 <NAME>
#
# Original authors :
# <NAME>
# <NAME>
# Copyright (C) 2008 Informatica Gesfor
# ICT Romulus (http://www.ict-romulus.eu)
#
# This program is free software; you can r... |
import os
import glob
import numpy as np
import pandas as pd
import csv
from Bio import SeqIO
import re
import matplotlib.pyplot as plt
plt.rc('font',family='Helvetica')
# find the best hit
def filter_results(resultID,fungi,writefile,outfile) : # writefile:true or false, outfile:filename for the outfile
if write... |
''' These functions are used as wrappers around SpaCy parsers, and can be used
either standalone or as part of a doctable.ParsePipeline.
The two primary parse functions here are `tokenize` and `get_parsetrees`.
Use `tokenize` when you want to extract lists of tokens (split by sentence
or not) and `get_parsetrees` when... |
import os, json, sys
import os.path as osp
import argparse
import warnings
from tqdm import tqdm
import numpy
import time
import numpy as np
from skimage.io import imsave
from skimage.util import img_as_ubyte
from skimage.transform import resize
import torch
from utils.model_saving_loading import str2bool
from models.... |
# -*- coding: utf8 -*-
"""Cache module for libcrowds-statistics."""
import operator
import pygeoip
import re
from collections import defaultdict
from sqlalchemy.sql import text
from flask import current_app
from pybossa.core import db
from pybossa.cache import cache, memoize, ONE_HOUR
session = db.slave_session
@ca... |
import logging
import numpy as np
try:
import matplotlib
import matplotlib.animation
import matplotlib.collections
import matplotlib.patches
except ImportError:
matplotlib = None
LOG = logging.getLogger(__name__)
def quiver(ax, vector_field, *,
confidence_field=None, step=1, thresho... |
# -*- coding: utf-8
"""Module for testing components of type reactor.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location
tests/test_components/test_reactors.py
SPDX-License-Identif... |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... |
"""Author: Trinity Core Team
MIT License
Copyright (c) 2018 Trinity
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,... |
import numpy as np
from tqdm import tqdm
import pandas as pd
import torch
import sys
sys.path.append('./util_tools')
from acc_utils import melodySplit, chordSplit, computeTIV, chord_shift, cosine, cosine_rhy, accomapnimentGeneration
sys.path.append('./models')
from model import DisentangleVAE
import os
os.environ[... |
import os
import time
import torch
import torchvision.transforms as T
import numpy as np
from torchvision.utils import make_grid
import matplotlib.pyplot as plt
from matplotlib import animation
from IPython.display import clear_output
from IPython.display import HTML
import PIL
from nn_analysis.datasets import transf... |
import os, pathlib
import glob
import re
from typing import Optional, List
from collections import namedtuple
import json
import pandas as pd
import SimpleITK as sitk
import nrrd
from pydicom import dcmread
from joblib import Parallel, delayed
from tqdm.auto import tqdm
from ..modules import StructureSet
from ..modu... |
from flask import Flask, render_template, send_from_directory, redirect, request, url_for, flash, session
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime, timedelta
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin, LoginManager, login_req... |
import random
import sys
import pygame
from pygame.locals import *
#global varibales
FPS=32
SCREENWIDTH=289
SCREENHEIGHT=511
SCREEN=pygame.display.set_mode((SCREENWIDTH,SCREENHEIGHT))
GROUNDY = (SCREENHEIGHT * 0.8)
GAME_SPRITES={}
GAME_SOUNDS={}
PLAYER='gallery/sprites/yellowbird-downflap.png'
BACKGROUND='gallery/sp... |
#!/usr/bin/env python
# coding: utf-8
# This app is a prototype to test capability of streamlit.
"""Prem RPI App.
A python streamlit web app that shows the English Premier League table with RPI.
To run:
$streamlit premrpi_app.py
History
v1.0.0 - Nov 2016, First published release
v1.1.0 - Oct 2017, Updated gen_... |
# -*- coding: utf-8 -*-
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import UserMixin, current_user
from sqlalchemy import func
from sqlalchemy.dialects.postgresql import JSON
from datetime import datetime
from bnd import redis_store
import click
import json
db = SQLAlchemy()
JsonType = db.String... |
import os
import sys
import numpy
import pickle
import imageio
import tempfile
import scipy.special
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
class Gui(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.image = ... |
import asyncio
import json
import re
import time
import datetime
from aioredis import ReplyError
from discord import NotFound
from tortoise.query_utils import Q
from Bot import GearBot
from Util import Pages, Utils, Translator, GearbotLogging, Emoji, ReactionManager
from database.DatabaseConnector import Infraction
... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
import sys
import time
import numpy
import scipy.linalg
from pyscf import lib
from pyscf.lib import logger
def expmat(a):
return scipy.linalg.expm(a)
class CIAHOptimizer(lib.StreamObject):
def __init__(self):
self.conv_tol_grad = 1e-4
self.... |
'''
Author: Mitchell
This code is used to find the mahalanobis distance between three variables and highlight points of interest
- Edited by <NAME> for app purposes
'''
import pandas as pd
import numpy as np
import scipy as sp
import scipy.signal as sg
from scipy.stats import chi2
import plotly.graph_objects as go
fr... |
# -*- coding: utf-8 -*-
"""Public section, including homepage and signup."""
from flask import (Blueprint, request, render_template, flash, url_for,
redirect, session, current_app, jsonify)
from flask_login import login_required, current_user
from dribdat.user.models import User, Event, Project
fro... |
# bot.py
import os
import discord
from discord.ext import commands, tasks
from itertools import cycle
import mysql.connector
import requests
import locale
from copy import deepcopy
locale.setlocale(locale.LC_ALL, '')
def connect():
return mysql.connector.connect(
host=os.environ['DB_HOST'],
user=... |
# Copyright (c) 2018, NVIDIA CORPORATION.
import pytest
import numpy as np
import pandas as pd
from cudf.dataframe import DataFrame
def make_frame(dataframe_class, nelem, seed=0, extra_levels=(), extra_vals=()):
np.random.seed(seed)
df = dataframe_class()
df['x'] = np.random.randint(0, 5, nelem)
... |
'''
val_pred_{valence/arousal}_nosmooth_ori.json
val_pred_{valence/arousal}_nosmooth.json
val_pred_{valence/arousal}_smooth.json
val_pred_{valence/arousal}_result.txt
tst_pred_{valence/arousal}_nosmooth.json
tst_pred_{valence/arousal}_smooth.json
smooth window:
- for valence, win_size = 50;
- for arousal, win_size ... |
import pandas as pd
from subprocess import PIPE, Popen
def cmdline(command):
process = Popen(
args=command,
stdout=PIPE,
shell=True
)
return process.communicate()[0].decode('ascii')
def get_tss(strand, s, e):
if not isinstance(s, str):
s = str(s)
if not isinstance(e... |
from django.shortcuts import render, redirect, get_object_or_404
from django.core.urlresolvers import reverse
from django.views.generic import (
TemplateView, RedirectView, DetailView, FormView)
from django.http.response import JsonResponse
from django import forms
from django.conf import settings
from django.contr... |
# Copyright 2019 MicroEJ Corp. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found with this software.
import os
import sys
import struct
import shutil
from PIL import Image
from shutil import make_archive
def genFontForgeFile(fileName):
file = open(fileName,"w")
file... |
import copy
import os
from typing import Optional, Text, List, Dict, Union, Tuple, Any, TYPE_CHECKING
from rasa.shared.exceptions import FileNotFoundException
import rasa.shared.utils.io
import rasa.shared.utils.cli
from rasa.core.constants import (
DEFAULT_NLU_FALLBACK_THRESHOLD,
DEFAULT_CORE_FALLBACK_THRESHO... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 30 15:37:44 2019
@author: asmith
"""
import os
import sys
import numpy as np
import pandas as pd
from ruffus import *
from cgatcore import pipeline as P
from ruffus import (
mkdir,
follows,
transform,
merge,
originate,
collat... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Plecost: Wordpress vulnerabilities finder
#
# @url: http://iniqua.com/labs/
# @url: https://github.com/iniqua/plecost
#
# @author:<NAME> aka ffranz (http://iniqua.com/)
# @author:<NAME> aka cr0hn (http://www.cr0hn.com/me/)
#
# Copyright (c) 2015, Iniqua Team
# All rights re... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from argparse import ArgumentParser
import codecs
import os
import random
import tempfile
import numpy as np
from prepare_dict import load_lexicon
from compare_lexicons import compare_lexicons
def create_tmp_file_name():
basedir = os.path.join(os.path.dirname(__fil... |
import sys
import pytest
from conftest import get_config, network_delay
import bonsai
from bonsai import LDAPClient
from bonsai.ldapconnection import LDAPConnection
@pytest.fixture(scope="module")
def url():
""" Get an LDAPClient with simple authentication. """
cfg = get_config()
url = "ldap://%s:%s" % ... |
'''
The policy for the two agent newsvendor game.
'''
from TwoNewsvendor import Model_Field
from TwoNewsvendor import Model_Central
import numpy as np
import math
import matplotlib.pyplot as plt
def printTuple(a):
printStr = ""
for f in a._fields:
printStr += " {}: {:.2f}".format(f,getattr(a, f))
... |
import screening as m
import random
import pymysql
import csv
import toml
from collections import Counter, defaultdict
from pyomo.environ import *
from pyomo.opt import SolverFactory
year = 2020
interview_number = 4
max_faculty_interview = 7
interview_low_score = 10 # Prints interviews with scores that low
weights ... |
# -*- coding: utf-8 -*-
"""
bromelia.setup
~~~~~~~~~~~~~~
This module implements the central Diameter application object. It works
as per Peer State Machine defined in RFC 6733 in order to establish a
Diameter association with another Peer Node.
:copyright: (c) 2020-present <NAME>.
:licens... |
# Allstate Purchase Prediction Challenge
# Author: <NAME> <<EMAIL>>
# https://www.kaggle.com/c/allstate-purchase-prediction-challenge
'''
This module is for train, cross validate and make the final prediction.
'''
import pandas as pd, numpy as np
import matplotlib.pyplot as plt
import operator
from sklea... |
import time
from typing import Union, Dict, Any, Optional
from slack_sdk.web import SlackResponse
from slack_bolt.request import BoltRequest
from slack_bolt.request.payload_utils import (
is_action,
is_event,
is_options,
is_shortcut,
is_slash_command,
is_view,
is_workflow_step_edit,
is... |
import argparse
import math
import os
import random
import shutil
from datetime import datetime
from config import configs
import numpy as np
import horovod.torch as hvd
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.multiprocessing as mp
from torchvision import models
from tqdm i... |
import sys
from sklearn.svm import SVR
from math import log
from math import sqrt
from math import exp
from collections import defaultdict
wcPairs = {}
wcPairs ['AT'] = 1
wcPairs['TA'] = 1
wcPairs['GC'] = 1
wcPairs['CG'] = 1
atgc = ['A', 'T', 'G', 'C']
atgcToInt = {'A':0, 'T':1, 'U':1, 'G':2, 'C':3}
def trainingP... |
import numpy as np
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
from torch.utils.data import DataLoader
import torchvision.models as models
from torchvision import transforms
from tensorboardX import SummaryWri... |
"""Service layer module for fdk-organization-bff."""
import asyncio
import logging
from typing import cast, Dict, List, Optional, Union
from aiohttp import ClientSession
from fdk_organization_bff.classes import (
FilterEnum,
OrganizationCatalog,
OrganizationCatalogList,
)
from fdk_organization_bff.config ... |
#!/usr/bin/env python
from argparse import ArgumentParser
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
from skimage.io import imsave
import os
import shutil
img_height = 28
img_width = 28
img_size = img_height * img_width
h1_size = 150
h2_size = 300
z_size = ... |
"""Pharmacokinetic models.
Created 28 September 2020
@authors: <NAME>
@email: <EMAIL>
@institution: University of Edinburgh, UK
Classes: PkModel and subclasses representing specific models
"""
from abc import ABC, abstractmethod
import numpy as np
from scipy.signal import convolve
class PKModel(ABC):
"""Abstr... |
"""
Defines various tomography models and priors to be used with an optimizer.
- srt : Solar rotational tomography (with priors)
- stsrt : Smooth temporal rotational tomography
- thomson : Thomson scattering model
"""
import numpy as np
import copy
import lo
import siddon
from lo_wrapper import siddon_lo, siddon4d_lo
... |
"""File to hold helper functions for data types related stuff."""
from copy import deepcopy
from functools import partial
from typing import Callable, Optional, Tuple, Union, cast
from ..debugging.custom_assert import assert_true
from ..values import BaseValue, ClearTensor, EncryptedTensor, TensorValue
from .base imp... |
import os
import sys
import json
import argparse
import re
from copy import deepcopy
from enum import Enum
from datetime import datetime, timedelta, time
from collections import defaultdict
from dateutil import parser
import hashlib
gDefaultUser = os.environ["USER"]
gDefaultTag = "untagged"
class TimestampType(Enum)... |
def maginner(str):
str = str.lower()
msg = []
for letter in str:
if letter == 'a':
msg.append(A())
elif letter == 'b':
msg.append(B())
elif letter == 'c':
msg.append(C())
elif letter == 'd':
msg.append(D())
elif letter ... |
import sys
from operator import itemgetter
import cv2
import matplotlib.pyplot as plt
import numpy as np
# -----------------------------#
# 计算原始输入图像
# 每一次缩放的比例
# -----------------------------#
def calculateScales(img):
pr_scale = 1.0
h, w, _ = img.shape
# --------------------------------------------... |
#!/usr/bin/env python
"""
Take txt output of multiple sequence alignment between PDBs as generated by EBIfold SSM server
(http://www.ebi.ac.uk/msd-srv/ssm/) and output label files to use with getcontacts.
"""
import argparse
COLOR_MAP = {'helix': 'red', 'sheet': 'blue', 'none': ''}
def output_labelfiles(output_pref... |
from enum import Enum
from typing import Optional, Union, List
from hdlConvertorAst.hdlAst._bases import iHdlObj
from hdlConvertorAst.py_ver_compatibility import is_str
class HdlDirection(Enum):
"""
Direction of the interface
"""
(
IN,
OUT,
INOUT,
BUFFER,
LINKA... |
import pygame
from pygame.math import Vector2
from pygame.locals import *
import random
import numpy as np
import math
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
Bright_RED = (255, 0, 0)
Bright_Green = (0, 255, 0)
BLUE = (0, 0, 255)
GREEN = (0, 128, 0)
MAROON = (128, 0, 0)
Bright_Yellow = (255, 255, 0)
Bright_Orange = ... |
import numpy as np
import pytest
from numpy.testing import assert_allclose
from einsteinpy import constant
from einsteinpy.metric import BaseMetric, Kerr, KerrNewman
_c = constant.c.value
_G = constant.G.value
_Cc = constant.coulombs_const.value
@pytest.fixture()
def test_input():
"""
Test input for some f... |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... |
import subprocess
import os
import sys
import ctypes
import winreg
import time
import json
import re
import logging
import hashlib
import requests
BANNER="Android Virus Total Analyzer rel. 0.0.0 by <NAME> (<EMAIL>). Times are in GMT"
#Optional lookup of NIST good files hash list (GFHL)
#First line of f... |
"""Routines and classes related to RPyC package"""
from . import module as module_utils, net, py3, strpack
import numpy as np
import importlib
rpyc=importlib.import_module("rpyc") # Python 2 compatibility (importing module from a module with the same name)
import pickle
import warnings
import socket
_default_packe... |
class Image(object):
"""Image"""
def __init__(self, img_id, orientation, num_of_tags, tags):
super(Image, self).__init__()
self.img_id = img_id
self.orientation = orientation
self.num_of_tags = num_of_tags
self.tags = set(tags)
def imprimir(self):
print(self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.