input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>pearcandy/pennylane
# Copyright 2018-2020 Xanadu Quantum Technologies 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... | |
<gh_stars>0
# Authors:
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD 3 clause
"""
Module for LBM boundary conditions
"""
import collections
import logging
import types
import numpy as np
from sympy import symbols, IndexedBase, Idx, Eq
from .storage import Array
log = logging.getLogger(__name__) #pylint: di... | |
Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 1.14848,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime D... | |
from __future__ import unicode_literals
import fiona
import os
import logging
import sys
import urllib
import datetime
from collections import OrderedDict
import cartosql
import zipfile
import requests
import json
# do you want to delete everything currently in the Carto table when you run this script?
CLEAR_TABLE_FI... | |
<reponame>ericbudish/HFT-Races
'''
code_snippet_take_provide_cancel.py
This snippet is the code we used to analyze the activities in races. It decomposes the
active qty in races (qty traded and canceled) into 3 groups:
1. qty traded without an attempt to cancel
2. qty traded with a failed attempt to cancel
3. qty... | |
<reponame>nullstalgia/toltec<gh_stars>0
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2001 <NAME> <<EMAIL>>
# Andern Research Labs
#
# 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 Fr... | |
json.loads(process_info['infos'])
indexes = process_params['indexes']
quality_band = process_params['quality_band']
functions = [process_params['composite_function'], 'IDT']
satellite = process_info['metadata']['platform']['code']
mask = process_info.get('mask', None)
tiles = params['tiles']
start_date = dateti... | |
How much to adjust the brightness. Can be
any non negative number. 0 gives a black image, 1 gives the
original image while 2 increases the brightness by a factor of 2.
Returns:
PIL.Image|np.array|paddle.Tensor: Brightness adjusted image.
Examples:
.. code-block:: python
import numpy as np
from PIL import Ima... | |
<reponame>guiyaocheng/DeepRL-InformationExtraction<filename>code/myserver.py
import zmq, time
import numpy as np
import copy
import sys, json, pdb, pickle, operator, collections
import helper
import predict as predict
from train import load_data
from itertools import izip
import inflect
from sklearn.metrics.pairwise im... | |
<filename>notifico/services/hooks/github.py<gh_stars>0
# -*- coding: utf8 -*-
__all__ = ('GithubHook',)
import re
import json
import requests
from flask.ext import wtf
from notifico.services.hooks import HookService
def simplify_payload(payload):
"""
Massage the github webhook payload into something a little mor... | |
library. """
rstrings = []
for id, r in self._rates.items():
rstrings.append('{} ({})'.format(r, id))
return '\n'.join(rstrings)
def __add__(self, other):
""" Add two libraries to get a library containing rates from both. """
new_rates = self._rates
for id, r in other._rates.items():
try:
assert id not in ne... | |
y: tf.gather(x, y),
self.config.IMAGES_PER_GPU)
anchors = utils.batch_slice(ix, lambda x: tf.gather(anchors, x),
self.config.IMAGES_PER_GPU,
names=["pre_nms_anchors"])
# Apply deltas to anchors to get refined anchors.
# [batch, N, (y1, x1, y2, x2)]
boxes = utils.batch_slice([anchors, deltas],
lambda x, y: appl... | |
/ ")
print("\t|")
print("\t|")
if numberOfErrors == 6 :
print("\t___________")
print("\t| |")
print("\t| O")
print("\t| /|\\")
print("\t| / \\")
print("\t|")
print("\t|")
print("\nYou lose! GAME OVER\n")
print("The answer was \"" + word + "\"")
loser = True
if not loser :
prin... | |
<reponame>sapcc/trove
# Copyright 2015 Tesora 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
<reponame>Astlaan/OpenQL
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
`OpenQL` is a C++/Python framework for high-level quantum programming. The framework p... | |
= 0, 0
return BoundingBox2d(
[(x, y), (x + self.total_width, y - self.total_height)]
)
class Cell(Box): # ABC
is_visible = False
def place(self, x: float, y: float):
# Base cells do not render anything, therefore placing the content is
# not necessary
pass
def final_location(self) -> Tuple[float, float]:
... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
This is a neural network model of the development of reduplicated canonical
babbling in human infancy.
This is a modification of Izhikevich's (2007 Cerebral Cortex) daspnet.m and of
a previous mode described in Warlaumont (2012, 2013 ICDL-EpiRob) and Warlaumont
& Finnegan (2... | |
import os
import zipfile
import PIL
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.applications.vgg16 import VGG16
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras import layers
from tensorflow.keras import Model
from tensorflow.python.keras.applicat... | |
import pandas as pd
import numpy as np
import requests
import requests_ftp
import os
import re
import csv
from unidecode import unidecode
def EFO_parent_mapper(Cat_Stud, Cat_Anc_byN):
"""A function to map the parents and traits linkage file to the remaining
catalogue datasets. It also does a bit of clea... | |
section [target]
value = self._get_value(target, key)
if value:
return value
# Maybe implement a [default] section in the future?
return default
def dump(self):
output = ''
for config in self.configs:
for section in config:
output += f'\n[{section}]\n'
for key, value in config[section].items():
if value i... | |
import numpy as np
import pytest
from skimage import measure
import autogalaxy as ag
from autoarray.inversion.pixelizations.abstract import AbstractPixelization
from autoarray.inversion.regularization.abstract import AbstractRegularization
from autogalaxy import exc
from autogalaxy.plane import plane
... | |
<filename>recipe_engine/internal/engine.py<gh_stars>1-10
# Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import calendar
import copy
import datetime
import json
import logging
import os
import r... | |
from collections import OrderedDict
import numpy as np
import numexpr as ne
from scipy.spatial import distance
from scipy import sparse
import scipy.sparse.linalg
from . import exact_geodesic
from . import subsurface
from .misc import _memo
class Surface(exact_geodesic.ExactGeodesicMixin, subsurface.SubsurfaceMixi... | |
<gh_stars>0
"""
generate_plots_JCAP_2021.py is a Python routine that can be used
to generate the plots of <NAME>, <NAME>, <NAME>, and
<NAME>, "Polarization of gravitational waves from helical MHD
turbulent sources," https://arxiv.org/abs/2107.05356.
It reads the pickle run variables that can be generated by the routin... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import math
import numbers
import copy
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import variables as tf_variables
from trident.backend.common import get_session, addind... | |
Fahrenheit
temp_rc_df['degF_rc'] = (temp_rc_df['value'] * 9 / 5) + 32
temp_rc_df
# validTime Column split to date and time for Temperature
date_temp_rc = temp_rc_df['validTime'].str.split('T', n=1, expand=True)
time_temp_rc = date_temp_rc[1].str.split('+', n=1, expand=True)
time_temp_rc
temp_rc_df['date_temp_rc... | |
<filename>bioslds/hdf.py<gh_stars>0
""" Define some functions to facilitate serializing to HDF files. """
import h5py
import numbers
import numpy as np
from types import SimpleNamespace
from typing import Any, Union
def write_dict_hierarchy(group: h5py.Group, d: dict, scalars_as_attribs: bool = True):
""" Write ... | |
"USER AD_histogram> "
for l in lines:
if pattern in l:
l = l.split(pattern)[1]
return l.split(",")
return False
# generic stuff
def cliOpts( cli_arguments, options):
# options, var = getopt.getopt(argv[1:], 'c:l:f:')
# cli_arguments = argv[1:]
# options = 'c:l:f:'
# XXX incomplete XXX
opts = {}
try:
... | |
""" Module for risk-exploiting landmark identification scenario
- Scenario is derived from ergo_spread_small.py which is, in turn, derived from simple_spread.py
- N-agents must disribute themselves to cover N-landmarks
- Reward is based on the distance from each landmark to the closest agent (identical_reward case)
- O... | |
= to_chain((df, x, y), meta)
chain.name = name
chain_dfs.append(chain)
if not folder:
chain_coll.extend(chain_dfs)
else:
folders = [(i, list(c.keys())[0]) for i, c in
enumerate(chain_coll, 0) if
isinstance(c, dict)]
if folder in [f[1] for f in folders]:
pos = [f[0] for f in folders
if f[1] == folder][0]
ch... | |
:
code, lower, upper, frac, interpolation, interpolationQualifier = self.getBoundingSubFunctions( energy )
if( code is None ) :
raise Exception( 'No distribution' )
elif( code == '' ) :
EpLowerMin, EpLowerMax = lower.domainMin, lower.domainMax
EpUpperMin, EpUpperMax = upper.domainMin, upper.domainMax
EpMidMin =... | |
colN, means, scatters):
"""
Creates lists of ids of centrals and satellite galaxies corresponding to the density given in the n(z).
:param colN: name of the column you construct the catalog with
:param means: means of the Gaussians, array the same length of the redshift bin
:param scatters: scatters of the Gaussia... | |
and word[4] != "c" and word[5] != "C" and word[5] != "c" and word[6] != "C" and word[6] != "c" :
print("\nWrong!\n")
numberOfErrors = numberOfErrors + 1
wrongChars = wrongChars + "c" + ", "
if guessChar == "D" or guessChar == "d" :
if word[1] == "D" or word[1] == "d" :
toGuess = toGuess[:1] + "d" +... | |
id=None, name=None, uptime_secs=None, executors=None, status=None, errors=None, component_debug=None, sched_status=None, owner=None, replication_count=None, requested_memonheap=None, requested_memoffheap=None, requested_cpu=None, assigned_memonheap=None, assigned_memoffheap=None, assigned_cpu=None,):
self.id = id
sel... | |
API, you instantiate this class. See :ref:`enumerated
type description page <enumeration_description>`.
"""
KMIP = None
"""
Key Management Interoperability Protocol (KMIP) based key management
server. This class attribute was added in vSphere API 7.0.0.
"""
def __init__(self, string):
"""
:type string: :cla... | |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import abc
import sys
import numpy as np
import pandas as pd
from sklearn import linear_model, preprocessing, cluster
import scipy.linalg as slin
import scipy.sparse.l... | |
### QMIX algorithm
# paper: QMIX: Monotonic Value Function Factorisation for Deep Multi-Agent Reinforcement Learning
# reference: https://github.com/AI4Finance-Foundation/ElegantRL/blob/e980158e89cdc3c80be9c0770790a84dc6db8efd/elegantrl/agents/AgentQMix.py
from numpy.core.function_base import _logspace_dispatcher
fro... | |
<filename>phantom_analysis/dicom_util.py
# functions for interacting with dicom files
import os
import numpy as np
from collections import defaultdict
import logging
import time
from datetime import datetime
try:
import pydicom as dicom
logging.info("using pydicom")
except:
import dicom
logging.info("using dicom")... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 16 10:05:19 2018
@author: trevor
To determine the daily station statistics (unused)
#bin_size = 24
#bin_layout = np.arange(humid.size)//bin_size
#avg_humid = np.bincount(bin_layout,humid)/np.bincount(bin_layout)
convert function developed by <N... | |
. 1 1 2
. 2 3
1 3 4
sage: S.is_ribbon()
False
sage: S=SkewTableau([[None, None, 1, 2],[None, None, 3],[1]])
sage: S.pp()
. . 1 2
. . 3
1
sage: S.is_ribbon()
False
sage: S=SkewTableau([[None, None, None, None],[None, None, 3],[1, 2, 4]])
sage: S.pp()
. . . .
. . 3
1 2 4
sage: S.is_ribbon()
True
sag... | |
<gh_stars>100-1000
# This messy code computes vertex colors based on the distance reconstruction <-> GT mesh
from source.base import parula_colormap
from source.base import utils_mp
import numpy as np
import trimesh
import trimesh.proximity
def get_normalization_target(distances: list, cut_percentil=0.9):
dist_co... | |
= output_text.split(
'name="csrf_token" type="hidden" value="'
)[1].split('">')[0]
data = {"email": "<EMAIL>"}
output = self.app.post(
"/settings/email/add", data=data, follow_redirects=True
)
self.assertEqual(output.status_code, 200)
output_text = output.get_data(as_text=True)
self.assertIn("<strong>Add new... | |
"""
pyrad.proc.process_echoclass
===============================
Functions for echo classification and filtering
.. autosummary::
:toctree: generated/
process_echo_id
process_birds_id
process_clt_to_echo_id
process_hydro_mf_to_hydro
process_echo_filter
process_cdf
process_filter_snr
process_filter_vel_diff
... | |
import os
import glob
import json
from collections import OrderedDict
from colorama import Fore
from toolset.databases import databases
from toolset.utils.output_helper import log
class Metadata:
supported_dbs = []
for name in databases:
supported_dbs.append((name, '...'))
def __init__(self, benchmarker=None):... | |
<reponame>maojanlin/gAIRRsuite<gh_stars>1-10
import argparse
import pickle
import os
import numpy as np
#from parse_contig_realign import mark_edit_region, variant_link_graph, haplotyping_link_graph, output_contig_correction
from parse_contig_realign import variant_link_graph, output_contig_correction, parse_CIGAR, par... | |
I1Ii111 . II111iiii
i11 = threading . Timer ( 60 , oo0 ,
[ II1iII1i , iiI1iIiI ] )
i11 . start ( )
if 62 - 62: OoooooooOO . I11i
if 61 - 61: OoOoOO00 - OOooOOo - i1IIi
if 25 - 25: O0 * I11i + I1ii11iIi11i . o0oOOo0O0Ooo . o0oOOo0O0Ooo
if 58 - 58: I1IiiI
threading . Timer ( lisp . LISP_DEFAULT_DYN_EID_TIMEOUT ,
... | |
<filename>radical_translations/core/models.py
from typing import Dict, List, Optional
from django.conf import settings
from django.db import models
from django.db.models.query import QuerySet
from model_utils.models import TimeStampedModel
from controlled_vocabulary.models import (
ControlledTerm,
ControlledTermFie... | |
that the record is enabled.
dns_name: The name for this shared record in punycode format.
extattrs: Extensible attributes associated with the object.For valid
values for extensible attributes, see the following information.
name: Name for this shared record. This value can be in unicode
format.
shared_record_grou... | |
import re
from base64 import b64encode, b64decode
from datetime import datetime
from typing import Dict, Any, Optional, Sequence, List
from uuid import uuid4
import time
from authlib.common.security import generate_token
from fastapi import HTTPException
from pydantic import BaseModel
from pydantic.datetime_parse impo... | |
#! -*- coding: utf-8 -*-
import pprint
from decimal import Decimal
from botocore.exceptions import ClientError
from botocore.vendored.requests.exceptions import ConnectionError
from .helpers import get_attribute_type
from .errors import ClientException, ConnectionException, ParameterException
pp = pprint.PrettyPri... | |
planet_tags]
elif args.eph_planetmassprior == 'loguniform':
parameters += ["planet{0}_delta_amp".format(ii) for ii in planet_tags]
parameters += ["planet{0}_delta_sign".format(ii) for ii in planet_tags]
if num_ephs > 1:
for ii in planet_tags:
for jj in range(num_ephs-1):
parameters.append("planet{0}_orbitwgts{1}... | |
ValueError("Decay must be either 'EDT' or an integer \
corresponding to the amount of energy decayed to \
evaluate, e.g. (decay='20' | 20).")
RT = []
for ED in listEDC:
edc, edv = ED
RT.append(reverb_time_regression(edc, edv, y1, y2))
return RT
def G_Lpe(IR, nthOct, minFreq, maxFreq, IREndManualCut=None):
"""... | |
"""
Compute mixed Nash equilibria of a 2-player normal form game by the
Lemke-Howson algorithm.
Edit
"""
import numbers
import numpy as np
from numba import jit
from .utilities import NashResult
TOL_PIV = 1e-10
TOL_RATIO_DIFF = 1e-15
def lemke_howson(g, init_pivot=0, max_iter=10**6, capping=None,
full_output=False... | |
return super(_ColumnClause, self).label(name)
def accept_visitor(self, visitor):
visitor.visit_column(self)
def to_selectable(self, selectable):
"""Given a ``Selectable``, return this column's equivalent in
that ``Selectable``, if any.
For example, this could translate the column *name* from a
``Table`` obje... | |
list):
self.storage['bucket_index'] = histogram[:]
self.storage['bucket_index'].append(maxint)
self.storage['buckets'] = [0] * (len(histogram) + 1)
self.storage['upstream_buckets'] = [0] * (len(histogram) + 1)
hist_lines = self.definitions['response_time_hist']['lines']
upstream_hist_lines = self.definitions['res... | |
'cov_x_x' / construct.Float32l,
'cov_x_y' / construct.Float32l,
'cov_x_z' / construct.Float32l,
'cov_y_y' / construct.Float32l,
'cov_y_z' / construct.Float32l,
'cov_z_z' / construct.Float32l,
'n_sats' / construct.Int8ul,
'flags' / construct.Int8ul,)
__slots__ = [
'tow',
'x',
'y',
'z',
'cov_x_x',
'cov_x_y'... | |
response = self.client.post(reverse('api-v3-validate-declaration'), {'entity_id': self.test_producer.id, 'period_year': today.year, 'period_month': today.strftime('%m')})
self.assertEqual(response.status_code, 400)
jsoned = response.json()
self.assertEqual(jsoned['message'], "PENDING_TRANSACTIONS_CANNOT_DECLARE")
... | |
<reponame>uktrade/jupyterhub-data-auth-admin
import datetime
import json
import os
from functools import wraps
import hashlib
import itertools
import logging
import random
import re
import secrets
import string
import csv
from io import StringIO
from typing import Tuple
from timeit import default_timer as timer
impor... | |
If the given trigger rule configuration is
invalid
:raises :class:`job.configuration.data.exceptions.InvalidConnection`: If the trigger rule connection to the job
type interface is invalid
"""
# Create manifest and validate
manifest = SeedManifest(manifest_dict)
for field_name in kwargs:
if field_name in JobT... | |
<reponame>ikedim01/secscan<gh_stars>0
# AUTOGENERATED! DO NOT EDIT! File to edit: 10_scrape13G.ipynb (unless otherwise specified).
__all__ = ['default13GDir', 'getSec13NshAndPctFromText2', 'addNshAndPct', 'cusipChecksum', 'monthNameToIso',
'getMonthPatStr', 'parseEventDate', 'parse13GD', 'scraper13G', 'reOPTS', 'aggr... | |
<gh_stars>0
#!/usr/bin/env python3
from olctools.accessoryFunctions.accessoryFunctions import GenObject, make_path, MetadataObject, relative_symlink, \
run_subprocess, SetupLogging
from genewrappers.biotools import bbtools
from argparse import ArgumentParser
from Bio import SeqIO
from glob import glob
from time import... | |
<reponame>atptro/alibabacloud-sdk<gh_stars>0
# This file is auto-generated, don't edit it. Thanks.
from alibabacloud_tea_rpc.client import Client as RPCClient
from alibabacloud_polardb20170801 import models as polardb_20170801_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.cli... | |
#!/usr/bin/python
"""
opx_get_packages -- fetch a list of debian packages, and all their
run-time dependencies
"""
from __future__ import print_function
import apt
import apt_pkg
import collections
import sys
import os
import shutil
import subprocess
import argparse
import logging
import itertools
from distutils.vers... | |
<reponame>CloudVelox/simple-cloud-shell
#
# Copyright 2014-2016 CloudVelox 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 License at
#
# http://www.apache.org/licenses/LICEN... | |
str(t[2])+ ' ' + str(t[3]) + ' ' + str(t[4])
elif len(t) == 4:
t[0] = GenerarC3D()
t[0].code += str(t[1]) + ' ' + t[2].code + ' ' + t[3].code
else:
t[0] = GenerarC3D()
t[0].code += str(t[1]) + ' ' + t[2].code
def p_arg_precision(t):
'''arg_precision : PARABRE NUMERO PARCIERRE
| ''' #EPSILON
if len(t) == 4:
... | |
<reponame>anderson2981/pyrometheus
"""
.. autofunction:: gen_thermochem_code
.. autofunction:: get_thermochem_class
Internal Functionality
^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: equilibrium_constants_expr
.. autofunction:: rate_coefficient_expr
.. autofunction:: third_body_efficiencies_expr
.. autofunction:: troe_fa... | |
from collections import deque
from dataclasses import dataclass, field
from typing import Any, List, Union, Dict, Sequence, NamedTuple, Optional
from mdiff.block_extractor import OpCodeDeleteThenInsertBlockExtractor, ConsecutiveVectorBlockExtractor, \
NonIntegersBlockExtractor
from mdiff.utils import OpCode, longest_... | |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import sys
import os
import time
currentUrl = os.path.dirname(__file__)
parentUrl = os.path.abspath(os.path.join(currentUr... | |
'0x' and 'L' appendages brought on by the hex() function. pads to 8 characters
hexEntry.colorSwatch = ColorSwatch( guiFrame, fieldValueHexString, hexEntry )
hexEntry.colorSwatch.grid( column=2, row=i, pady=verticalPadding )
else:
# Add an editable field for this field's actual decoded value (and attach... | |
# Copyright 2012, Google Inc.
# 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 and the follo... | |
<filename>acq4/util/clibrary/CLibrary.py
# -*- coding: utf-8 -*-
from __future__ import print_function
from six.moves import map
from six.moves import range
"""
CLibrary.py - Provides CLibrary class
Copyright 2010 <NAME>
Distributed under MIT/X11 license. See license.txt for more infomation.
Proxy to both CHeader and ... | |
import glob
import os
import shutil
import time
import zipfile
from datetime import datetime
from django import forms
from museum_site.models import *
from museum_site.fields import *
from museum_site.widgets import *
from museum_site.common import GENRE_LIST, YEAR, any_plus, TEMP_PATH, SITE_ROOT, get_sort_option_for... | |
<reponame>djfroofy/beatlounge
import sys
import math
import warnings
from collections import namedtuple
from twisted.python import log
from twisted.python.failure import Failure
from twisted.internet.selectreactor import SelectReactor
from twisted.internet.task import LoopingCall
from bl.debug import DEBUG
__all__... | |
from Bio import pairwise2
from Bio.SubsMat.MatrixInfo import blosum62
import numpy as np
import scipy
import pandas as pd
import regex as re
import pickle
def sub_pivot_df(pps, sdf, group=True):
"""function takes a long form datatable of extracts and peaks (input sdf), filters
for peptide plasmids of interest (inpu... | |
<reponame>DoofCoder/mesa
# -*- coding: utf-8 -*-
"""
Batchrunner
===========
A single class to manage a batch run or parameter sweep of a given model.
"""
import copy
from itertools import product, count
import pandas as pd
from tqdm import tqdm
import random
try:
from pathos.multiprocessing import ProcessPool
exc... | |
tracking efficiencies parametrization.
Args:
efficiency: Calculated tracking efficiencies.
centrality_range: Associated centrality range.
period: Data taking period.
system: Collision system.
output_info: Output info for saving figures.
Returns:
None.
"""
# Get the parameters
pt_values, eta_values, n_cent_b... | |
<reponame>mon4ter/aiostaticmap<filename>src/aiostaticmap/aiostaticmap.py
from asyncio import ALL_COMPLETED, CancelledError, FIRST_COMPLETED, sleep, wait
from collections import deque
from io import BytesIO
from itertools import count
from logging import getLogger
from math import atan, ceil, cos, floor, log, pi, sinh, ... | |
# -*- coding: utf-8 -*-
# Name: fourth_day.py
# Authors: <NAME>
# Main interface to the fourth_day module. This package calculates the light yields and emission specta
# of organisms in the deep sea using a combination of modelling and data obtained by deep sea Cherenkov telescopes. Multiple
# calculation routines are ... | |
the private IP should be returned
if there is no public one
compartment_id (str): OCID of the compartment.
config (object): An OCI config object or None.
interactive (bool): Indicates whether to execute in interactive mode
raise_exceptions (bool): If set to true exceptions are raised
Returns:
The IP as ... | |
a formatter is set, use it. Otherwise, use the default formatter
for the module.
"""
if self.formatter:
fmt = self.formatter
else:
fmt = _defaultFormatter
return fmt.format(record)
def emit(self, record):
"""
Do whatever it takes to actually log the specified logging record.
This version is in... | |
be stacked together
5. smoothing - boolean, will clip extremal values according to the smoothing_array
6. normalisation - str. Will normalise according to 'range', 'std' or 'None'
Range is from -1 to 1
Std is mean = 0, std = 1
7. output_as_torch - boolean:
outputs values as torch Tensors if you want (usual... | |
``SDE`` subclass and the chosen integration method.
Defaults to a process of ``numpy.nan`` along the given timeline.
See Also
--------
paths_generator
SDE
SDEs
Notes
-----
The equation to be integrated is exposed to the integration
algorithm in a standardized form, via methods ``A`` and ``dZ``
delegated to... | |
None:
plabel = label
else:
plabel = 'Flux'
""" Plot the spectrum """
drawstyle = 'steps'
ls = "%s" % linestyle
self.ax1.plot(self['wav'], flux, color, linestyle=ls,
drawstyle=drawstyle, label=plabel, **kwargs)
self.ax1.tick_params(labelsize=fontsize)
self.ax1.set_xlabel(xlabel, fontsize=fontsize)
"""
Plot... | |
<gh_stars>1-10
# Copyright 2017 Google LLC 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 applicabl... | |
bend.Bend(2, 3, 4) # theta_B
one_tors = tors.Tors(1, 2, 3, 4) # tau
self._D_on[4] = False # NO phi_A
self._D_on[5] = False # NO phi_B
elif nA == 2 and nB == 1:
one_stre = stre.Stre(2, 3) # RAB
one_bend = bend.Bend(1, 2, 3) # theta_A
self._D_on[2] = False # NO theta_B
self._D_on[3] = False # NO tau
self._D_on[4... | |
Definition Schema Component : keyref fields
locating an attribute refers to a key locating an attribute
"""
assert_bindings(
schema="msData/identityConstraint/idK007.xsd",
instance="msData/identityConstraint/idK007.xml",
class_name="Root",
version="1.1",
mode=mode,
save_output=save_output,
output_format=outpu... | |
# -*- coding: utf-8 -*-
""" Hi-C analysis of ChIP-seq after multi-targeting Cas9
"""
__author__ = "<NAME>"
__license__ = "MIT"
__version__ = "0.9"
__maintainer__ = "<NAME>"
import h5py
import pysam
import os
import re
import numpy as np
from scipy import sparse, stats
import matplotlib.pyplot as plt
from . import chip... | |
"""
This module provides local and cloud storage of computed values. The main
point of entry is the PersistentCache, which encapsulates this functionality.
"""
import attr
import os
import shutil
import tempfile
import yaml
import warnings
from uuid import uuid4
from pathlib import Path
from bionic.exception import E... | |
= source_fields[2].split('-')[0]
except IndexError:
strategy = source_fields[2]
try:
values = source_fields[2].split('-')[1].split(',')
try:
value_min = values[0]
value_max = values[1]
value = None
except IndexError:
rospy.loginfo("Detected a singe value from source_string: %s" % source_string)
value = valu... | |
to the nearest millisecond
year : int
Year
month : int
Month (range 1 .. 12)
day : int
days in the month (range 1-31)
hours : int
hours of day (range 0-23)
minutes : int
minutes of hour (range 0-59)
seconds : int
seconds of minute (range 0-60) rounded down
ns : int
nanoseconds of second (range 0-999999999... | |
<filename>build/lib/bigwing/crawler.py
from bs4 import BeautifulSoup
import warnings; warnings.filterwarnings("ignore")
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from IPython.display import clear_output
import re, os, time, pickle, errno
import pandas as pd
import numpy as np
... | |
<reponame>martino-vic/pylexibank
"""Functionality to load a set of CLDF datasets into a sqlite db.
Notes:
- Only CLDF components will be loaded into the db.
- The names of the columns in the database are the names from the CSV files, not the
preferred labels for the corresponding CLDF properties.
"""
import json
impo... | |
# -*- coding: utf-8 -*-
"""NASNet-A models for Keras.
NASNet refers to Neural Architecture Search Network, a family of models
that were designed automatically by learning the model architectures
directly on the dataset of interest.
Here we consider NASNet-A, the highest performance model that was found
for the CIFAR-10... | |
# Copyright 2014 SAP AG or an SAP affiliate company.
#
# 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... | |
self._values
def __ne__(self, rhs: typing.Any) -> builtins.bool:
return not (rhs == self)
def __repr__(self) -> str:
return "DbVaultProps(%s)" % ", ".join(
k + "=" + repr(v) for k, v in self._values.items()
)
class RestoreJob(
ros_cdk_core.Resource,
metaclass=jsii.JSIIMeta,
jsii_type="@alicloud/ros-cdk-hbr... | |
{"names": ["x", "y", "z", "v_x", "v_y", "v_z", "M_200c"],
"formats": 7 * [np.float32]}
catalog = np.zeros(n_tot, dtype)
return pd.DataFrame(catalog)
@staticmethod
def _set_octant(df, octant):
"""Affix an octant column to a copy of the data frame """
df_copy = df.copy() #FIXME: Make sure shallow copy is safe
d... | |
'''
Created on 10 aug. 2015
@author: Maurits
'''
import random
import time
import string
import os
import math
import pygame
import basic_shape
import textutil
import enemy
import coin
from collections import OrderedDict
class GUI(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
self.sc... | |
#!/usr/bin/env python3
# -*- coding : utf-8 -*-
import hashlib
import html
import os
import re
import dateutil.parser
from pathlib import Path
from datetime import datetime
import gzip
import requests
import atoma
from urllib import request
from http.cookiejar import CookieJar
from lxml.html.soupparser import fromstrin... | |
from __future__ import annotations
import math
from collections import deque
from typing import Optional, Callable
import numpy as np
import pygame
from chess.const import PieceType, PieceColour, Piece, CastlingType, Move, \
PIECE_INDICES, init_zobrist, MoveFlags, GameState
from chess.utils import load_image, load_... | |
for chunk in lists.group(context.bytes, slot):
stack.append(chunk)
elif isinstance(slot, srop.SigreturnFrame):
stack.describe("Sigreturn Frame")
if slot.sp in (0, None) and self.base:
slot.sp = stack.next + len(slot)
registers = [slot.registers[i] for i in sorted(slot.registers.keys())]
for register in regist... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.