input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
individual
annulus is stored as an array in the ``zones`` attribute, inherited
from the ``multizone`` class.
By default, they will be named where "zone0" is the zero'th element of
the ``zones`` attribute, corresponding to the innermost zone. The
second innermost zone will be the first element of the ``zones`... | |
import os
import numpy as np
from netCDF4 import Dataset
from grid_resolution import grid_resolution
import multiprocessing as mp
class numerical_model:
name = 'speedy';
path = None;
res = None;
source_model = None;
source_local = None;
ensemble_0 = None;
snapshots = None;
model_local = None;
free_run = No... | |
sigh_unflat = sigh.reshape(mlats.shape)
if return_f107:
return sigp_unflat, sigh_unflat, f107
else:
return sigp_unflat, sigh_unflat
class AverageEnergyEstimator(object):
"""A class which estimates average energy by estimating both
energy and number flux
"""
def __init__(self, atype, numflux_threshold=5.0e7)... | |
for name, version in manager.session.query(Network.name, Network.version).filter(Network.id_in(network_ids))
]
return jsonify(rv)
@api_blueprint.route('/api/query/<int:query_id>/parent')
def get_query_parent(query_id):
"""Return the parent of the query.
---
tags:
- query
parameters:
- name: query_id
in: pa... | |
import logging
log = logging.getLogger(__name__)
from copy import deepcopy
from functools import partial
import itertools
import pickle as pickle
import numpy as np
from atom.api import Typed, Bool, Str, observe, Property
from enaml.application import deferred_call
from enaml.layout.api import InsertItem... | |
<reponame>Elaoed/iplives
# encoding=utf8
"""Redis pool using one module in different files"""
import json
import redis
import time
import os
from functools import wraps
from kits.log import get_logger
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
REDIS_LOGGER = get_logger('redis')
def redi... | |
from NER.utils import *
from NER.model import *
import re
import os
class Handler():
def __init__(self ):
self.cti = None
self.wti = None
self.tti_iob = None
self.tti_ner = None
self.tti = None
self.itt = None
self.itt_iob = None
self.itt_ner = None
self.itw = None
self.itc = None
self.da... | |
# Basic libraries
import pandas as pd
import requests, json
import time
import numpy as np
import warnings
import random
# Visualization
import seaborn as sns
import scipy.stats as ss
import IPython
from IPython.display import HTML, display, Markdown, IFrame, FileLink
from itertools import combinations
from scipy impo... | |
sel_model.ClearAndSelect)
class CallFrontListBox(ControlledCallFront):
def action(self, value):
if value is not None:
if isinstance(value, int):
for i in range(self.control.count()):
self.control.item(i).setSelected(i == value)
else:
if not isinstance(value, ControlledList):
setattr(
self.control.ogMaster,
... | |
this function is taken to be a conservative
representation of the damping values presented in Figure 9(a) of
the latter's paper _"Lateral excitation of bridges by balancing
pedestrians"_
If `conservative=True` is used then the negative 300Ns/m value proposed
by Dallard et al will be used. This value is taken... | |
#%%
import os
cwd = os.getcwd()
dir_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(dir_path)
import argparse
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import torchvision.utils
import numpy as np
i... | |
'REB',
'AST',
'TOV',
'STL',
'BLK',
'BLKA',
'PF',
'PFD',
'PTS',
'PLUS_MINUS',
'GP_RANK',
'W_RANK',
'L_RANK',
'W_PCT_RANK',
'MIN_RANK',
'FGM_RANK',
'FGA_RANK',
'FG_PCT_RANK',
'FG3M_RANK',
'FG3A_RANK',
'FG3_PCT_RANK',
'FTM_RANK',
'FTA_RANK',
'FT_PCT_RANK',
'OREB_RANK',
'DREB_RANK',
'REB_RANK',
'... | |
Overwrite the file currently on disk, if it exists. Default is false.
:return: None
'''
try:
assert not add_local_density or self.gadget_loc # gadget loc must be nonzero here!
assert not add_particles or self.gadget_loc
except:
raise AssertionError(
'Particle location not specified; please specify gadget locati... | |
'{key}' not found in RuntimeVirtualMachineVirtualMachineConfig. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
RuntimeVirtualMachineVirtualMachineConfig.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
Runt... | |
<reponame>vieee/Scraper_Myntra<gh_stars>0
"""Testcases for cssutils.CSSSerializer"""
from . import basetest
import cssutils
class PreferencesTestCase(basetest.BaseTestCase):
"""
testcases for cssutils.serialize.Preferences
"""
def setUp(self):
cssutils.ser.prefs.useDefaults()
def tearDown(self):
cssutils.se... | |
<reponame>SkandanC/simphony<filename>simphony/libraries/sipann.py
# Copyright © Simphony Project Contributors
# Licensed under the terms of the MIT License
# (see simphony/__init__.py for details)
"""
simphony.libraries.sipann
=========================
This package contains wrappers for models defined in the
SiPANN (S... | |
<reponame>GuoQiang-Fu/UQpy
"""
The module currently contains the following classes:
* ``SRM``: Class for simulation of Gaussian stochastic processes and random fields using the Spectral Representation
Method.
* ``BSRM``: Class for simulation of third-order non-Gaussian stochastic processes and random fields using the... | |
"serif"
elif "mono" in family or family in FONTS_MONO:
family = "monospace"
else:
family = "serif"
matches = self.fonts.get(family, self.fonts.get("seif"))
if matches is None:
return None
# find style
style = style or FONT_STYLE_NORMAL
matches_out = [match for match in matches if match.style == style]
if no... | |
#
#
# Public Archive of Days Since Timers
# User Account Model Helper Unit Tests
#
#
from django.test import TestCase
from django.utils import timezone
from padsweb.helpers import PADSUserHelper, PADSWriteUserHelper
from padsweb.models import PADSUser
from padsweb.settings import defaults
import secrets # For token_ur... | |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# pylint: disable=too-many-lines
import asyncio
import base64
import json
import os
import uuid
from http import HTTPStatus
from typing import List, Callable, Awaitable, Union, Dict
from msrest.serialization import Model
fr... | |
<reponame>alexvonduar/gtec-demo-framework
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#****************************************************************************************************************************************************
# Copyright 2017 NXP
# All rights reserved.
#
# Redistribution and use in source ... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from datetime import datetime
import json
import mock
from common.waterfall import buildbucket_client
from common.waterfall import failure_type
from common.... | |
30000, 300, nan, 0.52, nan ],
[ nan, 40000, 400, nan, 1.30, nan ],
[ nan, 50000, 500, nan, 1.76, nan ],
[ nan, 60000, 600, nan, 2.13, nan ],
[ nan, 70000, 700, nan, 3.08, nan ],
[ nan, 80000, 800, nan, 4.29, nan ],
[ nan, 90000, 900, nan, 6.18, nan ],
[ nan, 100000, 1000, nan, 9.25, nan ],
[ nan, 200000, 2000, ... | |
import pymysql as pymysql
import requests
from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.common.exceptions import NoSuchElementException
from wordcloud import WordCloud, STOPWORDS
import datetime
import pandas as pd
import matplotlib.pyplot as plt
import time
import random
def click_url(u... | |
10*m.b623 + 10*m.b624 + 10*m.b625 + 10*m.b626 + 10*m.b627 + 10*m.b628 + 10*m.b629
+ 10*m.b630 + 10*m.b631 + 10*m.b632 + 10*m.b633 + 10*m.b634 + 10*m.b635 + 10*m.b636 + 10*m.b637
+ 10*m.b638 + 10*m.b639 + 10*m.b640 + 10*m.b641 + 10*m.b642 + 10*m.b643 + 10*m.b644 + 10*m.b645
+ 10*m.b646 + 10*m.b647 + 10*m.b648 + 10*m.... | |
are handled. When set to "nan", predicted y-values
will be NaN. When set to "clip", predicted y-values will be
set to the value corresponding to the nearest train interval endpoint.
When set to "raise", allow ``interp1d`` to throw ValueError.
References
----------
.. [1] Transforming Classifier Scores into Accura... | |
<reponame>yogabonito/seir_hawkes
# from scipy.optimize import fmin_l_bfgs_b
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import fmin_l_bfgs_b
from sympy import derive_by_array, exp, lambdify, log, Piecewise, symbols
def exp_intensity_sigma_neq_gamma(history, sum_less_equal=True):
"""
Calcu... | |
object to user
user.lives.add(obj.id)
#addling this live object to that employee user id
getus.lives.add(obj.id)
messages.success(request,"Success")
return redirect(dashboard)
else:
messages.error(request,"Change to a Paid Plan First!")
return redirect('dashboard')
else:
return redirect(login)
parms = {
"ti... | |
k.startswith('rnn')}
self.embed_lead.weight.data.copy_(state_dict[1]['embed.weight'])
#self.rnn_title.load_state_dict(rnn_weight)
#print ('lead model loaded.')
#self.embed_lead.weight.data.copy_(state_dict[1]['embed.weight'])
#self.rnn_lead.load_state_dict(rnn_weight)
#checkpoint = torch.load(art_model_path)
... | |
executor.register_quantize_delegate(cfg, delegator)
block_params.extend(delegator.collect_params())
optimizer = torch.optim.Adam([param for param in block_params if param.requires_grad], lr=self.lr)
scheduler = torch.optim.lr_scheduler.MultiStepLR(optimizer, [int(self.epochs / 2), int(self.epochs * 2 / 3)])
for _... | |
"""
Heads are build on Brains.
Like in real life, heads do all the difficult part of receiving stimuli,
being above everything else and not falling apart.
You take brains out and they just do nothng. Lazy.
The most common use case is when one head contains one brain.
But who are we to say what you can and cannot do.
Yo... | |
auth_settings = ['api_key'] # noqa: E501
return self.api_client.call_api(
'/v1/assets', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Empty', # noqa: E501
auth_settings=auth_settings,
async_req=local_var_params.get('async_re... | |
import os
import subprocess
import pickle
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy as sc
import pathlib
import threading
import concurrent.futures as cf
from scipy.signal import medfilt
import csv
import tikzplotlib
import encoders_comparison_tool as enc
impo... | |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
import math
from enum import Enum, unique
from pathlib import Path
from typing import Any, Dict, List, Set, Tuple
import boto3
from botocore.exceptions import ClientError
from packaging import ver... | |
p13 = ttk.Entry(window3)
p13.grid(row = 13, column = 3)
p14 = ttk.Entry(window3)
p14.grid(row = 14, column = 3)
save = ttk.Button(window3, text = "SAVE + QUIT", width = 20, command = savedata14)
save.grid(row = 15, column = 1)
ttk.Label(window3, text = "Note: 1. When entering multiple topics").grid(row = 1... | |
"default": "1024m"}],
"APP_TIMELINE_SERVER":
[{"config-name": "yarn-env",
"property": "apptimelineserver_heapsize",
"default": "1024m"}],
"ZOOKEEPER_SERVER":
[{"config-name": "zookeeper-env",
"property": "zk_server_heapsize",
"default": "1024m"}],
"METRICS_COLLECTOR":
[{"config-name": "ams-hbase-env",
"prope... | |
#! /usr/bin/python3
import regex as re
import sys
import xml.etree.ElementTree as et
import xml.dom.minidom
COLORS_LIST = [
"silber",
"gold",
"schwarz",
"blau",
"rot",
"grün",
]
COLORS = "|".join(COLORS_LIST)
COLORS_ADJ = {
"silbern" : "silber",
"silberbekleidet" : "silber",
"golden" : "gold",
"goldbekle... | |
Fighters and the Venue. This includes the PCs,
the monster group, and the location of the fight. They're created in
initiative order (i.e., the order in which they act in a round of
fighting, according to the ruleset).
Saves that list in self.__fighters.
Returns: dict - (tuple of name, group) -> (tuple of init p... | |
"""
Copyright 2020 The OneFlow 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 applicable law or agreed... | |
# encoding: utf-8
import logging
from datetime import timedelta
from django.conf import settings
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.db.models import Q
from django.utils.timezone import now
from django.utils.translation import ugettext_laz... | |
return
if user == 'ci':
if sa['name'] in ('ci-agent', 'admin'):
if DEFAULT_NAMESPACE == 'default': # real-ci needs access to all namespaces
return
if sa['namespace'] == BATCH_PODS_NAMESPACE:
return
if user == 'test':
if sa['name'] == 'test-batch-sa' and sa['namespace'] == BATCH_PODS_NAMESPACE:
return
raise we... | |
-2.14805401e-05, 9.05879471e-06],
[1.15765605e-05, -2.20007656e-07, -1.00689171e-05, -7.85316340e-06],
[1.76295477e-06, -4.68035973e-07, 6.34634343e-06, -9.26903305e-06],
[9.56906212e-07, -2.83017535e-06, 1.68342294e-05,
-5.69798533e-06]]]]) * units('s^-1')
assert_array_almost_equal(div.data, truth, 12)
def test... | |
import datetime
import pickle
import time
import numpy as np
import tensorflow as tf
def stack_data(data, num_shifts, len_time):
"""Stack data from a 2D array into a 3D array.
Arguments:
data -- 2D data array to be reshaped
num_shifts -- number of shifts (time steps) that losses will use (maximum i... | |
"""
Layout components to lay out objects in a grid.
"""
import math
from collections import OrderedDict, namedtuple
from functools import partial
import numpy as np
import param
from bokeh.models import Box as BkBox, GridBox as BkGridBox
from ..io.model import hold
from .base import _col, _row, ListPanel, Panel
... | |
= np.angle(self.curcomplex[self.curframe])
curangle2f = curanglef + (old_div(increment*np.pi,180))
currealf = curmagf * np.cos(curangle2f)
curimagf = curmagf * np.sin(curangle2f)
temp_complex = currealf + 1j*curimagf
self.curcomplex[self.curframe] = temp_complex
#Apply optimum phase shift to apodised whole sp... | |
b_, (((a_ *in_* Identity(A)) & (b_ *in_* Identity(A))) & (Left(a_) == Left(b_))) >> (a_ == b_))) @ (47, TAUTOLOGY, 45, 46)
(Function(Identity(A)) == (Relation(Identity(A)) & All(a_, b_, (((a_ *in_* Identity(A)) & (b_ *in_* Identity(A))) & (Left(a_) == Left(b_))) >> (a_ == b_)))) @ (48, BY_THEOREM, "function")
Function(... | |
= {(0,0):C.GC_1874})
V_878 = Vertex(name = 'V_878',
particles = [ P.h01, P.su2__tilde__, P.su2 ],
color = [ 'Identity(2,3)' ],
lorentz = [ L.SSS1 ],
couplings = {(0,0):C.GC_1873})
V_879 = Vertex(name = 'V_879',
particles = [ P.h01, P.h01, P.su2__tilde__, P.su2 ],
color = [ 'Identity(3,4)' ],
lorentz = [ L.SSSS... | |
__abs__(self):
return DFNumber(abs(self.value))
def __ceil__(self):
return DFNumber(math.ceil(self.value))
def __floor__(self):
return DFNumber(math.floor(self.value))
def __bool__(self):
return self.value != 0.0
def __int__(self):
return int(self.value)
def __float__(self):
return float(self.value)
d... | |
<reponame>caoxiaoyue/PyAutoGalaxy
import numpy as np
from typing import Callable, Dict, List, Union
import autoarray as aa
class OperateImage:
"""
Packages methods which operate on the 2D image returned from the `image_2d_from` function of a light object
(e.g. a `LightProfile`, `Galaxy`, `Plane`).
Th... | |
== 0 and scaled_matrix[1] == 0:
converted_h5ad.append((h5ad_file, 'X', assay))
else:
converted_h5ad.append((h5ad_file,'raw.X', assay))
return converted_h5ad
# Quality check final anndata created for cxg, sync up gene identifiers if necessary
def quality_check(adata):
if adata.obs.isnull().values.any():
pr... | |
"""
Project: Asteroids
Author: <NAME>
Website: http://vu-tran.com/
Events:
- draw (DrawEvent)
- click (ClickEvent)
- keydown (KeyEvent)
- keyup (KeyEvent)
- count (TimerEvent)
"""
# import modules
import simplegui, math, random
# configurations
WINDOW_SIZE = (800, 600)
NUM_LIVES = 3
MAX_ROCK_COUNT = 6
# creat... | |
**ErrorMessage** *(string) --*
A text description of the error.
:type TextList: list
:param TextList: **[REQUIRED]**
A list containing the text of the input documents. The list can contain a maximum of 25 documents. Each document must contain fewer that 5,000 bytes of UTF-8 encoded characters.
- *(string) --*
:t... | |
<reponame>bloomdt-uw/pyAFQ
from dipy.align import resample
from dipy.segment.clustering import QuickBundles
from dipy.segment.metric import (AveragePointwiseEuclideanMetric,
ResampleFeature)
from dipy.io.streamline import load_tractogram, load_trk
from dipy.data.fetcher import _make_fetcher
import dipy.data as dpd
fro... | |
import numpy as np
from scipy.spatial import Voronoi
import matplotlib as mpl
import matplotlib.pyplot as plt
import pickle
import time
import shutil
def dirP(obj,nmax=10):
"""
Description : Gives all the attributes and values of an object
Input :* Obj : the object you want to explore
* nmax (optional): is the n... | |
]
if "prevalence_code" in params["coders"]:
# noinspection PyTypeChecker
xforms = xforms + [
fit_prevalence_code(incoming_column_name=vi, x=numpy.asarray(X[vi]))
]
if "indicator_code" in params["coders"]:
# noinspection PyTypeChecker
xforms = xforms + [
fit_indicator_code(
incoming_column_name=vi,
x=numpy.as... | |
<reponame>tdcoa/usage
import subprocess, platform, os, copy #, yaml
import sys
from datetime import datetime
from tkinter import *
from tkinter.ttk import *
from PIL import Image
from PIL import ImageTk
from .tdcoa import tdcoa
import tdcsm
class coa():
version = "0.4.1.6"
debug = False
entryvars = {}
defaults =... | |
<reponame>djfkahn/MemberHubDirectoryTools
import unittest
from unittest.mock import patch
import os
import family
import hub_map_tools
import roster
import person
data_file_path = os.path.abspath("./family_tests/")
hub_file_name = data_file_path + "/hub_map.csv"
common_hub_map = hub_map_tools.ReadHubMapFromFile(hub_fi... | |
<gh_stars>0
# encoding=utf8
"""
Module containing front-end function with several
algorithm implementations of QR decomposition defined as methods in
the QR class.
"""
from functools import reduce
import numpy as np
from scipy.linalg import block_diag
from mathpy.linalgebra.norm import norm
from... | |
if fc != 3:
gdaltest.post_reason('fail')
return 'fail'
f = ogr.Feature(lyr.GetLayerDefn())
f.SetField('field_not_nullable', 'not_null')
f.SetGeomFieldDirectly('geomfield_not_nullable', ogr.CreateGeometryFromWkt('POINT(0 0)'))
lyr.CreateFeature(f)
f = None
# Not Nullable geometry field
lyr = ds.CreateLayer('t... | |
import json
import logging
import subprocess
import mdtraj.version
import netCDF4 as nc
import numpy as np
import parmed
import simtk.openmm.version
import yaml
from mdtraj.formats.hdf5 import HDF5TrajectoryFile
from mdtraj.utils import ensure_type, in_units_of
from parmed.amber.netcdffiles import NetCDFTraj
from blu... | |
"develop"
self.network_id = 5777
self.keyring_backend = "test"
self.ganache_db_path = self.cmd.get_user_home(".ganachedb")
self.sifnoded_path = self.cmd.get_user_home(".sifnoded")
# From ui/chains/credentials.sh
self.shadowfiend_name = "shadowfiend"
self.shadowfiend_mnemonic = ["race", "draft", "rival", "univer... | |
<filename>dnaplotlib/datatype.py
"""
New DNAplotlib data type for designs (extendable for hierachy)
"""
__author__ = '<NAME> <<EMAIL>>'
__license__ = 'MIT'
__version__ = '2.0'
###############################################################################
# New Data Type
#############################################... | |
None:
self.stdout_redirector.start()
if self.stderr_redirector is not None:
self.stderr_redirector.start()
return 1
def _create_redirectors(self):
if self.stdout_stream:
if self.stdout_redirector is not None:
self.stdout_redirector.stop()
self.stdout_redirector = get_pipe_redirector(
self.stdout_stream, lo... | |
Thrust = segment.conditions.frames.body.thrust_force_vector[:,0]
axes = fig.add_subplot(3,1,1)
axes.plot( time , CLift , 'bo-' )
axes.set_xlabel('Time (min)')
axes.set_ylabel('CL')
axes.get_yaxis().get_major_formatter().set_scientific(False)
axes.get_yaxis().get_major_formatter().set_useOffset(False)
axes.grid... | |
<filename>pygbrowse/datasources.py<gh_stars>10-100
import os
import numpy
import pandas
import pysam
from scipy.signal import convolve
from . import utilities
from .utilities import log_print
DEFAULT_TAG_COUNT_NORMALIZATION_TARGET = 10000000
DEFAULT_FEATURE_SOURCES = ('ensembl', 'havana', 'ensembl_havana')
DEFAULT_G... | |
BackLink(_('my elections'), reverse('contest_list')),
cls='main-container'),
Div(cls='side-container'),
action_section,
sub_section,
cls='flex-container'
)
)
class CandidateDetail(Div):
def __init__(self, candidate, editable=False, **kwargs):
if editable:
kwargs['tag'] = 'a'
kwargs['href'] = reverse('conte... | |
<filename>banner_ops.py
import os
import json
import copy
import decimal
decimal.getcontext()
Dec = decimal.Decimal
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
return {'__Decimal__' : str(o)}
return json.JSONEncoder.default(self, o)
def as_decimal(dct):
"""Dec... | |
to global map
if not globalCompleteDsMap.has_key(tmpEleName):
globalCompleteDsMap[tmpEleName] = []
globalCompleteDsMap[tmpEleName].append(tmpEleLoc)
# use incomplete locations if no complete replica at online sites
if includeIncomplete or not tmpFoundFlag:
for tmpEleLoc in tmpEleLocs[0]:
# don't use TAPE
if is... | |
<gh_stars>0
# Copyright (c) 2020 Club Raiders Project
# https://github.com/HausReport/ClubRaiders
#
# SPDX-License-Identifier: BSD-3-Clause
#
# SPDX-License-Identifier: BSD-3-Clause
import datetime
import logging
import string
from typing import List
import ujson
from craid.eddb.States import States
from craid.eddb.... | |
# 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... | |
None:
if 'zorder_add' in list(opts.keys()):
zorder_add = opts['zorder_add']
if 'color' in list(opts.keys()):
color = opts['color']
if 'hatch' in list(opts.keys()):
hatch = opts['hatch']
if 'y_offset' in list(opts.keys()):
y_offset = opts['y_offset']
if 'y_extent' in list(opts.keys()):
y_extent = opts['y_exten... | |
import aiohttp
import asyncio
from bs4 import BeautifulSoup as BS
from . import error, content, utils
import random
import re
import json
import mimetypes
import time
import json
import re
import functools
#================================================================================================================... | |
import numpy as np
import matplotlib.pyplot as plt
import os
import warnings
from datetime import date
from math import e
def calc_rate(data1, data2):
if(data2 == 0):
return data1
else:
if(data1 < data2):
return (data2 / data1) * -1
else:
return data1 / data2
def calc_mort_rate(data1, data2):
if(data2 == 0):
... | |
<reponame>WeiChengTseng/DL_final_project
import time
import matplotlib
import time
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from tensorboardX import SummaryWriter
from a2c.models impor... | |
<reponame>manez/islandora_workbench<filename>tests/islandora_tests.py
"""unittest tests that require a live Drupal. In most cases, the URL, credentials, etc.
are in a configuration file referenced in the test.
"""
import sys
import os
from ruamel.yaml import YAML
import tempfile
import subprocess
import argparse
impo... | |
r"""
Kyoto Path Model for Affine Highest Weight Crystals
"""
#*****************************************************************************
# Copyright (C) 2013 <NAME> <tscrim at ucdavis.edu>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distributed in the hope that it will b... | |
import dataclasses
import keyword
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from typing import ClassVar, Dict, List, Optional, Set, Tuple, Union, cast
from uuid import UUID, uuid4
import humps # type: ignore
import marshmallow # type: ignore
from marshmallow import ( ... | |
<gh_stars>0
import logging
import time
import numpy as np
import torch
import multiprocessing as mp
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from transformer import TransformerEncoderLayer, TransformerDecoderLayer
from utils import *
from position import *
# from nu... | |
fit
cadence_mask : np.ndarray of bools (optional)
Mask, where True indicates a cadence that should be used.
**kwargs : dict
Additional keyword arguments passed to
`sklearn.linear_model.ElasticNet`.
Returns
-------
`.LightCurve`
Corrected light curve, with noise removed. In units of electrons / second
Exampl... | |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Yo... | |
transition_matrix.transpose()
for i in range(1, sequence_length):
prev_p = state_probabilities[i - 1, :] + transpose
best_previous_nodes = np.argmax(prev_p, axis=1)
state_probabilities[i] = np.max(prev_p, axis=1)
state_probabilities[i] += potentials[i, :]
best_paths[i, :] = best_previous_nodes
best_path[-1] = n... | |
<reponame>eneelo/qats<filename>qats/stats/gumbelmin.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:class:`GumbelMin` class and functions related to Gumbel (minima) distribution.
"""
import numpy as np
from scipy.special import zetac
from scipy.optimize import leastsq, fsolve
from matplotlib.pyplot import figure,... | |
<reponame>mcnowinski/various-and-sundry
# this program requires the 32 bit version of Python!!
import os
import glob
import math
import subprocess
import re
import sys
import string
from decimal import Decimal
from astropy.io import fits
from astropy.wcs import WCS
import matplotlib.pyplot as plt
import numpy as np
im... | |
File = "HRSA_FIPS_FL_v1.3_un"
path = "fp/VBHC/ADJ/delta/"
title = "FractureProof Final Payment Adjustments from CMS with HRSA County Data in FLorida"
author = "DrewC!"
### Import FractureProof Libraries
import os # Operating system navigation
import pandas as pd # Widely used data manipulation library with R/Excel lik... | |
<filename>lib/pwiki/DocPagePresenter.py<gh_stars>10-100
## import hotshot
## _prof = hotshot.Profile("hotshot.prf")
import traceback
import wx
import wx.xrc as xrc
from WikiExceptions import *
from wxHelper import getAccelPairFromKeyDown, copyTextToClipboard, GUI_ID
from .MiscEvent import ProxyMiscEven... | |
import copy
import json
import logging
import os
import sys
import tempfile
import time
import traceback
import h5py
import numpy as np
import tables
import tensorflow as tf
from opentamp.src.policy_hooks.vae.vae_networks import *
'''
Random things to remember:
- End with no-op task (since we go obs + task -> next... | |
<filename>simbench/converter/format_information.py
# -*- coding: utf-8 -*-
# Copyright (c) 2019 by University of Kassel, T<NAME>, RWTH Aachen University and Fraunhofer
# Institute for Energy Economics and Energy System Technology (IEE) Kassel and individual
# contributors (see AUTHORS file for details). All rights res... | |
TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
if GetTarget() == 'darwin':
TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
OPTS=['DIR:direct/src/showbase']
IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
TargetAdd('libp3show... | |
Type.\n"
"It simply changes the Type set on the account to the new Type.\n"
"You should carefully review your data afterwards and revert\n"
"to a backup if you are not happy with the results....\n"
"\n",
lCancelButton=True,
OKButtonText="I AGREE - PROCEED",
lAlertLevel=2)
if not ask.go():
statusLabel.setText(... | |
[Target 3] [Optimal input pars] [-0.94248, 1.0472 , 0.34907, 1.09956, 1.72788,-1.0472 ,-0.23271, 1.06465, 0.58333]
# [Target 4] [Optimal input pars] [-1.36136, 0. ,-0.34907, 1.41372, 1.72788, 0. , 0. , 1.41372, 0.95 ]
# [Target 5] [Optimal input pars] [-0.94248,-0.11636,-0.34907, 1.41372, 1.72788,-0.34907, 0. , 1.099... | |
# Eve W-Space
# Copyright 2014 <NAME> and contributors
#
# 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 ... | |
kw.pop('no_move_handler', False)
# TODO: Also do '>' and '<' indent/unindent operators.
# TODO: Also "gq": text formatting
# See: :help motion.txt
def decorator(func):
if not no_move_handler:
@handle(*keys, in_mode=InputMode.VI_NAVIGATION)
@handle(*keys, in_mode=InputMode.SELECTION)
def move(event):
""" Creat... | |
from serial import Serial,SerialException
from serial.tools.list_ports import comports
from threading import Lock
from queue import Queue
import time,random,struct
from base64 import b64encode, b64decode
from binascii import Error as BAError
from mirage.libs.ble_utils.constants import *
from mirage.libs.ble_utils.scapy... | |
<filename>darts/utils/data/encoder_base.py
"""
Encoder Base Classes
--------------------
"""
import numpy as np
import pandas as pd
from abc import ABC, abstractmethod
from enum import Enum, auto
from typing import Union, Optional, Tuple, Sequence, List
from darts import TimeSeries
from darts.logging import get_logg... | |
<filename>arc/reactionTest.py
#!/usr/bin/env python3
# encoding: utf-8
"""
This module contains unit tests of the arc.reaction module
"""
import unittest
from rmgpy.reaction import Reaction
from rmgpy.species import Species
import arc.rmgdb as rmgdb
from arc.exceptions import ReactionError
from arc.imports import s... | |
from dataclasses import dataclass
from typing import List, Optional, Union
from fedot.core.dag.graph_node import GraphNode
from fedot.core.data.data import InputData, OutputData
from fedot.core.data.merge.data_merger import DataMerger
from fedot.core.log import Log, default_log
from fedot.core.operations.factory impor... | |
<reponame>BogdanNovikov/Youtube-notifier<filename>venv/Lib/site-packages/googleapiclient/discovery.py
# Copyright 2014 Google Inc. 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 Li... | |
<filename>src/experiments/model.py
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import torch
import matplotlib.pyplot as plt
import torchvision
from torchvision import datasets, models, transforms
class DoubleConv(nn.Module):
def __init__(self,input_channels, output_channels):
super(Doubl... | |
item named "Bone Lake Route, Scandia, MN"
# already in the db...
if route_name.count(',') == 0:
addr_example = '123 %s, City, MN' % (route_name,)
elif route_name.count(',') == 1:
addr_example = '123 %s, MN' % (route_name,)
else:
addr_example = '123 %s' % (route_name,)
addyp = streetaddress.parse(addr_example)
... | |
#/************************************************************************************************************************
# Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modificat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.