input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
self._values.get("worker_system_disk_category")
return typing.cast(typing.Optional[typing.Union[builtins.str, ros_cdk_core.IResolvable]], result)
@builtins.property
def worker_system_disk_size(
self,
) -> typing.Optional[typing.Union[jsii.Number, ros_cdk_core.IResolvable]]:
'''
:Property:
workerSystemDiskSize... | |
Cabin's directory, the condensed ones are not
# listed on METADATA.pb, so the check must FAIL, even if we do not
# explicitely include them in the set of files to be checked:
assert_results_contain(check(cabin_fonts),
FAIL, 'file-not-declared',
'with some font files not declared...')
def test_check_metadata_ital... | |
<filename>MMLL/models/POM6/MLC/MLC.py
# -*- coding: utf-8 -*-
'''
Multiclass Logistic Classifier model under POM6
'''
__author__ = "<NAME>"
__date__ = "Jan 2021"
import numpy as np
from MMLL.models.Common_to_all_POMs import Common_to_all_POMs
from transitions import State
from transitions.extensions impo... | |
emcee
medperiod = np.median(samples['period'])
delta = (4*medperiod**2)/(2*np.pi*(np.max(x)-np.min(x)))
deltap = medperiod**2/(2*np.pi*(np.max(x)-np.min(x)))
rmsperiod = np.sqrt(np.mean((samples['period']-medperiod)**2))
unimodal = False
if rmsperiod < delta:
print('Unimodal PDF, running emcee')
unimodal = True... | |
<reponame>jeffmacinnes/pyneal
""" Create Mask GUI:
GUI to set inputs and option for creating a mask to use during Pyneal real-time
analysis. Pyneal requires that all masks be in subject functional space; this
tool helps create those.
All of the settings are stored in a createMaskConfig.yaml file. This GUI reads
that f... | |
<reponame>ooici/pyon
#!/usr/bin/env python
__author__ = '<NAME> <<EMAIL>>'
from mock import Mock, sentinel, patch, MagicMock
from gevent.event import Event
from gevent import spawn
from gevent.queue import Queue
import Queue as PQueue
import time
from nose.plugins.attrib import attr
from pyon.util.unit_test import ... | |
import script_bash
import script_briteonyx
from throw_out_your_templates_3_core_visitor_map import VisitorMap
from structure_bash import *
from structure_briteonyx import *
class Script(script_briteonyx.Script):
def __init__(self, content):
script_briteonyx.Script.__init__(self)
self._content = content
def bui... | |
# ' % kmergrammar
# ' % <NAME> mm2842
# ' % 15th May 2017
# ' # Introduction
# ' Some of the code below is still under active development
# ' ## Required libraries
# + name = 'import_libraries', echo=False
import os
import sys
import numpy as np
import pandas as pd
import sqlalchemy
import logging
import time
from m... | |
a name for this space group, returns
True or False. The space group name can be in several forms:
the short name, the longer PDB-style name, or the space group number.
"""
if name == self.short_name: return True
if name == self.pdb_name: return True
if name == self.point_group_name: return True
if name == self.... | |
extent=[0, 2, 0, 1], cmap=cmap_u)
figure.plot_panel_imshow(dns_target[0, :, :, 0], 0, 3, vmin=0.4, vmax=1.2, origin='upper', extent=[0, 2, 0, 1], cmap=cmap_u)
figure.plot_panel_imshow(lr_target[0, :, :, 1], 1, 0, vmin=-0.1, vmax=0.1, origin='upper', extent=[0, 2, 0, 1], cmap=cmap_v)
figure.plot_panel_imshow(hr_tar... | |
that a valid
# NuFlavIntGroup is specified (i.e., the target NuFlavIntGroup doesn't
# span multiple NuFlavIntGroups).
all_keys = list(args[:-1])
new_val = deepcopy(args[-1])
tgt_grp = NuFlavIntGroup(all_keys)
for (flavints, key) in self.flavints_to_keys:
match = False
# Identical match to existing NuFlavIntGrou... | |
import copy
import warnings
import re
import numpy as np
import pandas as pd
import matplotlib as mpl
from matplotlib import pyplot as plt
import fitgrid
# enforce some common structure for summary dataframes
# scraped out of different fit objects.
# _TIME is a place holder and replaced by the grid.time value on the f... | |
import logging
from cobra.core.dictlist import DictList
from cobrakbase.core.kbaseobject import KBaseObjectBase, KBaseObject
from cobrakbase.core.utils import seed_coefficients_to_string
from cobrakbase.core.utils import get_str, get_int, get_id_from_ref
logger = logging.getLogger(__name__)
class KBaseFBASolution(... | |
the same entity ID and timestamp.
- Source is modified during an import. This includes
adding, updating, or removing source data and/or
metadata. Examples of updating metadata include but are
not limited to changing storage location, storage class,
or retention policy.
- Online serving cluster is under-provisione... | |
<reponame>ga1008/mongochecker
import json
import os
import re
import sys
import time
import urllib
from urllib.parse import quote_plus
import pymongo
from BaseColor.base_colors import red, yellow, cyan, green, hred, blue, hgreen
from pymongo.errors import OperationFailure
from tqdm import tqdm
from Mongo... | |
<filename>Ground_control/gc_functions/upload_mission.py<gh_stars>0
#!/usr/bin/env python
# /***************************************************************************
# MavLink LoRa node (ROS) upload mission example script
# Copyright (c) 2018, <NAME> <<EMAIL>> <<EMAIL>>
# SDU UAS Center, http://sdu.dk/uas
# All right... | |
from functools import reduce
from itertools import chain
from .extraction import order_nodes, is_gap, is_copy, HeadDeps, ModDeps, make_functor, get_argument
from .graphutils import *
from .milltypes import (polarize_and_index_many, polarize_and_index, WordType, EmptyType, DiamondType, ModalType,
PolarizedType, BoxTyp... | |
<filename>metalibm_functions/ml_div.py
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of metalibm (https://github.com/kalray/metalibm)
###############################################################################
# MIT License
#
# Copyright... | |
classes in a discrete dataset
"""
return dict(is_logits=self.is_logits, num_classes=self.num_classes,
soft_interpolation=self.soft_interpolation)
@property
def subclass(self):
"""Specifies the primary subclass of an instance of DatasetBuilder
that can be instantiated on its own using self.rebuild_dataset
and... | |
import time
from datetime import datetime
from dateutil.tz import tzlocal
import decimal
D = decimal.Decimal
import sys
import logging
from operator import itemgetter
from . import (config, exceptions, bitcoin)
b26_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
# Obsolete in Python 3.4, with enum module.
BET_TYPE_NAME = {0: ... | |
import trio
from typing import Type, List as PyList, Set, Dict
from typing import Optional
from itertools import zip_longest
from e2db.models import (
Fork, BeaconState, Validator, ValidatorStatus, ValidatorEpochBalance, ValidatorOddBalance,
BeaconBlockBody, BeaconBlock, SignedBeaconBlock,
Eth1Data, Eth1BlockVote,
... | |
self._margin_unsup)]
if self.monitor_unsup_outputs:
im = np.hstack(
(montage(self.fake_out_unsup[0].asnumpy()[:9, 0]),
montage(self.fake_out_unsup_aug[0].asnumpy()[:9, 0]),
montage(
np.abs(
self.fake_out_unsup[0].asnumpy()[:9, 0] - self.fake_out_unsup_aug[0].asnumpy()[:9, 0]))))
[plt.imsave('%s/ep%04d_%02d_%d'... | |
#!/usr/bin/python
#
# Functions for x843 encoded objects
#
# @author <NAME>
# @email <EMAIL>
#
from __future__ import unicode_literals, division, absolute_import, print_function
import datetime, sys
if sys.version_info < (3,):
from urllib import quote as urlquote
from urllib2 import (
Request as URLRequest,
urlope... | |
GRR server URL.
grr_auth: Tuple containing a (username, password) combination.
hunt_id: ID of GRR hunt to retrieve results from.
approvers: comma-separated list of GRR approval recipients.
verbose: toggle for verbose output.
"""
super(GRRHuntDownloader, self).__init__(
reason, grr_server_url, grr_auth, approvers... | |
<gh_stars>0
"""Testing the Decorators that check a functions input or output."""
import typing
from asyncio import AbstractEventLoop
import numpy as np
import pandas as pd
import pytest
from pandera import (
Check,
Column,
DataFrameSchema,
DateTime,
Field,
Float,
Int,
SchemaModel,
String,
check_input,
chec... | |
"""
{This script plots SMF and BMF from all 3 surveys}
"""
# Libs
from cosmo_utils.utils.stats_funcs import Stats_one_arr
from cosmo_utils.utils import work_paths as cwpaths
from collections import OrderedDict
import matplotlib.pyplot as plt
from matplotlib import rc
import pandas as pd
import numpy as np
import argpa... | |
status"
)
# TenderMultipleLotAuctionResourceTest
def get_tender_lots_auction(self):
self.app.authorization = ("Basic", ("auction", ""))
response = self.app.get("/tenders/{}/auction".format(self.tender_id), status=403)
self.assertEqual(response.status, "403 Forbidden")
self.assertEqual(response.content_type, "a... | |
255))
g = max(0, min(g + brightness, 255))
b = max(0, min(b + brightness, 255))
return r, g, b
elif isinstance(brightness, float) and -1. <= brightness <= 1.:
if brightness < 0:
r1 = g1 = b1 = 0
else:
r1 = g1 = b1 = 255
r = int(r + (r1 - r) * abs(brightness))
g = int(g + (g1 - g) * abs(brightness))
b = in... | |
-
# osid.learning.ObjectiveRequisiteSession.get_all_requisite_objectives
return self._get_provider_session('objective_requisite_session').get_all_requisite_objectives(*args, **kwargs)
def get_dependent_objectives(self, *args, **kwargs):
"""Pass through to provider ObjectiveRequisiteSession.get_dependent_objectives... | |
<filename>landlibrary/importers/FAOLEX/faolex-2017/utils.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
def getUNM49code(label):
return {
'Africa': "002",
'Americas': "019",
'Asia': "142",
'Caribbean': "029",
'Central Africa': "017",
'Central America': "013",
'Central Asia': "143",
'CIS (Commonwealth of Indepen... | |
),
"AL12Ons" : ( 24252, 24253 ),
"AL12AgeRec" : ( 24253, 24255 ),
"AL12Rec" : ( 24255, 24256 ),
"AL12c" : ( 24256, 24257 ),
"AL13" : ( 24257, 24258 ),
"AL13AgeOns" : ( 24258, 24260 ),
"AL13Ons" : ( 24260, 24261 ),
"AL13AgeRec" : ( 24261, 24263 ),
"AL13Rec" : ( 24263, 24264 ),
"AL13b" : ( 24264, 24265 ),
"AL1... | |
2 * np.cos(2 * theta)
+ 2 * np.cos(2 * phi)
+ 14
) / 16
assert np.allclose(res, expected, atol=tol, rtol=0)
def test_pauliz_hadamard(self, theta, phi, varphi, tol):
"""Test that a tensor product involving PauliZ and PauliY and hadamard works correctly"""
dev = qml.device("default.qubit.tf", wires=3)
... | |
[]:
user = funs.user_check(booster, booster.guild)
for i in server['boost']['reward']:
user['inv'].append(funs.creat_item(booster.guild.id, i))
funs.user_update(booster.id, booster.guild, 'inv', user['inv'])
if after.premium_since != None and before.premium_since != after.premium_since and before.premium_since !... | |
return subclass(*args_, **kwargs_)
if DeleteDangerousGoodsHandlingUnitReply.subclass:
return DeleteDangerousGoodsHandlingUnitReply.subclass(*args_, **kwargs_)
else:
return DeleteDangerousGoodsHandlingUnitReply(*args_, **kwargs_)
factory = staticmethod(factory)
def get_ns_prefix_(self):
return self.ns_prefix_
de... | |
<reponame>GMLC-1-4-2/battery_interface<filename>src/fleets/fuel_cell_fleet/fuelcell_fleet.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# !/usr/bin/env python3
"""
@authors: <EMAIL>, <EMAIL>,
Description: This class implements the FuelCell FleetInterface to integrate with a fleet of
FuelCells
"""
import sys
from os.path im... | |
p_after.'''
p = self
parent_v = p_after._parentVnode()
# Returns None if p.v is None
# Init the ivars.
p.stack = p_after.stack[:]
p._childIndex = p_after._childIndex + 1
# Set the links.
child = p.v
n = p_after._childIndex + 1
child._addLink(n, parent_v, adjust=adjust)
#@+node:ekr.20080416161551.215: *4* p._... | |
<filename>src/relstorage/cache/lru_cffiring.py
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2016 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (... | |
outfile.write('gain=%e,\n' % (self.gain,))
if self.bias is not None and 'bias' not in already_processed:
already_processed.add('bias')
showIndent(outfile, level)
outfile.write('bias=%e,\n' % (self.bias,))
def exportLiteralChildren(self, outfile, level, name_):
pass
def build(self, node):
already_processed = set... | |
<gh_stars>10-100
#!/usr/bin/env python3
"""
collection of functions for NISAR geocode workflow
"""
import numpy as np
import pathlib
import shutil
import time
import h5py
import journal
import isce3
from pybind_nisar.products.readers import SLC
from pybind_nisar.workflows import h5_prep, gpu_check
from pybind_nisar.... | |
<reponame>fochoao/cpython<gh_stars>0
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 <NAME> (The Compiler) <<EMAIL>>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | |
<gh_stars>1-10
#!/usr/bin/env python3
# Intended to be run from the chord-fork folder.
# cd Error-Ranking/chord-fork
# ./scripts/bnet/driver.py pjbench/ftp/chord_output_mln-datarace-problem/bnet/noaugment/bnet-dict.out \
# pjbench/ftp/chord_output_mln-datarace-problem/bnet/noaugment/factor-graph.fg \
# pjbench/ftp/cho... | |
<reponame>building-energy/sap2012<filename>sap2012/SAP_worksheet/heat_losses_and_heat_loss_parameter.py
# -*- coding: utf-8 -*-
def heat_losses_and_heat_loss_parameter(
solid_door_net_area,
solid_door_u_value,
semi_glazed_door_net_area,
semi_glazed_door_u_value,
window_net_area,
window_u_value,
roof_window_net... | |
= str(info[7]).decode('utf-8')
index -= 1
dtime = self.convertTime(ftime)
# self.table.setItem(index - 1, 0, QtGui.QTableWidgetItem(f))
self.table.setItem(index, 0, QtGui.QTableWidgetItem(f))
self.table.setItem(index, 1, QtGui.QTableWidgetItem(p))
sizeitem = QtGui.QTableWidgetItem(size+" ")
if int(size) > 100*10... | |
<gh_stars>1-10
#!/usr/bin/env python3
"""Core options v1 to v2 converter
Just run this script as follows, to convert 'libretro_core_options.h' & 'Libretro_coreoptions_intl.h' to v2:
python3 "/path/to/v1_to_v2_converter.py" "/path/to/where/libretro_core_options.h & Libretro_coreoptions_intl.h/are"
The original files ... | |
<reponame>arossert/ldaptor
# Copyright (C) 2001 <NAME>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,... | |
with self.out:
clear_output()
date_selected = self.qgrid_obj.get_selected_df().reset_index()["rev_time"].iloc[0]
editor_selected = self.qgrid_obj.get_selected_df().reset_index()["editor_id"].iloc[0]
editor_name = self.qgrid_obj.get_selected_df().reset_index()["editor"].iloc[0]
page_title = self.all_tokens["article... | |
start to avoid redirects
LOGIN_URL = '/'
LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = '/'
# When logging in with browser ID, a username is created automatically.
# In the case of duplicates, the process is recursive up to this number
# of times.
MAX_GEN_USERNAME_TRIES = 50
# Email settings
ADDONS_EMAIL = "Mozilla Ad... | |
(QPoint)"""
cursor = self.cursorForPosition(coordinates)
cursor.select(QTextCursor.BlockUnderCursor)
return to_text_string(cursor.selectedText()).replace(u'\u2029', '')
def get_word_at(self, coordinates):
"""Return word at *coordinates* (QPoint)"""
cursor = self.cursorForPosition(coordinates)
cursor.se... | |
<reponame>baishancloud/dkit
import mock
import os
import sys
import time
import unittest
import urlparse
from BaseHTTPServer import BaseHTTPRequestHandler
from BaseHTTPServer import HTTPServer
from pykit import redisutil
from pykit import threadutil
from pykit import utdocker
from pykit import ututil
from pykit impor... | |
List
window or another save file's List window. Open creates a new List window for
the file, or raises its window if the file is already open.
A save file's list window allows all main window actions listed above, except
for Load. For example, saved messages can be viewed, deleted, replied to, or
forwarded, from... | |
array,
Training data, if return_data is True
X_test: numpy array,
Test data, if return_data is True and test_size > 0
subj_train: numpy array,
Training subjects, if return_data is True
subj_test: numpy array,
Test subjects, if return_data is True and test_size > 0
"""
clinical_prefix = "bloc-clinical_score-"
... | |
from anytree import NodeMixin
import os
import shutil
import numpy as np
import traceback
from numpy import inf
from .data import energy_path, energy_path_from_p_state
from .util import set_output_folder
from .chain_io import chain_write_between
from datetime import datetime
import json
class GNEB_Node(NodeMixin):... | |
1
else:
result = re.search('ControlBool_OneShot_('+args.scalerkey+'[a-zA-Z0-9_\-]*) = 0x([A-F0-9]{5})', line)
if (result is not None):
scalers[result.group(1)]['OneShot']=(result.group(2))
fpgavarCount += 1
else:
result = re.search('IndicatorArrayU32_Counter_('+args.scalerkey+'[a-zA-Z0-9_\-]*) = 0x([A-F0-9]{5}... | |
#################################################################################
# Copyright 2020 <NAME>
# Contrib.: T.P. Correa
# 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.... | |
0
DummyHandler2.get.assert_called_with(
'GET', self.hmc, '/api/cpcs/1', tuple('1'), True)
assert DummyHandler2.delete.called == 0
def test_post_cpcs(self):
# the function to be tested
result = self.urihandler.post(self.hmc, '/api/cpcs', {}, True, True)
assert result == self.new_cpc
assert DummyHandler1.get.... | |
with site specified
tempfile.tempdir = '/output'
blast_tmpfile = tempfile.NamedTemporaryFile()
#f = open('/output/blast_tmp', 'wb')
if id_pos_res == {}:
for id in id_seq:
wr = '>'+id+'\n'+id_seq[id]+'\n'
blast_tmpfile.write(wr)
else:
for id in id_pos_res:
try:
wr = '>'+id+'\n'+id_seq[id]+'\n'
blas... | |
:param callback function: The callback function
for asynchronous request. (optional)
:param str system_id: The unique identifier of the storage-system. This may be the id or the WWN. (required)
:param SNMPCommunityAddDescriptorList body: (required)
:param str controller: Controller selection
:param bo... | |
<filename>IliasDownloaderUniMA/IliasDL.py
#!/usr/bin/env python3
from requests import session, get, ConnectionError
from bs4 import BeautifulSoup
from urllib.parse import urljoin
from pathlib import Path as plPath
from dateparser import parse as parsedate
from datetime import datetime
from multiprocessing.pool import ... | |
import os
import re
import logging
from nonebot import permission as perm
from nonebot import Message as M
from nonebot import MessageSegment as MS
from AzusaBot import config
from Azusa.utils import Timer
from Azusa.data import groupdict, frienddict, SIGNAL
from Azusa.middleware import on_command, CommandGroup, on_we... | |
<filename>cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_IPSLA_ECHO_MIB.py
""" CISCO_IPSLA_ECHO_MIB
This MIB module defines the templates for IP SLA operations of
ICMP echo, UDP echo and TCP connect.
The ICMP echo operation measures end\-to\-end response time between
a Cisco router and any IP enabled device by computin... | |
BazaarNPCFlip("Spooky Bait", 10.0),
BazaarNPCFlip("Spiked Bait", 20.0),
BazaarNPCFlip("Blessed Bait", 42.0),
BazaarNPCFlip("Ice Bait", 3.0),
BazaarNPCFlip("Whale Bait", 80.0),
####################################
######### Oddities #########
####################################
# Potatos, compactors, fuels
Baz... | |
EXTENSION_PUBLISHER_NAME, EXTENSION_IMAGE_TYPE, EXTENSION_IMAGE_VERSION)
# TODO: dont belong here
# Get Container Service[get]
# result = self.mgmt_client.container_services.get(resource_group.name, CONTAINER_SERVICE_NAME)
# Get a dedicated host.[get]
result = self.mgmt_client.dedicated_hosts.get(resource_group.... | |
try:
from io import BytesIO
except ImportError as e:
import StringIO as BytesIO
try:
import cPickle as pickle
except ImportError as e:
import pickle
from mango import mpi
haveMpi4py = mpi.haveMpi4py
import scipy as sp
import scipy.optimize
logger, rootLogger = mpi.getLoggers(__name__)
class DistributedMetric... | |
:
A Scikit-learn model instance.
Returns
-------
kernel_kwargs : Dictionary
Get the respective kernel type of the SVM model.
"""
kernel_kwargs = dict()
if model.kernel == 'linear':
kernel_kwargs['LinearKernelType'] = pml.LinearKernelType(description='Linear Kernel Type')
elif model.kernel == 'poly':
kerne... | |
self.x1 >= 0
and self.x2 < width
and self.y1 >= 0
and self.y2 < height)
def is_partly_within_image(self, image):
"""Estimate whether the BB is at least partially inside the image area.
Parameters
----------
image : (H,W,...) ndarray or tuple of int
Image dimensions to use.
If an ``ndarray``, its shape will ... | |
<reponame>BBN-Q/pyWRspice
# Copyright (c) 2019 <NAME> - Quantum Group
"""
Python wrapper for WRspice
class RawFile: Read and store WRspice output data into Variable structures.
class WRWrapper: Run WRspice script via WRspice simulator.
"""
import numpy as np
import pandas as pd
import os, tempfile, time, datetim... | |
= {}
result_obj_dict = copy.deepcopy(read_result)
result_obj_dict.update(obj_dict)
if result_obj_dict.get('multi_policy_service_chains_enabled'):
import_export_targets = result_obj_dict.get('route_target_list') or {}
import_targets = result_obj_dict.get('import_route_target_list') or {}
export_targets = result_o... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function, division, absolute_import
import logging
import numpy
import sys
from collections import OrderedDict
from six.moves import zip
import numpy as np
import Ska.Numpy
from Chandra.Time import DateTime
import Ska.tdb
f... | |
<filename>trac/versioncontrol/admin.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license... | |
from __future__ import annotations
import abc
import re
from numbers import Number
from typing import Awaitable # noqa: F401
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generic,
List,
Optional,
Sequence,
Type,
TypeVar,
Union,
overload,
)
from zucker.filtering import NegatableFilter, NullishFilter, N... | |
"@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/fuse-712-for-invalidation.diff",
"@com_github_buildbarn_bb_remote_execution//:patches/com_github_hanwen_go_fuse_v2/notify-testability.diff",
],
sum = "h1:+32ffteETaLYClUj0a3aHjZ1hOPxxaNEHiZiujuDaek=",
version = "v2.1.0",
)
go_reposi... | |
drive firmware information. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_drives_drive_firmware(lnn, driveid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param int lnn: (required)
:... | |
'LOCAL' : [],
}
),
]
def __init__(self,
target=None,
new_subscribed_library=None,
subscribed_library=None,
location=None,
vcenter=None,
placement=None,
):
"""
:type target: :class:`Subscriptions.CreateSpecSubscribedLibrary.Target`
:param target: Specifies whether the target subscribed library should be... | |
import sys
import os
import argparse
import xml.etree.ElementTree as ET
def flipBoundingBox(x_min, y_min, x_max, y_max, img_width, img_height):
'''
Flips coordinates on the vertical axis.
Assumes x_min, y_min, x_max, y_max starts from 0.
Assumes all parameters are numbers.
'''
x_min_flip = (img_width-1) - x_m... | |
<reponame>cbwang505/DIYDynamoRIO
import time
import Queue
import bisect
import logging
import weakref
import threading
import collections
from lighthouse.util.misc import *
from lighthouse.util.disassembler import disassembler
logger = logging.getLogger("Lighthouse.Metadata")
#---------------------------------------... | |
<filename>zerver/tests/test_auth_backends.py
# -*- coding: utf-8 -*-
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django_auth_ldap.backend import _LDAPUser
from django.test.client import RequestFactory
from typing import Any, Callable, Di... | |
# Copyright 2017 Inspur Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
serial Atom serial number
12 - 16 Integer serial Serial number of bonded atom _
17 - 21 Integer serial Serial number of bonded atom |
22 - 26 Integer serial Serial number of bonded atom +-- optional
27 - 31 Integer serial Serial number of bonded atom _|
"""
def parseLines(self):
""" does the dirty work parsing... | |
# -*- coding: utf-8 -*-
"""This module defines the differentiable function class."""
from typing import Union, List, Optional, Tuple
import abc
import numpy as np
class DiffFunction(abc.ABC):
"""An abstract class representing a differentiable scalar function.
Supports Numpy broadcasting. Defaults to using fini... | |
in s or 'r_H+' in s:
reax.loc[i, s] = reax.loc[i, s]*int(r_multiplier )
if ('ox_' in s and 'coeff' in s) or ('rR_' in s and 'coeff' in s) or ('pO_' in s and 'coeff' in s) or 'o_H2O' in s or 'o_H+' in s:
reax.loc[i, s] = reax.loc[i, s]*int(o_multiplier)
reax['H+'] = reax['r_H+'] + reax['o_H+']
reax['protons'] = 'H+... | |
<gh_stars>1-10
#!/usr/bin/env python
"""
Control agents and related resources.
@see https://confluence.oceanobservatories.org/display/CIDev/R2+Agent+Use+Guide
See help below for available options and arguments.
Invoke via command line like this:
bin/pycc -x ion.agents.agentctrl.AgentControl instrument='CTDPF' op=st... | |
None and solver.is_software != software:
return False
if vfyc is not None and solver.is_vfyc != vfyc:
return False
if flux_biases is not None and solver.has_flux_biases != flux_biases:
return False
if num_qubits is not None:
if isinstance(num_qubits, list) and len(num_qubits) == 2:
min_qubits, max_qubits = num_... | |
<reponame>ralbuyeh-figure/saint
import torch
from torch import nn
from models import SAINT
from data_openml import data_prep_openml,task_dset_ids,DataSetCatCon
import argparse
from torch.utils.data import DataLoader
import torch.optim as optim
from utils import count_parameters, classification_scores, mean_sq_error
fr... | |
<reponame>dacut/ionosphere-repository
#!/usr/bin/env python3
"""
Ionosphere repository build orchestration.
"""
from enum import Enum
from logging import basicConfig as log_config, getLogger, DEBUG
from os import link, lstat, mkdir, walk
from os.path import abspath, exists, join as path_join, split as path_split
from p... | |
"""
Record all instance methods in a 2 level dictionary so we can go
through them and see which are overloaded
{ className: {methodName: [methodSpec, methodSpec, methodSpec]}}
"""
methodList = self.overloadedInstanceMethods.setdefault(methodSpec.name, [])
methodList.append(methodSpec)
def cullOverloadedMethods... | |
k here
#replay buffer order: state, action, state_action_grad, reward, reward_grad, next_state, done, param_grad
# assert len(self.replay_memory_buffer)==self.horizon
policy_gradient = []
# print(len(self.replay_memory_buffer))
for index, value in enumerate(self.replay_memory_buffer): #index from 0 to horizon -... | |
<reponame>AlanConstantino/scuffed-space-cadet
import pygame, sys, random, time
# helper function that calls kill method on entities passed
def kill_all(entities):
for entity in entities:
entity.kill()
# initialize
pygame.init()
pygame.font.init()
pygame.mixer.init()
# Window title
pygame.display.set_caption('Scuff... | |
# -*- coding: utf-8 -*-
"""PanSTARRS 1 bands from Mega-Cam gen1 bands."""
__author__ = "<NAME>"
__credits__ = [
"http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/en/megapipe/docs/filt.html"
]
__all__ = [
"U_MP9301",
"G_MP9401",
"R_MP9601",
"I_MP9701",
"Z_MP9801",
"UmG",
"UmR",
"UmI",
"UmZ",
"GmR",
"GmI",
"Gm... | |
<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import
##########################################################################
#
# Redmine to JIRA Importers plugin
#
# Copyright (C) 2018, <NAME>
#
# config.py - Core application configuration settings
#
#########################################... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : paradosiakoi oikismoi
Description : paradosiakoi oikismoi aigaiou
Date : 16/Feb/14
copyright : (C) 2014 by <NAME>
email : <EMAIL>
**********************************************************... | |
<filename>Speedo/plugins/stickers.py
import asyncio
import io
import math
import os
import random
import textwrap
import urllib.request
from os import remove
from PIL import Image, ImageDraw, ImageFont
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.m... | |
problem? Maybe not.')
tty = ''
release_message = RELEASE_MESSAGE_TEMPLATE.format(release_version)
if changelog_lines:
release_message += '\n\nChangelog Details:'
for line in changelog_lines:
release_message += '\n' + line.strip()
cmd = ['git', 'tag', '-a', release_version, '-m', release_message]
if overwrite:... | |
#!/usr/bin/env python3
# Copyright (c) 2019 <NAME>, <EMAIL>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | |
<gh_stars>0
import package.data_input as di
import ete3
import math
import package.instance as inst
import package.params as pm
import numpy as np
import matplotlib
try:
import tkinter
except:
matplotlib.use('Qt5Agg', warn=False, force=True)
import matplotlib.pyplot as plt
import palettable as pal
import pprint as pp... | |
symmetric matrix
check = check_symmetric(Anxn)
print('This is {} that the matrix is symmetric'.format(check))
# plot histogram N
mu, sig = cp.mean(Anxn), cp.std(Anxn)
print('For n = {0}, mu = {1}, sig = {2}'.format(n, mu, sig))
# # https://www.tutorialspoint.com/python_data_science/python_normal_d... | |
controlled state evolutions
Saves a :class:`Propagator` and a list of cost functions $(k_0, \dots, k_T)$ of equal
lengths.
As a callable, implements the map
$$k^{F, A}\colon (s_0, (\xi_t)_{t=1}^{T+1})) \mapsto \sum_{t=0}^T k_t(s_t, A_t(s_t))$$
where $(A_0,\dots, A_T)$ are the control functions saved by the :class... | |
6.36674450874035)**2 - 1) * (0.0001 + 0.9999 * m.b221) +
0.00544122020134202 * m.b221 <= 0.00544122020134202)
m.e409 = Constraint(expr= ((-m.x853 / (0.0001 + 0.9999 * m.b222) +
8.48963678940351)**2 + (-m.x854 / (0.0001 + 0.9999 * m.b222) +
5.48402210821562)**2 - 1) * (0.0001 + 0.9999 * m.b222) + 0.0101148431299391
... | |
<gh_stars>1-10
import os
import time
import json
import zipfile
import StringIO
import datetime
import traceback
import requests
from collections import OrderedDict, defaultdict
from sqlalchemy import distinct, func, or_, not_
from sqlalchemy.orm import joinedload
from flask import Blueprint, make_response, render_t... | |
has length: {}".format(len(description)))
def _convert_spark_dtype_to_hive_dtype(spark_dtype):
"""
Helper function to convert a spark data type into a hive datatype
Args:
:spark_dtype: the spark datatype to convert
Returns:
the hive datatype or None
Raises:
:SparkToHiveSchemaConversionError: if there was a... | |
that we have three windings...
for w in range(3):
# Instanciate a DiTTo Winding object
try:
api_winding = Winding(model)
except:
raise ValueError("Unable to instanciate Winding DiTTo object.")
# Set the base voltage
# We assume that 1st winding is primary, 2nd secondary, and third tertiary
try:
if w == 0:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.