input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
0.00435488,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.187265,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic':... | |
h = HTMLParser()
cliente = h.unescape(cliente)
rows = db(db.articolo_in_listino.nome_cliente == cliente,db.articolo_in_listino == listino).select()
for row in rows:
if row['listino'] == listino:
if row['codice_articolo'] == articolo:
# print "OK"
end = int(row['numero_pezzi'])
if (int(nume... | |
or woman.house == self.displayHouse:
messageString = str(self.year) + ": #" + str(man.id) + " (age " + str(man.age) + ")"
messageString += " and #" + str(woman.id) + " (age " + str(woman.age)
messageString += ") marry."
self.textUpdateList.append(messageString)
def updateUnemploymentRates(self):
# Ass... | |
1633, 3338, 3558, 1699, 3383, 6187, 3603,
3778, 3823, 1765, 2494, 3989, 2615, 3998, 4043,
2725, 1812, 1822, 1831, 52, 1641, 3346, 3566,
1707, 3391, 6195, 3611, 3786, 3831, 1773, 3427,
6231, 3647, 6351, 6679, 3867, 4006, 4051, 4087,
1839, 2505, 4209, 2626, 4218, 4263, 2736, 4226,
4271, 4307, 2835, 1878, 1888, 1897... | |
<filename>simopt/models/sscont.py<gh_stars>10-100
"""
Summary
-------
Simulate multiple periods worth of sales for a (s,S) inventory problem
with continuous inventory.
"""
import numpy as np
from base import Model, Problem
class SSCont(Model):
"""
A model that simulates multiple periods' worth of sales for a (s,S)... | |
iobase.SourceBundle(
weight=weight,
source=self,
start_position=bundle_start,
stop_position=stop_position,
)
def get_range_tracker(
self,
start_position: Union[int, str, ObjectId] = None,
stop_position: Union[int, str, ObjectId] = None,
) -> Union[
_ObjectIdRangeTracker, OffsetRangeTracker, LexicographicKey... | |
<gh_stars>1-10
#! /usr/bin/env python3
# coding=utf-8
# Copyright (c) 2019 Uber 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-... | |
<filename>test/src/TheLib.py<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
from __future__ import annotations
# from _typeshed import NoneType
import copy
import glob
import os
from datetime import datetime
from shutil import Error
from sys import exit as x
from typing import List, Union
from zipfile import erro... | |
createListing = CreateListing(request.form)
listingDict = {}
try:
db = shelve.open('storage.db', 'r')
listingDict = db['Listings']
db.close()
except:
print('???????')
return render_template('allListing.html',count=len(listingDict),form=createListing,listingDict=listingDict,selected_category=createListing.fil... | |
name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param user_id: API Management UserId subscribed to notification.
:type user_id: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_at... | |
# coding=utf-8
# Copyright Studio-Ouisa and The HuggingFace Inc. team. 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
#
# ... | |
# coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from openlatti... | |
u0 {2,S} {3,S} {4,S} {5,S}
2 CS u0 {1,S} {8,D}
3 Cd u0 {1,S} {6,D}
4 Cd u0 {1,S} {7,D}
5 Cb u0 {1,S}
6 C u0 {3,D}
7 C u0 {4,D}
8 S2d u0 {2,D}
""",
thermo = None,
shortDesc = u"""""",
longDesc =
u"""
""",
)
entry(
index = -1,
label = "Cs-C=S(Cds-Cdd)(Cds-Cdd)Cb",
group =
"""
1 * Cs u0 {2,S} {3,S} {4,S} {5,S}
2... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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... | |
1 for k in range(0, n + 1)]
k = 1
while k != 0:
yield p
if p[n] > 0:
p[n] = p[p[n]]
yield p
k = n
while k > 0 and p[k] == 0:
k -= 1
if k != 0:
j = p[k]
d = k - j
not_done = True
while not_done:
if p[k - d] == p[j]:
p[k] = p[j]
else:
p[k] = p[k - d] + d
if k == n:
not_done = False
else:
k += 1
de... | |
[], [],
''' Configure peer on the interface
''',
'peer',
'Cisco-IOS-XR-lib-mpp-cfg', False),
],
'Cisco-IOS-XR-lib-mpp-cfg',
'peers',
_yang_ns._namespaces['Cisco-IOS-XR-lib-mpp-cfg'],
'ydk.models.cisco_ios_xr.Cisco_IOS_XR_lib_mpp_cfg'
),
},
'ControlPlane.ManagementPlaneProtection.Outband.InterfaceSelection.... | |
<filename>electroncash/slp_checker.py
import json
from .util import NotEnoughFundsSlp, NotEnoughUnfrozenFundsSlp, print_error
from . import slp, networks
from .slp import SlpParsingError, SlpInvalidOutputMessage, SlpUnsupportedSlpTokenType
from .slp_preflight_check import SlpPreflightCheck
from .transaction import Tran... | |
<gh_stars>0
# pyflyby/_autoimp.py.
# Copyright (C) 2011, 2012, 2013, 2014, 2015, 2018, 2019 <NAME>.
# License: MIT http://opensource.org/licenses/MIT
from __future__ import (absolute_import, division, print_function,
with_statement)
import ast
import contextlib
import copy
import six
from six import PY2, PY3, exec_,... | |
<reponame>AnthonyQuantum/open_model_zoo
"""
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appl... | |
correctors
correctorsListT, KmsijT, MmsijT, BdmsijT, muTPrime = UpdateElements(tol*np.max(E_vh), E, KmsijT, MmsijT, BdmsijT, correctorsListT, muTPrime) # tol scaled by maximal error indicator
print('---- finished computation of correctors')
KLOD = pglod.assembleMsStiffnessMatrix(world, patchT, KmsijT) # ms stiffne... | |
<filename>qmla/shared_functionality/probe_set_generation.py
r"""
Functions to generate sets of probe states to be used for training models.
These functions are set to exploration strategy attributes, which are then called in wrapper functions.
- probe_generation_function:
used for training, assumed to be the probes... | |
Summe 2014"),
"op1": (x1, 0.85, "OPSD"),
"op2": (x2, 0.85, "{0} GWh".format(int(opsd_sum))),
"reg1": (x1, 0.70, "reegis"),
"reg2": (x2, 0.70, "{0} GWh".format(int(reegis_sum))),
"bmwi1": (x1, 0.55, "BMWi"),
"bmwi2": (x2, 0.55, "{0} GWh".format(int(bmwi_sum))),
}
for t, c in text.items():
if t == "title":
w =... | |
<gh_stars>1-10
"""
TODO:
- Feature: Clicking on a point in the parameter space plots the integral curve with that initial condition
so that the parameter space can be explored interactively.
- Feature: Link the x axes for all the plots in 1D embedding domain.
-
"""
import glob
import heisenberg.library.util
import ma... | |
get_object_or_404(MachineDetailPlugin, pk=plugin_id)
plugin.delete()
return redirect('settings_machine_detail_plugins')
@login_required
def machine_detail_plugin_enable(request, plugin_name):
# only do this if there isn't a plugin already with the name
try:
plugin = Plugin.objects.get(name=plugin_name)
except Pl... | |
"""
PEG Parsing Machine
Inspired by Medeiros and Ierusalimschy, 2008, "A Parsing Machine for PEGs"
"""
from typing import Union, Tuple, List, Dict, Optional, Any
from enum import IntEnum
import re
from pe._constants import FAIL as FAILURE, Operator, Flag
from pe._errors import Error
from pe._match import Match
fro... | |
+ ')'))
new_str_y = str(simplify('(' + self.form_1_str_y + ')*(' + to_wedge_0_form_str + ')'))
# keep it as it is locally to supply it to object maker later
form_1_str_x_loc = new_str_x + ''
form_1_str_y_loc = new_str_y + ''
# format it to be in terms of grids and:
# check against constant and zero 1-forms being ... | |
<reponame>tnorlund/aws-analytics
# pylint: disable=redefined-outer-name, unused-argument
import pytest
import numpy as np
from dynamo.entities import Session, Visit, Visitor, Browser # pylint: disable=wrong-import-position
from dynamo.entities import Year, Month, Week, Day, Page # pylint: disable=wrong-import-position
... | |
= true_pos / true_pos + false_neg
harmonic mean of Precision and Recall (F1) = 2(P x R) / (P + R)
From scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html
y_pred = result, the predicted labels generated by Karoo GP
y_true = solution, the true labels associated with the da... | |
<filename>src/fsm2c.py
import re
import sys
import textwrap
import json
import hashlib
import proto_helpers as ph
EXPIRES_NEVER = 'UINT64_MAX'
class BRACES(object):
def __init__(self, gen, head=None, **context):
self.gen = gen
self.head = head
self.context = context
def __enter__(self):
if self.head:
self.... | |
the objects concerned.
notify_msg = [msg for msg in messages if msg['To'] == '<EMAIL>'][0]
mail_text = self._extract_message_body(notify_msg)
assert notify_msg['Subject'] == 'Notification of TEST database changes'
assert notify_msg['From'] == '<EMAIL>'
assert '\n> Message-ID: <1325754288.4989.6.camel@hostname>\n' ... | |
<gh_stars>0
from django.db import models
from django.utils import timezone
from django.core.validators import MaxValueValidator, MinValueValidator
from django.core.urlresolvers import reverse
from django.conf import settings
# # # # # # # # # # # # # # # # # # # # # # # # # # #
# Level 0: base abstract and infrastruc... | |
self._user = value
@property
def content(self):
"""
Returns the value of the `content` property.
"""
return self._content
@content.setter
def content(self, value):
"""
Sets the value of the `content` property.
"""
self._content = value
class Sso(Struct):
def __init__(
self,
methods=None,
):
super(... | |
<reponame>affinitic/relstorage
##############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany... | |
#!/usr/bin/env python
# coding: utf-8
# # Plot Comparison Between Algorithms
# Expects the input data to contain CSV files containing episode lengths
import os
import numpy as np
import matplotlib.pyplot as plt
from stats import getMean, getMedian, getBest, getWorst, getConfidenceIntervalOfMean, getRegion
from load... | |
"""Class for a collection of grid properties"""
version = '24th November 2021'
# Nexus is a registered trademark of the Halliburton Company
import logging
log = logging.getLogger(__name__)
log.debug('property.py version ' + version)
import os
import numpy as np
import resqpy.olio.ab_toolbox as abt
import resqpy.... | |
import uuid
from unittest.mock import Mock, patch
import pytest
import requests_mock
from teatime import Context, Issue, NodeType, PluginException, Report, Severity
from teatime.plugins.ipfs import (
AddPin,
ChangeLogLevel,
CIDFSEnum,
CommandCheck,
DependencyVersion,
EnumerateLogs,
EnumeratePins,
FilestoreEnu... | |
list of graphic
handles: [line, patch].
Examples
--------
.. plot::
:context: close-figs
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from pyyeti import dsp
>>> x = np.arange(1.0, 31.0, 1.0)
>>> y = np.cos(x)
>>> fig = plt.figure('Example', figsize=[10, 8])
>>> fig.clf()
>>>
>>> ax = p... | |
Routes that are pending (e.g. the relevant port isn't online yet)
Add the route 'route' to the set 'key' in route_cache for the router
given by router_id.
:param key: The type of route (added, pending)
:type key: one of: ROUTE_ADDED, ROUTE_TO_ADD
:param router_id: The ID of the router owning the route
:type rout... | |
<reponame>otus-devops-2019-02/yyashkin_infra<filename>ansible/my_env/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_snapshot_schedule.py<gh_stars>1-10
#!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""Eleme... | |
"""
********************************************************************************
* Name: map_view.py
* Author: <NAME>
* Created On: May 2015
* Copyright: (c) Brigham Young University 2015
* License: BSD 2-Clause
********************************************************************************
"""
from .base import T... | |
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.134517,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 4.42287,
'S... | |
<filename>test/test_fifo_speculative.py<gh_stars>10-100
import unittest
import itertools
from myhdl import *
from myhdl_lib.fifo_speculative import fifo_speculative
from myhdl_lib import sfifo_beh
import myhdl_lib.simulation as sim
class TestSFifo(unittest.TestCase):
COMMIT = 0
DISCARD = 1
DISCARD_COMMIT = 2
@... | |
= 0)).reshape((1,1,cell.n[2]))
'''
ftwRef[i,ii,:] = (Vfac*sum(sum(rhoTilOverRho * exp(1j*q.q_list[0][i]*x)*
exp(1j*q.q_list[1][ii]*y),axis = 0),axis=0))
'''
ftwCollector[i,ii,:] *= laux
ftwCollector[i,ii,:] *= lauy
ftwCollector[i,ii,:] *=SF[i,ii,0]
ftwCollector[i,ii,:] = ftwCollector[i,ii,:]/(lattice.repe... | |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: mxh @time:2019/5/1 12:43
"""
import hashlib
import httplib
import logging
import re
class HTTPError(Exception):
def __init__(self, status_code, log_message=None, *args):
self.status_code = status_code
self.log_message = log_message
self.args ... | |
# coding: utf-8
"""
ESP Documentation
The Evident Security Platform API (version 2.0) is designed to allow users granular control over their Amazon Web Service security experience by allowing them to review alerts, monitor signatures, and create custom signatures.
OpenAPI spec version: v2_sdk
Generated by: htt... | |
<reponame>lcx366/SLRfield
from os import system,path,makedirs
from pathlib import Path
from ftplib import FTP
import requests
from bs4 import BeautifulSoup
from astropy.time import Time
from ..utils.try_download import tqdm_ftp,tqdm_request
def download_bycurrent(source,satnames,append=False):
"""
Download the late... | |
if shape.shape_type == aw.drawing.ShapeType.TEXT_BOX]))
self.assertEqual(1, len([shape for shape in shapes if shape.shape_type == aw.drawing.ShapeType.IMAGE]))
for shape in shapes:
if shape.shape_type == aw.drawing.ShapeType.TEXT_BOX:
replacement_shape = aw.drawing.Shape(doc, aw.drawing.ShapeType.IMAGE)
replaceme... | |
= {'ssid': 'open',
'proxy_arp': '1',
'ap_isolate': '1',
'bridge': 'ap-br0',
'disable_dgaf': '1'}
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
try:
hapd.enable()
except:
# For now, do not report failures due to missing kernel support
raise HwsimSkip("Could not start hostapd - assume proxyarp not sup... | |
x in triaged])
return triaged
def can_merge(self, others):
if any(len(self._maps) != len(o._maps) for o in others):
return False
for (k, v) in self._maps.items():
if any(k not in o._maps for o in others):
return False
if not v.can_merge([o._maps[k] for o in others]):
return False
return True
def merge(self... | |
# author: <NAME>, <NAME>, <NAME>, <NAME>
# date: 2020-06-02
"""
This script cleans the census dataset for a given year and saves them to
the file_path provided. This script takes the census year and the csv file
containing the census data as arguments.
Usage: src/02_clean_wrangle/05_clean_census.py --census_file=<cen... | |
<filename>mindquantum/core/gates/basicgate.py
# -*- coding: utf-8 -*-
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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/l... | |
unit object or string or tuple
The unit to convert to. If a tuple of units is specified, this
method returns true if the unit matches any of those in the tuple.
equivalencies : list of equivalence pairs, optional
A list of equivalence pairs to try if the units are not
directly convertible. See :ref:`unit_equivale... | |
import math
from itertools import product
from collections.abc import Iterable
import warnings
import numpy as np
import scipy as sp
from matplotlib import colors
from spatialmath import base as smbase
try:
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
from mpl_toolkits.mplot3d.art3d import... | |
<reponame>politbuero-kampagnen/onegov-cloud<filename>tests/onegov/org/test_views_directory.py
from datetime import timedelta, datetime
from io import BytesIO
import transaction
from purl import URL
from pytz import UTC
from sedate import standardize_date, utcnow, to_timezone, replace_timezone
from webtest import Uploa... | |
meter_data.index,
temperature_data,
heating_balance_points=[54],
cooling_balance_points=[67],
use_mean_daily_values=False,
)
data = merge_features([meter_data, temperature_features])
return data
def test_caltrack_predict_design_matrix_input_avg_false_output_avg_true(
cdd_hdd_h54_c67_billing_monthly_totals
):
... | |
282, 293,
296, 338, 347, 354, 361, 363, 380, 452, 458, 491, 492, 520, 535]), s=array([ 14, 124, 143, 178, 213, 228, 252, 257, 272, 276, 332,
360, 366, 414, 449, 468, 503, 542, 570, 595, 648, 680,
748, 786, 881, 945, 964, 969, 975, 996, 1006, 1024, 1034,
1067, 1092, 1105, 1132, 1173, 1182, 1227, 1231, 1275, 1314, 13... | |
<reponame>Quirinwierer/dracoon-python-api<filename>dracoon/groups.py
"""
Async DRACOON users adapter based on httpx and pydantic
V1.0.0
(c) <NAME>, November 2021
Collection of DRACOON API calls for user management
Documentation: https://dracoon.team/api/swagger-ui/index.html?configUrl=/api/spec_v4/swagger-config#/gro... | |
subir ou descer do veículo'),
('V13.4', 'Ciclista traumatizado em colisão com um automóvel, "pick up" ou caminhonete - condutor traumatizado em um acidente de trânsito'),
('V13.5', 'Ciclista traumatizado em colisão com um automóvel, "pick up" ou caminhonete - passageiro traumatizado em um acidente de trânsito'),
('V... | |
from abc import ABC, abstractmethod
import re
import numpy as np
from ..wrappers import Dropout
from ..utils import calc_pad_dims_2D
from ..activations import Tanh, Sigmoid, ReLU, LeakyReLU, Affine
from ..layers import (
DotProductAttention,
FullyConnected,
BatchNorm2D,
Conv1D,
Conv2D,
Multiply,
LSTMCell,
Add... | |
# And parameter data?
Y = df[param].values
# Remove nans...
tmp_df = pd.DataFrame(np.array([X, Y]).T, columns=['X', 'Y'])
print(tmp_df.shape)
tmp_df = tmp_df.dropna()
print(tmp_df.shape)
X = tmp_df['X'].values
Y = tmp_df['Y'].values
# PLOT UP as X vs. Y scatter...
title = '{} ({})'.format(param, sub_df['Indep... | |
<filename>google/apps/drive/activity/v2/drive-activity-v2-py/google/apps/drive/activity_v2/types/action.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | |
from abc import abstractmethod
from math import ceil, log2
from ..util import SaveLoad, load
class Traversal(SaveLoad):
"""Base image traversal class.
Attributes
----------
classes : `dict`
Image traversal class group.
"""
classes = {}
@abstractmethod
def __call__(self, width, height, ends=True):
"""Trav... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------#
# OverRule: Overlap Estimation using Rule Sets #
# @Authors: <NAME>, <NAME>, #
# <NAME> #
# ----------------------------------------------#
import logging
import os
import numpy as np
import pandas as pd
from .load_process... | |
#!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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 i... | |
'prepend'
def is_overwrite_all(self):
"""
Check if the union tag is ``overwrite_all``.
:rtype: bool
"""
return self._tag == 'overwrite_all'
def is_other(self):
"""
Check if the union tag is ``other``.
:rtype: bool
"""
return self._tag == 'other'
def _process_custom_annotations(self, annotation_type, p... | |
#-*- coding:utf-8 -*-
import functools
import numbers
import time
import calendar
import datetime
from contextlib import contextmanager
import spiceminer._spicewrapper as spice
__all__ = ['Time']
### Miscellaneuos helpers ###
@contextmanager
def _no_argcheck():
'''Hax! Avoid unnecessary type checking.
Used for ... | |
54602: "4369 4469 4533",
54603: "4369 4469 4534",
54604: "4369 4469 4535",
54605: "4369 4469 4536",
54606: "4369 4469 4537",
54607: "4369 4469 4538",
54608: "4369 4469 4539",
54609: "4369 4469 4540",
54610: "4369 4469 4541",
54611: "4369 4469 4542",
54612: "4369 4469 4543",
54613: "4369 4469 4544",
54614: "... | |
nodes)
self.memcache.store = {}
proxy_server.http_connect = \
fake_http_connect(404, 404, 404, 503, 201, 503)
exc = None
try:
partition, nodes = \
self.controller.account_info(self.account, autocreate=True)
except Exception, err:
exc = err
self.assertEquals(str(exc),
"Could not autocreate account '/some_acc... | |
that forecast time],...]
If the weather api did not return the requested number of
records, in addition to 'weather_results' there will also be a
'weather_warn' key.
In case of errors, error message will be in the key
'weather_error'.
For example:
Input: [{'lat': 39.0693, 'long': -94.6716},
{"zipcode":99353} ... | |
<reponame>ainfinum/Advanced-Lane-Finding
import os
import pickle
import cv2
import glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import imageio
from moviepy.editor import VideoFileClip
class Lane():
def __init__(self, mtx, dist):
self.mtx = mtx
self.dist = dist
self.f... | |
test(self, channel, mode, param=None):
"""
probes if the CAN interface (hardware and driver) given by the argument 'channel' is present,
and if the requested operation mode is supported by the CAN controller.
:param channel: channel number of the CAN interface
:param mode: operation mode to be checked
:param par... | |
<filename>lasagne_nlp/utils/data_processor.py
# __author__ = 'max'
# modified by michihiro
import numpy as np
import theano
from alphabet import Alphabet
from lasagne_nlp.utils import utils as utils
root_symbol = "##ROOT##"
root_label = "<ROOT>"
word_end = "##WE##"
MAX_LENGTH = 120
MAX_CHAR_LENGTH = 45
logger = util... | |
= incident_energy
self.incident_energy = float(max(self.incident_energy, 0.0))
# 'incident_energy' must be 'float', not numpy 'float64' in order to be correctly displayed
# in 'yaml' formatted preview ('yaml' package does not support 'float64')
if incident_energy == 0.0:
logger.warning("Attempting to compute the ... | |
not do_next:
return
if self.forwards:
if node.finish_event.exists():
self.visit_event(node.finish_event)
else:
if node.start_event.exists():
self.visit_event(node.start_event)
if self.post_op_fn is not None:
self.post_op_fn(node, self)
def visit_fill(self, node):
if self.use_gen:
if node.generation == self... | |
"""
Utils functions for use in ingests
"""
from astroquery.simbad import Simbad
from astropy.coordinates import SkyCoord
import astropy.units as u
import numpy as np
import numpy.ma as ma
import pandas as pd
from sqlalchemy import func
import dateutil
import re
import requests
from scripts.ingests.utils import *
lo... | |
in this input will be treated as an explicit constant value. Either this field or val_f_Origination must be specified if op_Origination is specified.
:type val_c_Origination: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_PasswordSecure: The op... | |
# coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3192
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from lusid.... | |
<filename>converter/parser.py<gh_stars>100-1000
# Copyright 2019 Xiaomi, 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... | |
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.33903,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 4.84328,
'Su... | |
<gh_stars>0
"""
@package mi.instrument.teledyne.workhorse_monitor_75_khz.particles
@file marine-integrations/mi/instrument/teledyne/workhorse_monitor_75_khz/driver.py
@author <NAME>
@brief Driver particle code for the teledyne 75_khz particles
Release notes:
"""
import re
from struct import *
import time as time
impor... | |
is important, it should be set as part of initialization.
If the servo is not engaged, the position is unknown and calling this function will throw an exception.
The range here is between getPositionMin and getPositionMax, and corresponds aproximately to an angle in degrees. Note that most servos will not be ... | |
the current thread
# IOLoop, and one that we will explicity pass to set_ioloop. If set_ioloop is not
# doing it's job, the children would automatically use thread_ioloop instance.
thread_ioloop = tornado.ioloop.IOLoop()
self.addCleanup(thread_ioloop.close, all_fds=True)
thread_ioloop.make_current()
our_ioloop = t... | |
>= 0, pdb.set_trace()
self.refine(l,NBOXMAX, VOLMIN,RSS)
# if it exists at least a box ambiguous or not in the VA
else:
if (nbox != 0 and nboxamb == 0):
self.FINISHED = 1
# Update EB
if len(EB) != 0:
self.dlayer[l][0].append_l(LBoxN(B.box[EB], ndim=self.ndim))
# Update AB
self.dlayer[l][1] = LBoxN(B.box[... | |
"""
For each TAD, determine if these are disrupted by ANY SV.
If yes, get all the genes in those TADs, and compute the z-score for those genes from the patient with the SV to all patients without any SV disrupting the boundary
Then filter out the genes in both this set and the null distribution that have SNVs, CNV... | |
<reponame>LolHacksRule/Kurisu
import discord
from discord.ext import commands
from sys import argv
class Assistance:
"""
Commands that will mostly be used in #help-and-questions.
"""
def __init__(self, bot):
self.bot = bot
self.systems = systems = ("3ds", "wiiu", "wii u", "switch", "nx")
print('Addon "{}" loade... | |
"HROptional" / Int32sl,
"InfoOptDeci" / Int64ul,
"InfoOptHex" / Int64ul,
"ETW_TrackbackTag" / Int32ul
)
@declare(guid=guid("daf0b914-9c1c-450a-81b2-fea7244f6ffa"), event_id=2052, version=0)
class Microsoft_Office_Word_2052_0(Etw):
pattern = Struct(
"Message" / WString,
"InfoString" / WString,
"ErrIdOptional" ... | |
""" SUBCOMMAND: ``ksconf unarchive <tarball>``
Usage example:
.. code-block:: sh
ksconf unarchive splunk-add-on-for-amazon-web-services_111.tgz
"""
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
from io import StringIO
from subprocess import list2cmdline
from ksconf... | |
kwargs['lookup'] = DelegatedLookup(user_to_email_mapper)
super(MailNotifier, self).__init__(**kwargs)
def useLookup(self, build):
"""
For "try" jobs, only send emails to the person requesting the build.
For rest, send to the list of interested users.
"""
dl = []
reason = build.getReason()
if "'try' job by ... | |
)
# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)
# Done; return the response.
return response
async def set_bucket_iam_policy(self,
request: storage.SetIamPolicyRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = Non... | |
<filename>redfishtoollib/SessionService.py
# Copyright Notice:
# Copyright 2016 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfishtool/blob/master/LICENSE.md
# redfishtool: SessionService.py
#
# contains SessionService related subCommands and access func... | |
try:
if h.typ() == "stats":
print("\n >>>> {} <<<<".format(h.fname()))
for k,v in h.get_all_attr().items():
print " {} = '{}';".format(k,v)
else:
logger.error("'{}'-DB is not an StatsDB or given encryption key ('{}') is wrong. ".format(stats_fname,encryption_key))
return False
except:
logger.error("'{}'-DB was... | |
<reponame>fkie/rosrepo
# coding=utf-8
#
# ROSREPO
# Manage ROS workspaces with multiple Gitlab repositories
#
# Author: <NAME>
#
# Copyright 2016 <NAME>
#
# 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 L... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA 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... | |
s
Scalar field f-c on the 2-dimensional topological manifold M
sage: s.display()
f-c: M --> R
on U: (x, y) |--> (-a*x**2 - a*y**2 - a + 1)/(x**2 + y**2 + 1)
on V: (u, v) |--> (-a*u**2 - a*v**2 - a + u**2 + v**2)/(u**2 + v**2 + 1)
Some tests::
sage: f + zer == f
True
sage: f - f == zer
True
sage: f + (-f) =... | |
<reponame>Banhkun/OBBDetection<gh_stars>0
from __future__ import division
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import normal_init
from mmcv.cnn import constant_init
from mmdet.core import (PointGenerator, multi_apply, multiclass_rnms,
images_to_levels, unm... | |
"""Analysis and modification of structural data exported from GeoModeller
All structural data from an entire GeoModeller project can be exported into ASCII
files using the function in the GUI:
Export -> 3D Structural Data
This method generates files for defined geological parameters:
"Points" (i.e. formation contact... | |
from typing import Tuple, Optional, List, Dict, Any
from .utils import find_armature_modifier, truncate_name, is_invisible_tool, fallback_material
import vmfpy
from os import path
from mathutils import geometry, Vector, Euler, Matrix
from math import inf, radians, floor, ceil, isclose
from itertools import chain, combi... | |
<filename>askci/apps/main/github/__init__.py
"""
Copyright (C) 2016-2020 <NAME>.
This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from django.views.decorators.csrf impo... | |
((1, 2, 1), (3, 4, S(1)/2), (1, 3, S(3)/2)) )/3 + \
sqrt(5)*JzKetCoupled(S(3)/2, -S(1)/2, (S(1)/2, S(1)/2, S(1)/2, 1), ((1, 2, 1), (3, 4, S(3)/2), (1, 3, S(3)/2)) )/15 + \
sqrt(5)*JzKetCoupled(S(5)/2, -S(1)/2, (S(1)/2, S(
1)/2, S(1)/2, 1), ((1, 2, 1), (3, 4, S(3)/2), (1, 3, S(5)/2)) )/5
assert couple(TensorProduct(... | |
<gh_stars>100-1000
# Copyright (c) 2013 Novo Nordisk Foundation Center for Biosustainability, DTU.
# See LICENSE for details.
import unittest
import json
import os
import optlang.interface
import pickle
import copy
import sys
try:
import mip
except ImportError as e:
if str(e).find('mip') >= 0:
class TestMissingDe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.