input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
'''
pass
def is_property_readonly(self):
'''
'''
pass
def is_property_set(self):
'''
'''
pass
def items(self):
'''
'''
pass
def keyframe_delete(self):
'''
'''
pass
def keyframe_insert(self):
'''
'''
pass
def keys(self):
'''
'''
pass
def path_from_id(self):
'''
'''
pa... | |
markers is None:
markers = [','] * data.shape[1]
if markers_sizes is None:
markers_sizes = [10] * data.shape[1]
if colors is None:
colors = ['r', 'g', 'b', 'c', 'm', 'y', 'k']
if alphas is None:
alphas = data.shape[1] * [1]
if zorders is None:
zorders = data.shape[1] * [0]
while len(colors) < data.shape[1]:
... | |
= ['i', 'information', 'INFO', 'INFORMATION'])
async def info(ctx, member: discord.Member = None):
member = member or ctx.author
delta1 = datetime.timedelta(hours = 3, minutes = 0)
mesinf = ctx.message.created_at + delta1
nowtime1 = mesinf.strftime("%X")
avatar = member.avatar_url
info1 = member.creat... | |
"""Numeric routines
Author: Dr.-Ing. <NAME>
This module offers a collection of tensor routines using numpy.
"""
# %% Import
import numpy as np
import tensor_routines as tr
# %% Products
def td(a: np.ndarray, b: np.ndarray, n: int) -> np.ndarray:
"""Tensor dot.
Shortcut for `np.tensordot(a, b, n)`.
Paramete... | |
import matplotlib.pyplot as plt
from matplotlib import pyplot
import numpy as np
np.set_printoptions(suppress=True)
import os
import pickle
import sys
import json
from importlib import reload
reload(pyplot)
sys.path.insert(0, './src')
hf_usc_indexs = {}
col_names = [
'episode_id', 'time_step',
'e_veh_... | |
--resource-group {} --priority {}
--target-condition \"{}\" --labels {} --content '{}'"""
.format(config_ids[1], LIVE_HUB, LIVE_RG, priority, condition, '"{generic_dict}"', '{configuration_payload}'),
checks=[
self.check('id', config_ids[1]),
self.check('priority', priority),
self.check('targetCondition', conditi... | |
"""
(C) Copyright 2019 IBM Corp.
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
dis... | |
= y*tan(dec)
if not keys:
keys = ['x','y','z']
if not len(keys) == 3:
logger.error('get_rotation: provided keylist need to have three components.')
return stream #self
logger.info('get_rotation: Determining rotation angle towards a magnetic coordinate system assuming z to be vertical down.')
ind1 = KEYLIST.in... | |
complete dataframe if ``columns`` parameter is supplied.
columns : list of str or :class:`pandas.Index`, optional
list with column names in correct order.
This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is
passed as ``data``.
Returns
-------
:class:`~pandas.D... | |
########################################################################
#
# Date: 2013 Authors: <NAME>, <NAME>
#
# <EMAIL>
#
# The Scripps Research Institute (TSRI)
# Molecular Graphics Lab
# La Jolla, CA 92037, USA
#
# Copyright: <NAME> and TSRI 2013
#
#################################################################... | |
<reponame>obulpathi/boltcoinpy
import os
import pytest
from pyethereum import tester, utils
import serpent
# customize VM log output to your needs
# hint: use 'py.test' with the '-s' option to dump logs to the console
tester.set_logging_level(2)
gasprice = 0
startgas = 10000
# Test EVM contracts
serpent_code = '''
... | |
import numpy as np
import tensorflow as tf
from sklearn.metrics import confusion_matrix
def channel_standardization(image):
'''
Stanadrdization of image channel wise => Standard score
Parameters:
image: Input image
Return:
Standardized image, s.t. (pixel_value -)
'''
mean_val = np.mean(image, axis=-1)
std_dev... | |
#!/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");
# you may not use this ... | |
``_CompoundClause`` has only one
item, and that item matches the given item.
"""
if not isinstance(other, _CompoundClause):
if len(self.clauses) == 1:
return self.clauses[0].compare(other)
if ClauseList.compare(self, other):
return self.operator == other.operator
else:
return False
class _CalculatedClause(Cl... | |
"""Copyright 2008 Orbitz WorldWide
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
d... | |
from JumpScale import j
from stat import *
import brotli
import hashlib
import functools
import subprocess
import pwd
import grp
import os
import sys
import re
class FListFactory(object):
def __init__(self):
self.__jslocation__ = "j.tools.flist"
def get_flist(self):
"""
Return a Flist object
"""
return FList... | |
and other
supported objects. Please check documentation of `tf.parse_example` for all
supported spec objects.
Let's say a Feature column depends on raw feature ('raw') and another
`_FeatureColumn` (input_fc). One possible implementation of
_parse_example_spec is as follows:
```python
spec = {'raw': tf.FixedLen... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
from netutils.config.parser import ConfigLine
data = [
ConfigLine(config_line="version 17.1", parents=()),
ConfigLine(config_line="service timestamps debug datetime msec", parents=()),
ConfigLine(config_line="service timestamps log datetime msec", parents=()),
ConfigLine(config_line="service call-home", parents=()... | |
<reponame>NikkaZ/dbtvault_spark
from behave import fixture
@fixture
def pit(context):
"""
Define the structures and metadata to perform PIT load
"""
context.vault_structure_type = "pit"
context.hashed_columns = {
"STG_CUSTOMER_DETAILS": {
"CUSTOMER_PK": "CUSTOMER_ID",
"HASHDIFF": {"is_hashdiff": True,
"col... | |
``node`` which will have ``size``
leaves (themselves not necessarily leaves of the actual tree).
Parameters
----------
node : frozenset[int]
The node of the tree to start with.
size : int
How many subtree leaves to aim for.
search : {'bfs', 'dfs', 'random'}, optional
How to build the tree:
- 'bf... | |
0, 0, 1, -360, 360],
[24, 319, 0.007, 0.068, 0.134, 9900, 0, 0, 0, 0, 1, -360, 360],
[25, 26, 0.036, 0.071, 0.034, 9900, 0, 0, 0, 0, 1, -360, 360],
[26, 27, 0.045, 0.12, 0.065, 9900, 0, 0, 0, 0, 1, -360, 360],
[26, 320, 0.043, 0.13, 0.014, 9900, 0, 0, 0, 0, 1, -360, 360],
[33, 34, 0, 0.063, 0, 9900, 0, 0, 0, 0, 1,... | |
default direction
if type_ == '@direction' and type_ in ctx:
rval = ctx[type_]
# get specific entry information
if key in ctx['mappings']:
entry = ctx['mappings'][key]
if entry is None:
return None
# return whole entry
if type_ is None:
rval = entry
# return entry value for type
elif type_ in entry:
rval... | |
entry is selected in the list of commands """
Model, TreeIter = Selection.get_selected()
if TreeIter != None:
CmdStartMark = self.CLITextbuffer.get_mark("CmdId")
Start = self.CLITextbuffer.get_iter_at_mark(CmdStartMark)
end = self.CLITextbuffer.get_end_iter()
self.CLITextbuffer.delete(Start, end) # replace what ... | |
if conp else 'P'
# get descriptor
name_desc = ''
other_args = {'conp': conp} if test_variable else {}
tester = dRopidT if not test_variable else dRopidE
if rxn_type == reaction_type.plog:
name_desc = '_plog'
tester = dRopi_plog_dT if not test_variable else dRopi_plog_dE
other_args['maxP'] = rate_info['plog']['... | |
target space
- p : distribution in the source space
- q : distribution in the target space
- L : loss function to account for the misfit between the similarity matrices
Parameters
----------
C1 : ndarray, shape (ns, ns)
Metric cost matrix in the source space
C2 : ndarray, shape (nt, nt)
Metric cost ... | |
40: OoO0O00 / O0
if 60 - 60: iIii1I11I1II1 / Oo0Ooo / oO0o + iII111i
if 66 - 66: iIii1I11I1II1 . O0 * IiII . ooOoO0o + i1IIi
if 83 - 83: o0oOOo0O0Ooo / II111iiii + I1IiiI - iII111i + OoO0O00
iiiii1ii11iI . mask_address ( iiiii1ii11iI . mask_len )
if 67 - 67: I1Ii111 - OoOoOO00 . i11iIiiIii - I1Ii111 . i11iIiiIii
... | |
{
'first_name': '',
'last_name': '',
'phone_number': '',
'newsletter': True,
'owner': True
}
form = MyInfoForm(data=data)
self.assertFalse(form.is_valid())
def test_my_info_form_bad_names(self):
data = {
'first_name': '$',
'last_name': 'E',
'phone_number': '415-413-4403',
'newsletter': True,
'owner': T... | |
#
# 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 ... | |
<reponame>johnmgregoire/JCAPdatavis<filename>echem_plate_ui.py
import time
import os, os.path
import sys
import numpy
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import operator
import matplotlib
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_q... | |
dictionary for the above functions to use as your input arguments,
# note it needs the ssh_conn argument which is an ConnectHandler object
# problems you can run into:
- the ssh_conn times out
- this can happen on large files and other files that take a long time
- make sure your vty timeout doesn't timeout before... | |
<reponame>Eric-Bradford/Nominal_NMPC
from pylab import *
import numpy as np
import math
from Problem_definition import *
from casadi import *
from scipy.io import savemat
import pickle
class NMPC:
def __init__(self):
# Variable definitions
self.xd, self.xa, self.u, self.ODEeq, self.Aeq, self.Obj_M, \
self.Obj_L, s... | |
so, either y-2 and y-1 are the red cols or
# neither is a a red col
# if have moved the red car, then y is on the right side of the car
# and red_car_end_a = y
if x == 2 and y-2 in self._red_car_cols():
red_car_end_a = self._red_car_end_a + 1
else:
red_car_end_a = self._red_car_end_a
ret.add( RHState(nbr_boa... | |
== '__init__':
# __init__ can be incompatible -- it's a special case.
return
first = base1[name]
second = base2[name]
first_type = first.type
if first_type is None and isinstance(first.node, FuncDef):
first_type = self.function_type(first.node)
second_type = second.type
if second_type is None and isinstance(se... | |
= get_children(elem, ['date'])
B236['date'] = resolve_date(children['date'])
return B236
def resolve_B230(elem: etree.Element) -> dict:
'''
<B230>: Other dates
'''
B230 = dict()
children = get_children(elem, ['B236', 'B238EP', 'B238'])
if 'B236' in children:
B230['B236'] = resolve_B236(children['B236'])
if '... | |
a list of the leaf nodes of a tree
including the root
"""
leaves = [node for node in tree if tree.degree(node) <= 1]
string_leaves = [l for l in leaves if (type(l) == str) and (l != 'root')]
number_leaves = [l for l in leaves if isinstance(l, Number)]
number_leaves.sort()
string_leaves.sort()
if include_root &... | |
import tensorflow as tf
import math
from tqdm import tqdm
from hmc import hmc
from tensorflow.python.platform import flags
from torch.utils.data import DataLoader, Dataset
from models import DspritesNet
from utils import optimistic_restore, ReplayBuffer
import os.path as osp
import numpy as np
from rl_algs.logger impor... | |
'Py3status'
mod_name, file_ext = os.path.splitext(os.path.split(filepath)[-1])
if file_ext.lower() == '.py':
py_mod = imp.load_source(mod_name, filepath)
if hasattr(py_mod, expected_class):
inst = py_mod.Py3status()
return (mod_name, inst)
def clear_cache(self):
"""
Reset the cache for all methods of this mod... | |
import asyncio
import json
import logging
import sys
import time
from contextlib import suppress
from functools import partial
import pytest
from aiorpcx import *
from aiorpcx.session import Concurrency, SessionBase
from util import RaiseTest
if sys.version_info >= (3, 7):
from asyncio import all_tasks
else:
from... | |
quadrant
q2 - first quadrant
q3 - first quadrant
q4 - first quadrant
data - focus on data (if angular spread is less then 10 deg
- groups (KEY) - key of keylist which defines color of points
(e.g. ('str2') in absolutes to select
different colors for different instruments
- legend (bool) - draws legend only if g... | |
# coding: utf-8
# In[ ]:
# All CIFAR experiments in the Confident Learning paper.
### Benchmark test@1 accuracies for non-cl methods in the were implemented at Google using the internal codebase and are not un
# In[1]:
import numpy as np
import cleanlab
from cleanlab import baseline_methods
from cleanlab.laten... | |
header_position == COLHEADER.ch_append:
if v_len + 1 >= maxlen:
# prepend the value, consider if we have to truncate it and omit the header altogether
value = value[:maxlen] + (' ' if maxlen == v_len + 1 else '') + ('...' if ellipsis else '')
header = ''
else:
header = header[:(maxlen - v_len - 1)] + ('...' if el... | |
<gh_stars>100-1000
# custom.py
# Author: <NAME> <<EMAIL>>
import numpy
from .base import BaseSelection
from .base import BaseGraphSelection
class CustomSelection(BaseSelection):
"""A selector based off a custom, user-defined feature-based function.
This selector wraps a custom function that is passed in by the us... | |
<reponame>duboviy/teamcity-messages
# coding=utf-8
import contextlib
import os
import platform
import sys
import pytest
import virtual_environments
from diff_test_tools import expected_messages, SCRIPT
from service_messages import ServiceMessage, assert_service_messages, has_service_messages
from test_util import run... | |
index -1 from the list. Same list length.
else:
node_to_replace = self._head.get_back(self)
node.set_back(self, self._head.get_back(self).get_back(self))
node.set_next(self, self._head)
self._head.get_back(self).get_back(self).set_next(self, node)
self._head.set_back(self, node)
node_to_replace._links.pop(self.... | |
# -*- coding: utf-8 -*-
"""
MagicTelecomAPILib.Controllers.AccountsController
This file was automatically generated by APIMATIC BETA v2.0 on 06/22/2016
"""
from MagicTelecomAPILib.APIHelper import APIHelper
from MagicTelecomAPILib.APIException import APIException
from MagicTelecomAPILib.Configuration impor... | |
<filename>commons/process_mols.py
import math
import warnings
import pandas as pd
import dgl
import numpy as np
import scipy.spatial as spa
import torch
from Bio.PDB import get_surface, PDBParser, ShrakeRupley
from Bio.PDB.PDBExceptions import PDBConstructionWarning
from biopandas.pdb import PandasPdb
from rdkit impor... | |
"""RGN model for 3D protein structure prediction.
The implicit ordering of tensor dimensions is:
[NUM_STEPS, BATCH_SIZE, NUM_DIHEDRALS, NUM_DIMENSIONS]
Tensors have this orientation unless otherwise labeled.
"""
import os
from glob import glob
from copy import deepcopy
from itertools import zip_longest
import nump... | |
#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Classes and constants for the representation of repositories
:author: <NAME>
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wit... | |
/ seg
t = 0
for i in range(seg):
xb = base * cos(t)
yb = base * sin(t)
xc = cap * cos(t)
yc = cap * sin(t)
verts.append((xb, yb, zb))
verts.append((xc, yc, zc))
t += angle
for i in range(seg):
f = i * 2
if i == seg - 1:
faces.append([0, 1, f + 1, f])
else:
faces.append([f + 2, f + 3, f + 1, f])
if base ... | |
<gh_stars>0
from __future__ import print_function
import numpy as np
import sys
try:
import keplertools.CyKeplerSTM
except ImportError:
pass
"""
Kepler State Transition Matrix
Class container for defining a planetary system (or group of planets in multiple
systems) via their gravitational parameters and state vec... | |
from contextlib import contextmanager
from StringIO import StringIO
import logging
from posix import rmdir
import unittest
import os
from time import time
from eventlet import GreenPool
from hashlib import md5
from tempfile import mkstemp, mkdtemp
from shutil import rmtree
from copy import copy
import math
import tarfi... | |
<gh_stars>10-100
#
# python_grabber
#
# Authors:
# <NAME> <<EMAIL>>
#
# Copyright (C) 2019 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... | |
with value 5.
"""
assert_bindings(
schema="nistData/list/NMTOKEN/Schema+Instance/NISTSchema-SV-IV-list-NMTOKEN-minLength-1.xsd",
instance="nistData/list/NMTOKEN/Schema+Instance/NISTXML-SV-IV-list-NMTOKEN-minLength-1-3.xml",
class_name="NistschemaSvIvListNmtokenMinLength1",
version="1.1",
mode=mode,
save_output=... | |
>>> G.in_edges(2, 'all')
(tensor([0, 1]), tensor([2, 2]), tensor([1, 2]))
>>> G.in_edges(2, 'eid')
tensor([1, 2])
For multiple nodes:
>>> G.in_edges([1, 2])
(tensor([0, 0, 1]), tensor([1, 2, 2]))
>>> G.in_edges([1, 2], 'all')
(tensor([0, 0, 1]), tensor([1, 2, 2]), tensor([0, 1, 2]))
"""
v = utils.toindex(v)
... | |
"""ACIL_GetImage is a module developed for the internal use of the Applied Chest Imaging Laboratory to download
cases stored in MAD server via ssh.
It works both in Unix/Mac/Windows, and it uses an internal SSH key created specifically for this purpose, so it
doesn't need that the user has an authorized SSH key install... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 5 19:28:45 2018
@author: xingrongtech
"""
from quantities.quantity import Quantity
from .num import Num
from .const import Const
from .numitem import NumItem
from .lsym import LSym
from .system.unit_open import openUnit, closeUnit
from .system.format_units import format_... | |
<filename>trainer/train_las_bmuf_otfaug.py
"""
LAS model/rescorer Training Script
"""
#system utils
import sys
import argparse
import importlib
import os
import os.path
import math
import numpy as np
#torch related
import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
from tor... | |
are deleted. For more information, see Stopping an instance.
Args:
request: (ComputeInstancesStopRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.
"""
config = self.GetMethodConfig('Stop')
return self._RunMethod(
config, ... | |
<reponame>diassor/CollectorCity-Market-Place<gh_stars>100-1000
import datetime
import logging
import random
from urlparse import urlparse
from django.db import transaction
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
import b... | |
<reponame>ace-ecosystem/ACE
# vim: sw=4:ts=4:et:cc=120
#
# Carbon Black Collector
#
import json
import datetime
import dateutil.parser
import logging
import saq
from saq import proxy
from saq.collectors import Collector, Submission
from saq.constants import *
from saq.error import report_exception
from saq.persiste... | |
if t not in tables.tags:
self.error('missing section: [tabletags-%s]' % t,halt=True)
if self.separator:
# Evaluate escape characters.
self.separator = literal_eval('"'+self.separator+'"')
#TODO: Move to class Tables
# Check global table parameters.
elif config.pagewidth is None:
self.error('missing [miscellaneo... | |
"""
################################################################################
Parallel-and-asynchronous Stitching Script - Parallel version
Author: <NAME>
This script pulls the data generated through TissueCyte (or another microscope system) and
can perfom image averaging correction on the images if requested,... | |
# Licensed under MIT License.
# See LICENSE in the project root for license information.
"""Binary tree traversal.
Routines
--------
inorder_traverse(tree: `SupportedTreeType`, recursive: `bool`)
Perform in-order traversal.
preorder_traverse(tree: `SupportedTreeType`, recursive: `bool`)
Perform pre-order traversal.... | |
import numpy as NP
import copy
from astropy.io import fits
from astropy.io import ascii
from astropy import coordinates as coord
from astropy.coordinates import Galactic, FK5
from astropy import units
import astropy.cosmology as CP
import scipy.constants as FCNST
from scipy import interpolate
import matplotlib.pyplot a... | |
#
# Copyright (c) 2017 Orange.
#
# 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, so... | |
<reponame>pquentin/trio-asyncio
# This code implements a clone of the asyncio mainloop which hooks into
# Trio.
import sys
import trio
import asyncio
import warnings
import threading
from contextvars import ContextVar
from async_generator import async_generator, yield_, asynccontextmanager
from ._util import run_aio... | |
provides the same result.
# TODO: Write expansion of small multi-axis rotation tests
- Angles between axes: Since the entire system is to be rotated as one, rigid body, the orthogonality of the
three axes must be kept true. Tiny anomalies are acceptable due to float point accuracy.
- Linked rotation error: The ... | |
var ci = @{{classinfo}}.__array[index];
if (@{{isinstance}}(@{{object_}}, ci)) {
return true;
}
}
return false;
} else {
return @{{_isinstance}}(@{{object_}}, @{{classinfo}});
}
""")
def _isinstance(object_, classinfo):
JS("""
if (@{{object_}}.__is_instance__ === false && @{{classinfo}}.__is_instance__ === f... | |
type as `s0`.
name: A name for the operation (optional).
Returns:
A tuple of `Tensor` objects (r0, r1).
r0: A `Tensor`. Has the same type as `s0`.
r1: A `Tensor`. Has the same type as `s0`.
"""
_ctx = _context._context or _context.context()
tld = _ctx._thread_local_data
if tld.is_eager:
try:
_result = pywr... | |
by means
# of INIT-VALUE-REF elements. Unfortunately, these are not
# standard references so we have to go down a separate
# code path...
ref_elem = signal_elem.find(f'./ns:INIT-VALUE-REF',
self._xml_namespaces)
if ref_elem is None:
# no initial value found here
return None
literal_spec = \
self._follow_arx... | |
<reponame>gmberton/deep-visual-geo-localization-benchmark<filename>test.py
import faiss
import torch
import logging
import numpy as np
from tqdm import tqdm
from torch.utils.data import DataLoader
from torch.utils.data.dataset import Subset
def test_efficient_ram_usage(args, eval_ds, model, test_method="hard_resize"... | |
from typing import Callable, Union, Any
from enum import Enum
import numpy as np
from casadi import sum1, horzcat, if_else, vertcat, lt, MX, SX, Function
import biorbd
from .path_conditions import Bounds
from .penalty import PenaltyType, PenaltyFunctionAbstract, PenaltyOption, PenaltyNodes
from ..dynamics.ode_solver ... | |
ct
return None
def max_type_score(self, t):
return 0 if t not in self.tis else max([ti.ms for ti in self.tis[t]])
def set_as_list_or_singleton(v):
s = set(v)
if len(s) < 1: return 0
l = list(s)
return l[0] if len(l) < 2 else l
def unique_cell_values(vs, maxListLength = 3):
''' Returns a unique value per cel... | |
<filename>python/example_code/ses/ses_replicate_identities.py
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to use the AWS SDK for Python (Boto3) with Amazon Simple Email Service
(Amazon SES) and Amazon Route 53 to copy email and domai... | |
self.document = document
self.target_handler = target_handler
self.compound_parser = compound_parser
self.filter_ = filter_
self.context = None # type: Optional[RenderContext]
self.output_defname = True
# Nesting level for lists.
self.nesting_level = 0
def set_context(self, context: RenderContext) -> None:
s... | |
per inch of the figure
plotting_column (str): the name of the column to plot
discrete_colours (bool): if true use a discrete colourmap
NColours (int): the number of colours to cycle through when making the colourmap
colour_log (bool): If true the colours are in log scale
Basin_remove_list (list): A lists containin... | |
copy of a Series excluding elements from groups that
do not satisfy the boolean criterion specified by func.
Parameters
----------
func : function
To apply to each group. Should return True or False.
dropna : Drop groups that do not pass the filter. True by default;
if False, groups that evaluate False are fill... | |
[A[j + k] for j in range(1, self.column - k + 1)])
return W
else:
return A
HNF = hermiteNormalForm
def _SimplifyHNF(self):
"""
This method is a common process used in
extHNF() and kernelAsModule()
"""
A = self.copy()
U = unitMatrix(A.column, A.coeff_ring)
rings = self.coeff_ring
# step 1 [Initialize]
j... | |
import ast
import json
import math
import re
import sys
import traceback
from six import string_types
##############################################################################################################
# This is a JSON parser that isn't as strict as the normal json libraries.
# I can't believe a library fo... | |
+ 1,
'IPAddress': ["192.168.0.2"],
'IPSubnet' : ["255.255.255.0"],
'DefaultIPGateway' : ["192.168.0.1"],
'AssignMethod' : 'static',
'DNSServers' : ['8.8.8.8','8.8.4.4']
})
elif answer['option'] == 'Search vendor':
while True:
mac_list = get_mac_list()
device = search_wildcard_vendor(mac_list, '*')
answer = p... | |
# -*- coding: utf-8 -*-
"""
Create vertical grid in WRF using smooth stretching functions.
Authors
-------
<NAME> and <NAME>
- stretching functions
<NAME> and <NAME>
- plotting, testing
"""
import numpy as np
from scipy import integrate, interpolate
import os
import matplotlib.pyplot as plt
import xarray as xr
im... | |
= Var(within=Reals,bounds=(0,3.14159265358979),initialize=0.785398163397448)
m.x597 = Var(within=Reals,bounds=(0,3.14159265358979),initialize=0.785398163397448)
m.x598 = Var(within=Reals,bounds=(0,3.14159265358979),initialize=0.785398163397448)
m.x599 = Var(within=Reals,bounds=(0,3.14159265358979),initialize=0.78539816... | |
batch
# Reset things as necessary
enz_curr = []
enz_remain = list(enzymes) # all enzymes to start each batch
snps_curr_batch = dict()
print("Batch number: %d" % batch_num)
print("Number of enzymes to test: %d" % len(enz_remain))
print("Number of availalbe SNPs: %d" % len(available_snps))
while ((len(snps_curr_... | |
import copy
import math
from dataclasses import dataclass, fields
from typing import Optional, Tuple, List, NamedTuple, Union, Iterable, Dict
from pathlib import Path
import pickle
from enum import Enum
import functools
from collections import Counter
import logging
import pandas as pd
import numpy as np
from .physio... | |
0, 0, 0, 0],
[1, 1, 1, 0, 1, 1, 1, 0],
[1, 0, 1, 0, 1, 0, 1, 0],
[1, 0, 1, 0, 1, 0, 1, 0],
[1, 0, 1, 0, 1, 0, 1, 0],
[1, 1, 1, 0, 1, 0, 1, 0]
],
"off": [
[1, 1, 1, 0, 0, 0, 0, 0],
[1, 0, 1, 0, 0, 0, 0, 0],
[1, 0, 1, 5, 5, 0, 0, 0],
[1, 1, 1, 5, 0, 1, 1, 0],
[0, 0, 0, 5, 5, 1, 0, 0],
[0, 0, 0, 5, 0, 1, 1, 0... | |
"""Provides a simple way to work with configuration files.
This module can translate a ConfigParser-style configuration file into a
simple dict, wrapping that with a :py:class:`Conf` class providing
convenient "get" functions that work much like dict's "get" method
(return None or the default value provided if the sec... | |
<reponame>MScResearch/EEGprocessing
"""
This is nedfReader, a class to read ".nedf" files and obtain its data.
It is an object that contains data from nedf file,
and provides methods to obtain this information.
2018 Neuroelectrics Corporation
Created on Tue Feb 14 2018
@author: sergi and giulio (NE)
"""
from __futur... | |
"solvers"]
info(" ".join(argv))
with subprocess.Popen(argv, stdout=subprocess.PIPE,
stderr=sys.stderr) as p:
with tarfile.open(mode="r|", fileobj=p.stdout) as t:
t.extractall(args.output_dir)
os.rename(os.path.join(args.output_dir, "solvers"), dest_dir)
#
##
##
#
# repository management
FROM_UPTODATE = set()
... | |
= root.get_observable(test_observable.id)
self.assertIsNotNone(test_observable)
self.assertIsNotNone(test_observable.get_analysis(WaitAnalysis_A))
self.assertFalse(test_observable.get_analysis(WaitAnalysis_B))
self.assertIsNotNone(test_observable.get_analysis(WaitAnalysis_C))
def test_post_analysis_after_false_re... | |
tstamp=None, asr=None, acd=None, action=None,):
self.i_connection_quality_stats = i_connection_quality_stats
self.i_connection = i_connection
self.tstamp = tstamp
self.asr = asr
self.acd = acd
self.action = action
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isins... | |
center_y + eps
# area
bb = ia.BoundingBox(y1=10, x1=20, y2=30, x2=40, label=None)
assert bb.area == (30-10) * (40-20)
# project
bb = ia.BoundingBox(y1=10, x1=20, y2=30, x2=40, label=None)
bb2 = bb.project((10, 10), (10, 10))
assert 10 - eps < bb2.y1 < 10 + eps
assert 20 - eps < bb2.x1 < 20 + eps
assert 30 - ... | |
<filename>malloovia/lpsolver.py<gh_stars>1-10
# coding: utf-8
# import pandas as pd
"""Malloovia interface to LP solver"""
from typing import Sequence, List, Any
from itertools import product as cartesian_product
from inspect import ismethod
from collections import namedtuple
from uuid import uuid4
import os
import ... | |
<filename>Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/certificates/tests/test_api.py
"""Tests for the certificates Python API. """
import uuid
from contextlib import contextmanager
from datetime import datetime, timedelta
from unittest import mock
from unittest.mock impor... | |
place where a Violation
# can be raised: it is caught and passed cleanly to the parent. If
# it happens anywhere else, or if any other exception is raised, the
# connection will be dropped.
# the downside to this approach is that .slice happens before
# .registerReference, so any late-validation being done in .sl... | |
pilot; yet, wert thou as far
As that vast shore wash'd with the farthest sea,
I would adventure for such merchandise.
Jul. Thou knowest the mask of night is on my face;
Else would a maiden blush bepaint my cheek
For that which thou hast heard me speak to-night.
Fain would I dwell on form- fain, fain deny
What I... | |
<gh_stars>1-10
#!/usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source c... | |
from functools import reduce
import re
strings = []
number_of_strings = -1
def top_level_split(s):
"""
Split `s` by top-level commas only. Commas within parentheses are ignored.
"""
# Parse the string tracking whether the current character is within
# parentheses.
balance = 0
parts = []
part = ""
for i i... | |
pwd_mgr = urllib2.HTTPPasswordMgr()
pwd_mgr.add_password(realm, uri, self.user, self.passwd)
opener = urllib2.build_opener()
opener.add_handler(urllib2.HTTPDigestAuthHandler(pwd_mgr))
urllib2.install_opener(opener)
else:
valid_types = ", ".join(_allowedAuth)
raise NotImplementedError("Expecting one of: {0}, but ... | |
<gh_stars>0
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dyn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.