input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
ParallelConv(nn.Module):
"""Layer of parallel convolutions with varying filter sizes followed by max over time pooling
This module takes an input tensor of any orientation based on its constructor, and pools its
output to shape `[B, H]`, where `H` is `outsz * len(filtsz)`
"""
def __init__(self, insz: int, outsz:... | |
# Copyright 2020 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | |
"""
Methods for finding descendant entities (participants in families, biospecimens
in those participants, etc).
"""
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
import psycopg2
import psycopg2.extras
from kf_utils.dataservice.patch import hide_entities, unhide_en... | |
<gh_stars>1000+
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from graph4nlp.pytorch.modules.utils.tree_utils import Tree, to_cuda
from .attention import Attention
from .base import RNNTreeDecoderBase
class StdTreeDecoder(RNNTreeDecoderBase):
r"""StdTreeDecoder... | |
the cable leading in.
# May 23, 2014: I think this is redundant as this will get caught when
# looking at the cables feeding into this step.
# else:
# generator = pipelinestep.cables_in.get(dest=socket)
# return (curr_run, generator)
# Now check if it's an output from this step.
generator = pipelinestep
for so... | |
x), x, atanh(c * x)), x
)
def replacement6460(a, b, c, d, e, n, x):
return -Dist(
c * x * sqrt(S(1) - S(1) / (c ** S(2) * x ** S(2))) / sqrt(d + e * x ** S(2)),
Subst(Int((a + b * x) ** n / cosh(x), x), x, acoth(c * x)),
x,
)
def replacement6461(a, b, c, d, e, n, x):
return Dist(
sqrt(-(c ** S(2)) * x ** S(... | |
if key not in all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get_run_downstream_lineage" % key
)
local_var_params[key] = val
del local_var_params['kwargs']
# verify the required parameter 'owner' is set
if self.api_client.client_side_validation and ('owner' not in local_va... | |
<gh_stars>1-10
from ctypes import (Structure, POINTER, CFUNCTYPE, c_void_p, c_float,
c_int32, c_double, c_char, c_int16, c_int64)
from enum import IntEnum
# Corresponds to VstIntPtr in aeffect.h
# We're assuming we are working in 64bit
vst_int_ptr = c_int64
class AudioMasterOpcodes(IntEnum):
# [index]: parameter ... | |
result = instance_dispatch_table(instance)->CreateDebugReportCallbackEXT(instance, pCreateInfo, pAllocator, pCallback);')
r_body.append(' if (VK_SUCCESS == result) {')
r_body.append(' layer_data *my_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map);')
r_body.append(' result = layer_create_msg_callba... | |
("", X, 1, "GL_TRANSFORM_FEEDBACK_VARYINGS"), # 0x8C83
("", I, 1, "GL_TRANSFORM_FEEDBACK_BUFFER_START"), # 0x8C84
("", I, 1, "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE"), # 0x8C85
("", X, 1, "GL_TRANSFORM_FEEDBACK_RECORD_NV"), # 0x8C86
("", X, 1, "GL_PRIMITIVES_GENERATED"), # 0x8C87
("", X, 1, "GL_TRANSFORM_FEEDBACK_PRIMI... | |
core of the gaussian.
# We take this to be the 'external' part of of the scan range
# work out the external part mask
with warnings.catch_warnings(record=True) as _:
external_mask = np.abs(drange) > ccf_scan_range / 2
# calculate and subtract external part
external_water = np.nanmedian(ccf_water[external_mask])
... | |
# 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, software
# distributed under the Li... | |
<reponame>cfgoldsmith/RMG-Py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# #
# Copyright (c) 2002-2019 Prof. <NAME> (<EMAIL>), #
# Prof. <NAME> (<EMAIL>) and the RMG Team (<EMAIL>) #
# #
# Permi... | |
<reponame>anonconda/TranSuite<filename>lib/transfix/transfix_tools.py<gh_stars>10-100
import os
import sys
import time
from collections import namedtuple, defaultdict
from Bio.Seq import Seq
from lib.parsing.gtf_object_tools import create_gtf_object
from lib.transfix.gene_overlap_module import get_overlap_percentage,... | |
<reponame>aronhelser/cumulus<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2015 Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance... | |
<reponame>ytchang05/N-lang<filename>python/scope.py
import math
import os.path
import sys
import lark
from lark import Lark
from colorama import Fore, Style
from variable import Variable
from function import Function
from native_function import NativeFunction
from type import NType, NGenericType, NAliasType, NTypeVar... | |
import logging
import numpy as np
import argparse
import json
from pytorch_pretrained_bert.tokenization import BertTokenizer
import torch
from tap2.bottom_machine.hypers import DataOptions, SentMarkerStyle
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(filename)s:%(lineno)d - %(message)s',
datefmt... | |
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
from pytorch3d import _C
from pytorch3d.structures import Meshes, Pointclouds
from torch.autograd import ... | |
"original bfid: %s: %s" % \
(src_file_record['status'][0],
src_file_record['status'][1])
return return_error, job, None, None, f0, \
is_migrating_multiple_copy
if f0:
break #found our original.
"""
#For trusted pnfs systems, there isn't a problem,
# but for untrusted we need to set the effective
# IDs to the... | |
{\n'
' id\n'
' userSettingId\n'
' userSetting {\n'
' id\n'
' userId\n'
' owner\n'
' createdAt\n'
' updatedAt\n'
' value\n'
' url\n'
' name\n'
' type\n'
' showWelcomeNext\n'
' showWelcomeSkip\n'
' showWelcomeRemind\n'
' welcomeData\n'
' }\n'
' labelID\n'
' label {\n'
' id\n'
' name\n'
' color\n'
'... | |
LST must match')
if n_pointings < n_lst:
pointing_center = NP.repeat(pointing_center, n_lst, axis=0)
n_snaps = lst.size
if pointing_coords == 'dircos':
pointings_altaz = GEOM.dircos2altaz(pointing_center, units='degrees')
elif pointing_coords == 'hadec':
pointings_altaz = GEOM.hadec2altaz(pointing_center, lati... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# >>
# Copyright 2018 Vivint, 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 req... | |
"""
Class Client
package Bitpay
author <NAME>
version 3.3.2203
See bitpay.com/api for more information.
"""
import os
import json
from .config import Config
from .tokens import Tokens
from .models.facade import Facade
from .models.bill.bill import Bill
from .models.Rate.rate import Rate
from .utils.rest_cli import RES... | |
Transversal Mercator projection - returns list of (x,y) tuples (unit: m)
"""
return [ p.transMercator(centerlon) for p in self.points ]
def simplify (self, delta=1.0):
"""
Reduce number of track points while preserving the shape of the track segment as much as possible.
The parameter delta gives the min... | |
if self.grid_error:
self.logger.warning(
f'The following variants have errored grid points:'
f'\n{self.grid_error}')
# close the file
self.logger.info(
f'\n# Successfully created database: {self.hdf5}\n')
def aug_data(self, augmentation, keep_existing_aug=True, random_seed=None):
"""Augment exiting original P... | |
'and using the estimation.'
dynSymSectionIgnore = True
# check if the size of the ".dynsym" section matches the
# estimated size
elif dynSymSection.elfN_shdr.sh_size != estimatedSymbolTableSize:
# check if forceDynSymParsing was not set (default value is 0)
if self.forceDynSymParsing == 0:
print 'WARNING: ".dy... | |
= _adfrcc.cvar.Element_Np
Element.Pu = _adfrcc.cvar.Element_Pu
Element.Am = _adfrcc.cvar.Element_Am
Element.Cm = _adfrcc.cvar.Element_Cm
Element.Bk = _adfrcc.cvar.Element_Bk
Element.Cf = _adfrcc.cvar.Element_Cf
Element.Es = _adfrcc.cvar.Element_Es
Element.Fm = _adfrcc.cvar.Element_Fm
Element.Md = _adfrcc.cvar.Element_M... | |
<gh_stars>100-1000
#!/usr/bin/env python
# Copyright (C) 2014 Open Data ("Open Data" refers to
# one or more of the following companies: Open Data Partners LLC,
# Open Data Research LLC, or Open Data Capital LLC.)
#
# This file is part of Hadrian.
# Licensed under the Apache License, Version 2.0 (the "License");
# yo... | |
difference is only in the sign of the eigenvector.
.. note:: See :func:`torch.linalg.eigvalsh` for a related function that computes only eigenvalues.
However, that function is not differentiable.
Args:
input (Tensor): the Hermitian `n \times n` matrix or the batch of such matrices of size
`(*, n, n)` where `*` is ... | |
conflict_mode == ConflictMode.Adjacent:
# Take the signal adjacent to the position we are in
if position_now == 0:
# Cannot decide -> ignore
is_entry = False
is_exit = False
else:
if direction == Direction.Both:
if position_now > 0:
is_exit = False
elif position_now < 0:
is_entry = False
else:
is_exit = Fa... | |
#!/usr/bin/env python3
"""@@@
Main Program: stitch_heatmaps.py
(originally called anal_CTCF.py (ANALyze CTCF))
Classes: Anchor
Domain
BuildHeatMaps
Author: <NAME>
creation date: mostly 2016 and up to March 2017.
last update: 200311 some cosmetic upgrades
version: 0
Purpose:
Build eheat files out of CCDs store... | |
= request.POST.get('r24c11').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r24c12 = request.POST.get('r24c12').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r24c13 = request.POST.get('r24c13').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r24c14 = request.POST.get('r24c14').replace('... | |
might not be 'available'.
open_access = self._work(with_open_access_download=True, title="open access")
open_access.quality = 1
self_hosted = self._work(
with_license_pool=True, self_hosted=True, title="self hosted"
)
unlimited_access = self._work(
with_license_pool=True, unlimited_access=True, title="unlimited ... | |
<gh_stars>0
"""This is the baseclass for list box types"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from builtins import chr
from datetime import datetime, timedelta
from abc import ABCMeta, abstractmethod, abstr... | |
<gh_stars>0
"""Abstractions for the axes of a liquid-handling robot."""
# Standard imports
import logging
from abc import abstractmethod
# Local package imiports
from lhrhost.protocol.linear_actuator import Receiver as LinearActuatorReceiver
from lhrhost.util.containers import add_to_tree, get_from_tree
from lhrhost.... | |
from math import *
from matplotlib import pyplot as plt
from matplotlib import colors as col
import numpy as np
import sys,os
def cart_comp(x,y):
"""
A basic comparison function to insure that layers are selected in terms of larger positive to larger negative
"""
return int(y-x)
def parse_tracer_file(files,overwr... | |
<reponame>C6SUMMER/allinclusive-kodi-pi
#############################################################################
#
# Copyright (C) 2013 Navi-X
#
# This file is part of Navi-X.
#
# Navi-X is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | |
# Generated by Snowball 2.0.0 - https://snowballstem.org/
from .basestemmer import BaseStemmer
from .among import Among
class EnglishStemmer(BaseStemmer):
'''
This class implements the stemming algorithm defined by a snowball script.
Generated by Snowball 2.0.0 - https://snowballstem.org/
'''
a_0 = [
Among(u"... | |
"""
This module provides classes that support observers, smart value handling and debug functions
All changes to values nominate an agent, and observers nominate the agent making changes they
are interested in.
It supercedes the pvars module
"""
import logging, sys, threading, pathlib, math, json
from enum import Enu... | |
Linux user account.
Fields:
gecos: [Output Only] The GECOS (user information) entry for this account.
gid: [Output Only] User's default group ID.
homeDirectory: [Output Only] The path to the home directory for this
account.
shell: [Output Only] The path to the login shell for this account.
uid: [Output Only] Us... | |
address current challenges with industry, designed through academia, industry and students participation"
"Focuses on a wide variety of core courses, electives including cutting edge technologies like Artificial Intelligence, Big Data Analytics, Machine Learning, IoT and more."
"For detailed information about the cur... | |
import random, sys, time, os
import tkinter as Tk
import xlrd
from tkinter import Button, Frame, Label, LabelFrame, messagebox, PhotoImage, Tk, W, Entry
from random import seed, randint, shuffle
from termcolor import colored
seed(1)
class Bq:
total_questions = 0
your_score = 0
qcount = 1
answer = ''
wrong = ''
... | |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 <NAME> <<EMAIL>>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at... | |
state = self.__dict__.copy() # copy the objects state
# Remove unpicklable entries (those which are lazily loaded
del state['rays_per_sweep']
del state['gate_x']
del state['gate_y']
del state['gate_z']
del state['gate_longitude']
del state['gate_latitude']
del state['gate_altitude']
return state
def __setsta... | |
# Copyright 2015-2017 Capital One Services, 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 ... | |
# coding=utf-8
"""
Testing qiki word.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import calendar
import inspect
import json
import re
import sys
import threading
import time
import unicodedata
import unittes... | |
<reponame>atrettel/sheardata
#!/usr/bin/env python3
# Copyright (C) 2020-2021 <NAME>
#
# SPDX-License-Identifier: MIT
import csv
import math
import sqlite3
import sheardata as sd
import sys
conn = sqlite3.connect( sys.argv[1] )
cursor = conn.cursor()
cursor.execute( "PRAGMA foreign_keys = ON;" )
flow_class = sd.FC_... | |
== history = {}'.format(self._search_history[self._search_history_index]))
logger.debug(' == url = "{}"'.format(url))
logger.debug(' == headers = "{}"'.format(self._headers))
logger.debug(' == post_data = "{}"'.format(post_data))
''' keep server results here '''
new_raw_stations = []
try:
r = self._session.get... | |
<filename>tidepool_data_science_metrics/glucose/glucose.py
import numpy as np
from typing import Tuple
import warnings
import operator
import tidepool_data_science_metrics.common.common as common
# TODO: allow these functions to take in a mmol/L in addition to mg/dL
# TODO: allow these functions to operate on a matrix... | |
ανάταξις ανάταση ανάτασις
ανάφαση ανάφλεξη ανάχρειο ανάχωμα ανέβασμα ανέγερση ανέγερσις ανέκδοτο ανέλιξη
ανέλκυση ανέλκυσις ανέλο ανέμη ανέμισμα ανένταχτος ανέσα ανέσπερο ανέχεια
ανήρ ανήφορος ανία ανίδρυση ανίδρυσις ανίχνευση ανίψι αναίδεια αναίρεση
αναβάθμισις αναβάθρα αναβάπτιση αναβάπτισις αναβάπτισμα αναβάτης ... | |
p[1]
if node.way in self.point_db:
current = self.point_db[node.way][0]
if current.rlid != node.rlid:
# This can happen for some data in crossings for example
#raise RuntimeError("Node with RLID %s and position %s already exists in the database (%s, %s)" % (node.rlid, latlon_str(node.way), current, node))
_log.wa... | |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################... | |
<filename>examples/easygame.py
def degrees(d):
"""Convert degrees to radians.
Arguments:
d -- Angle in degrees.
"""
import math
return d / 180 * math.pi
def rotate(vector, angle):
"""Rotate a vector (x, y) by an angle in radians."""
import math
x, y = vector
sin, cos = math.sin(angle), math.cos(angle)
retu... | |
value=0.0, tags=tags101 + ['port:eth101/1/22'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, tags=tags101 + ['port:eth101/1/23'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, tags=tags101 + ['port:eth101/1/24'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, ... | |
# Author: <NAME>
# Date: 5 Feb 2019
#
# 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 writin... | |
"""
used for storing the created models
"""
#split attention是在什么时候起作用的呢?
from __future__ import print_function, division
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
import torch
from torch.nn import Conv2d, Module, Linear, BatchNorm2d, ReLU
from torch.nn.modules.utils import _pair
... | |
<filename>inventory/inventory/doctype/packing_list_receipt/packing_list_receipt.py<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Myme and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frap... | |
<filename>check_invesalius_coord_coil.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# xcoord - Tools for cross-software spatial coordinate manipulation
#
# This file is part of xcoord package which is released under copyright.
# See file LICENSE or go to website for full license details.
# Copyright (C) 2018 <NAME>... | |
# encoding: utf-8
import urllib
import hmac
import base64
import hashlib
import requests
import traceback
from copy import copy
from datetime import datetime
from threading import Thread
from Queue import Queue, Empty
from multiprocessing.dummy import Pool
from time import sleep
import json
import zlib
# retrieve p... | |
# python3
# Copyright 2021 InstaDeep 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 required by applicable... | |
<filename>unused/cv/support/ElectopiaLearning.py<gh_stars>0
# All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "$Apr 28, 2016 12:18:18 PM$"
im... | |
Format defined by RFC3339.
"""
return pulumi.get(self, "time_updated")
@property
@pulumi.getter
def type(self) -> str:
"""
Type of Responder
"""
return pulumi.get(self, "type")
@pulumi.output_type
class GetResponderRecipeEffectiveResponderRuleDetailsResult(dict):
def __init__(__self__, *,
condition: str,
... | |
<reponame>HarveyYan/RNAonGraph<filename>Model/Joint_MRT.py
import os
import sys
import time
import math
import numpy as np
import tensorflow as tf
import subprocess as sp
from Bio.Align.Applications import ClustalwCommandline
basedir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0]
sys.path.append(basedi... | |
# Copyright (c) 2019 China Telecom Corporation
# 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 app... | |
<filename>pynams/blocks.py<gh_stars>1-10
"""
Code for grouping 3 orthogonal Profiles into a single Block object.
"""
from __future__ import print_function, division, absolute_import
import pynams.styles as styles
from pynams.diffusion import models
from pynams import Spectrum
import numpy as np
import matplotlib.pyplot... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | |
hadoop-env has, if Ranger-KMS is installed, we use its values.
rangerKMSServerHosts = self.getHostsWithComponent(
"RANGER_KMS", "RANGER_KMS_SERVER", services, hosts)
if rangerKMSServerHosts is not None and len(rangerKMSServerHosts) > 0:
rangerKMSServerHostsArray = []
for rangeKMSServerHost in rangerKMSServerHosts:... | |
"""ndb model definitions
Many of these are similar to models in models.py, which are Django models. We
need these ndb versions for use with runtime: python27, which is required by
endpoints.
"""
import collections
import logging
import math
import os
import webapp2
from google.appengine.api import search
from google.... | |
= cal_date.tm_mon
#-- convert date to year decimal
self.time[t], = gravity_toolkit.time.convert_calendar_decimal(
cal_date.tm_year, cal_date.tm_mon)
#-- estimated GRACE/GRACE-FO month
#-- Accelerometer shutoffs complicate the month number calculation
self.month[t] = gravity_toolkit.time.calendar_to_grace(year,mon... | |
<reponame>bp/resqpy
"""vdb.py: Module providing functions for reading from VDB datasets."""
version = '15th March 2021'
# Nexus is a registered trademark of the Halliburton Company
import logging
log = logging.getLogger(__name__)
import glob
import os
import zipfile as zf
from struct import unpack
import numpy as... | |
"""Tests for core."""
import random
import grafanalib.core as G
import pytest
def dummy_grid_pos() -> G.GridPos:
return G.GridPos(h=1, w=2, x=3, y=4)
def dummy_data_link() -> G.DataLink:
return G.DataLink(
title='dummy title',
linkUrl='https://www.dummy-link-url.com',
isNewTab=True
)
def dummy_evaluator() ... | |
<gh_stars>0
from __future__ import annotations
from typing import Dict, Iterable, List, Optional, Tuple, TYPE_CHECKING
from random import choice, choices, randint, uniform, random
from itertools import accumulate
from coords import Coords
from data_globals import PLANET_NEUTRAL, PLANET_BARREN, PLANET_BOMBED_OUT, PLANET... | |
# Add devices to database
if iostat_processing and iostat_device_block_processing and iostat_header != "":
if line.strip() != "":
iostat_row_dict = {}
# if European "," for ".", do that first
line = line.replace(",", ".")
# get rid of multiple whitespaces, then use comma separator so the AM/PM is preserved if its... | |
kk != 'lamb') or kk == 't')
and vv.shape[0] > indt.size)
if c0:
dins[kk] = vv[indt, ...]
# dlabels
dins['dlabels'] = dict.fromkeys(lk)
for kk in lk:
dins['dlabels'][kk] = {'name': dsig[kk],
'units': out[dsig[kk]]['units']}
# dextra
dextra = self._get_dextra(dextra, fordata=True)
# t0
if indt0 is None:
i... | |
# output the row that lists the total transfers (current and pending) row
def xfer_row(self, lm):
tr = HTMLgen.TR()
tr.append(HTMLgen.TD(HTMLgen.Font("Ongoing%sTransfers"%(NBSP,),
color=BRICKRED, html_escape='OFF')))
tr.append(HTMLgen.TD(self.data_dict[lm][enstore_constants.TOTALONXFERS]))
tr.append(HTMLgen.... | |
"""Classes wrapping :class:`~boto3.resources.base.ServiceResource` objects.
The methods and arguments on these classes somtimes differ in name from those in Boto3's
Resources to make them easier to understand in this context..
Glossary:
service_name:
The snake_case name of an AWS service (e.g. ``ec2``)
resource_ty... | |
<gh_stars>100-1000
# -*- coding: utf-8 -*-
""" ALOHA: generalized implementation of the single-player policy from [Concurrent bandits and cognitive radio network, O.Avner & S.Mannor, 2014](https://arxiv.org/abs/1404.5421), for a generic single-player policy.
This policy uses the collision avoidance mechanism that is i... | |
"""Agent message base class and schema."""
from collections import OrderedDict
from typing import Mapping, Union
import uuid
from marshmallow import (
EXCLUDE,
fields,
pre_load,
post_load,
pre_dump,
post_dump,
ValidationError,
)
from ..wallet.base import BaseWallet
from .decorators.base import BaseDecoratorS... | |
<filename>cosmosis/main.py
#!/usr/bin/env python
import sys
import configparser
import argparse
import os
import pdb
from .runtime.config import Inifile, CosmosisConfigurationError
from .runtime.pipeline import LikelihoodPipeline
from .runtime import mpi_pool
from .runtime import process_pool
from .runtime.utils imp... | |
import re
import transaction
from collections import namedtuple, defaultdict
from onegov.core.security import Public, Private, Secret
from onegov.core.utils import render_file
from onegov.directory import Directory
from onegov.directory import DirectoryCollection
from onegov.directory import DirectoryEntry
from onegov... | |
<gh_stars>1-10
from __future__ import with_statement
from pypy.interpreter.baseobjspace import W_Root, BufferInterfaceNotFound
from pypy.interpreter.gateway import interp2app, unwrap_spec
from pypy.interpreter.typedef import TypeDef, GetSetProperty
from pypy.interpreter.error import OperationError, oefmt, wrap_windowse... | |
<reponame>VonAlphaBisZulu/mcs
from straindesign.strainDesignSolution import SDSolution
import numpy as np
from scipy import sparse
import time
from cobra import Model
from typing import Dict, List, Tuple
from straindesign import StrainDesignMILPBuilder, MILP_LP, SDModule
from straindesign.names import *
from warnings i... | |
"""A collection of native images.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import errno
import glob
import io
import logging
import os
import shutil
import stat
from treadmill import appcfg
from treadmill ... | |
import pygame
import os
import sys
from pygame.locals import *
import characters
import constants as const
import random
from pathlib import Path
vec = pygame.math.Vector2
pygame.init()
class Game_State:
"""
The state of the game. Contains all of the sprites and interactable objects
Attributes:
view: A (Viewer) ... | |
(Element,), {'name': 'joints'})
keywords = type('keywords', (Element,), {'name': 'keywords'})
kinematics_model = type('kinematics_model', (Element,), {'name': 'kinematics_model'})
kinematics_scene = type('kinematics_scene', (Element,), {'name': 'kinematics_scene'})
kinematics = type('kinematics', (Element,), {'name': '... | |
from snovault import (
calculated_property,
collection,
load_schema,
)
from .base import (
Item,
paths_filtered_by_status,
)
from .shared_calculated_properties import (
CalculatedBiosampleSlims,
CalculatedBiosampleSynonyms
)
import re
@collection(
name='biosamples',
unique_key='accession',
properties={
'tit... | |
<filename>mycluster/DeltaTrimax.py
# -*- coding: utf-8 -*-
import numpy as np
import warnings
class EmptyTriclusterException(Exception):
pass
class DeltaTrimax():
"""
The delta-TRIMAX clustering algorithm.
Attributes
----------
D : ndarray
The data to be clustered
delta : float
The delta parameter of th... | |
None
Number between 0 and 1. The amplitude of the flux ramp. If None,
doesn't change what's currently being used.
lms_freq_hz : float or None, optional, default None
The tracking frequency in Hz. If None,
doesn't change what's currently being used.
reset_rate_khz : float or None, optional, default None
The flux ... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 18 18:15:50 2016
@name: Mixed MultiNomial Logit
@author: <NAME>
@summary: Contains functions necessary for estimating mixed multinomial logit
models (with the help of the "base_multinomial_cm.py" file).
Version 1 only works for MNL kernels and only for mixing of index
... | |
# -*- coding: utf-8 -*-
"""
SSTDR_USB.py
Created on Wed Oct 23 13:50:16 2019
@author: Cody
"""
#should launch USBPcap with arguments based on command line input.
#uses a PcapPacketReceiver to process output from USBPcap.
#notices waveforms that are transmitted and visualizes them.
#waits for user to quit, th... | |
SimpleDate(2012, 5, 19, 12, 0, tz='CLT')
SimpleDate('2012-05-19 12:00:00.000000 CLT')
The `format` parameter describes the output format, used for display.
If `None`, then an ISO-8601-like format is used, unless the value is
parsed from a string, in which case the format used for parsing is
preserved.
:param ye... | |
"""
Cubes
=====
Tools to deal with spectroscopic data cubes.
Some features in Cubes require additional packages:
* smoothing - requires agpy_\'s smooth and parallel_map routines
* `pyregion <git://github.com/astropy/pyregion.git>`_
The 'grunt work' is performed by the :py:mod:`cubes` module
"""
from __future__... | |
import cdflib
import numpy as np
from pytplot import clip, options, store_data, ylim, zlim, get_data
from ..load import load
def hep(trange=['2017-03-27', '2017-03-28'],
datatype='omniflux',
level='l2',
suffix='',
get_support_data=False,
varformat=None,
varnames=[],
downloadonly=False,
notplot=False,
no_upd... | |
unique k-mers' in data, data
assert 'false positive rate estimated to be 0.002' in data
def test_oxli_build_graph_write_fp():
script = 'oxli'
# use small HT
args = ['build-graph', '-x', '1e5', '-N', '2', '-k', '20']
outfile = utils.get_temp_filename('out')
infile = utils.get_test_data('random-20-a.fa')
args.... | |
<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. module:: redgem
:platform: Unix, Windows
:synopsis: RedGEM Algorithm
.. moduleauthor:: pyTFA team
Model class
"""
import networkx as nx
from cobra import Metabolite, Reaction, Model
from copy import deepcopy
class NetworkExpansion:
def __in... | |
= await self.publicGetMarketsIdTrades(self.extend(request, params))
#
# [
# {
# "id":251199246,
# "side":2,
# "price":0.022044,
# "executedAt":1588830682664,
# "qty":0.13545846,
# "makerId":"67ed6ef3-33d8-4389-ba70-5c68d9db9f6c",
# "takerId":"229ef0d6-fe67-4b5d-9733-824142fab8f3"
# }
# ]
#
return self.par... | |
<reponame>ridicolos/featuretools
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import Boolean
from featuretools import primitives
from featuretools.entityset.relationship import Relationship, RelationshipPath
from featuretools.entityset.timedelta import Timedelta
from featuretools.feature... | |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | |
# preferences.py
#
# MIT License
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
#
# 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 us... | |
import pickle
import argparse
import os
import csv
import multiprocessing
import random
from time import sleep
import pandas as pd
import yaml
import skopt
import ray
from ray.tune import run
from ray.tune.suggest.hyperopt import HyperOptSearch
from ray.tune.suggest.skopt import SkOptSearch
from ray.tune.automl import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.