input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
0.14, 0.23))
fd(5)
color((0.09, 0.22, 0.5))
fd(1)
color((0.57, 0.5, 0.23))
fd(1)
color((0.98, 0.74, 0.0))
fd(6)
color((0.09, 0.22, 0.5))
fd(1)
color((0.47, 0.18, 0.36))
fd(1)
color((0.88, 0.14, 0.23))
fd(6)
color((0.09, 0.22, 0.5))
fd(1)
color((0.98, 0.74, 0.0))
fd(11)
color((0.12, 0.24, 0.48))
fd(1)
color((0.11, 0.22,... | |
import math
from copy import copy
regDataStructsVer = "1.6"
class RegBank(object):
def __init__(self, name, specifier):
self.name = name
self.specifier = specifier
self.registers = []
# Find don't care positions
pos = 0
while (specifier[len(specifier)-(pos+1)]) == "X":
pos = pos+1
if pos==0:
if "X" not ... | |
next_page_token = proto.Field(
proto.STRING,
number=2,
)
class GetSinkRequest(proto.Message):
r"""The parameters to ``GetSink``.
Attributes:
sink_name (str):
Required. The resource name of the sink:
::
"projects/[PROJECT_ID]/sinks/[SINK_ID]"
"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
"billingAccou... | |
#!/usr/bin/env python
# coding: utf-8
# # Scenario
#
# We are working on preparing a prototype machine learning model for Zyfra, a company that developes efficiency solutions for heavy industry.
#
# The ML model should predict the amount of gold (Au) recovered from gold ore using data on extraction and purification.... | |
to set
internally.
It is deprecated to specify both "shift" and "start_time".
If this does happen, timeshift() will print a warning to
stderr and ignore the "shift" argument.
If "shift" is negative and sufficiently large that it would
leave some event with a negative tick-value, then the score
is shifted so that the ... | |
<reponame>theRealCarneiro/pulsemeeter
import os
import re
import signal
import shutil
import threading
import sys
from .app_list_widget import AppList
from .eq_popover import EqPopover
from .latency_popover import LatencyPopover
from .rnnoise_popover import RnnoisePopover
from .groups_popover import JackGroupsPopover
... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import elasticsearch_dsl
import pytest
import webob
from h.search import Search, index, query
MISSING = object()
ES_VERSION = (1, 7, 0)
OFFSET_DEFAULT = 0
LIMIT_DEFAULT = query.LIMIT_DEFAULT
LIMIT_MAX = query.LIMIT_MAX
OFFSET_MAX = query... | |
<gh_stars>0
import os
import datetime
import pyodbc
import pymongo
import pandas as pd
import altair as alt
import streamlit as st
from collections import Counter
## streamlit page config
st.set_page_config(page_title='LS Dashboard monitoring', page_icon='😎', layout='wide', initial_sidebar_state='expanded', menu_item... | |
<filename>tests/test_apply_process.py<gh_stars>10-100
import datetime
import math
from typing import List
from unittest import TestCase
import pytest
import geopyspark as gps
import numpy as np
import pytz
from geopyspark.geotrellis import (SpaceTimeKey, Tile, _convert_to_unix_time)
from geopyspark.geotrellis.constant... | |
rows5:{}',rows[5])
pkdc('after header changed rows6:{}',rows[6])
pkdc('after header changed rows7:{}',rows[7])
pkdc('after header changed rows8:{}',rows[8])
pkdc('after header changed rows9:{}',rows[9])
pkio.write_text(filename, ''.join(rows))
def _flux_label(model):
if 'fluxType' not in model:
return ''
retu... | |
the
error-tag 'invalid-value' in this case.
The IETF model in RFC 7223 provides YANG features for the
following (i.e., pre-provisioning and arbitrary-names),
however they are omitted here:
If the device supports pre-provisioning of interface
configuration, the 'pre-provisioning' feature is
advertised.
If ... | |
E501
if 'city' in params:
query_params.append(('city', params['city'])) # noqa: E501
if 'state_region' in params:
query_params.append(('state_region', params['state_region'])) # noqa: E501
if 'postal_code' in params:
query_params.append(('postal_code', params['postal_code'])) # noqa: E501
if 'country_code' in pa... | |
Recall: 0.97185 F1: 0.93388 F2: 0.95630
# Total predictions: 26000 True positives: 12634 False positives: 1423 False negatives: 366 True negatives: 11577
#clf = svm.LinearSVC(C=10000, class_weight='balanced', dual=True, fit_intercept=True,
# intercept_scaling=1, loss='squared_hinge', max_iter=1000,
# multi_class='ovr',... | |
semsim: <http://bime.uw.edu/semsim/> .
@prefix bqbiol: <http://biomodels.net/biology-qualifiers/> .
@prefix OMEXlib: <http://omex-library.org/> .
@prefix myOMEX: <http://omex-library.org/NewOmex.omex/> .
@prefix local: <http://omex-library.org/NewOmex.omex/NewModel.rdf#> .
local:MediatorParticipant0000
semsim:hasPhys... | |
# Copyright 2020 Inspur
#
# 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
... | |
delete-orphan')
# 微猜想评审状态,0:待评审;1:已通过;-1 已否决
status = db.Column(db.Integer, default=0)
# 用户在孵化器中引用的微知识,一对多,一方
microknos_cites = db.relationship('MicroknosCites', backref='microcon',
lazy='dynamic', cascade='all, delete-orphan')
def __repr__(self):
return '<Micropub {}>'.format(self.title)
def to_dict(self):
... | |
data:: Pin.OUT_PP")
shed.vars(old=".. data:: Pin.PULL_DOWN")
shed.vars(old=".. data:: Pin.PULL_NONE")
shed.vars(
old=".. data:: Pin.PULL_UP", end="class PinAF -- Pin Alternate Functions",
)
nxt = "pyb.RTC.rst"
_pin_af(end=nxt, shed=shed)
return nxt
def _led(this: str, shed: RST2PyI) -> str:
shed.class_from_f... | |
hold answer
if type(logical_zero_strings) != list:
raise Exception('logical_zero_strings should be a list')
if type(logical_one_strings) != list:
raise Exception('logical_one_strings should be a list')
validate_integer(data1_location)
validate_integer(data2_location)
if simple:
if len(logical_zero_strings) != 1... | |
<filename>artikcloud/apis/rules_api.py<gh_stars>0
# coding: utf-8
"""
ARTIK Cloud API
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache Lic... | |
# Originally generated by list_pcode: procedure_hierarchy
# Copyright (c) 2017 <NAME>
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
hierarchy = {(b'MAINLIB ', 78): (b'MAINLIB ', 27),
(b'MAINLIB ', 80): (b'MAINLIB ', 36),
(b'MAI... | |
<filename>peleenet/components/train/src/peleenet.py
import argparse
import datetime
import json
import math
import os
import pickle
import shutil
from collections import OrderedDict
from random import randrange
from typing import List, Tuple
import numpy as np # type: ignore
import tensorflow as tf # type: ignore
from... | |
<gh_stars>0
# preprocess_CPNEFluoxetine_data.py: a file defining CPNE-Fluoxetine dataset-specific preprocessing classes and functions
# SEE LICENSE STATEMENT AT THE END OF THE FILE
# dependency import statements
import os
import pickle as pkl
import argparse
from random import shuffle, randint
import scipy.io as scio
... | |
to the local directory
remotedir - the remote directory at Baidu Yun (after app's directory) to sync from. \
if not specified, it defaults to the root directory
localdir - the local directory to sync to if not specified, it defaults to the current directory.
deletelocal - delete local files that are not inside Baidu... | |
<filename>pyabc/inference_util.py
"""Inference utilities."""
# Note: Due to cyclic imports, these need to be separated from other modules
import logging
import uuid
from datetime import datetime, timedelta
from typing import Callable, List
import numpy as np
import pandas as pd
from pyabc.acceptor import Acceptor
f... | |
construct rd_digests.'
if rd_digests_dict is not None:
cache.delete('rd_digests_dict')
cache.set('rd_digests_dict', rd_digests_dict, timeout=get_cache_timeout())
else:
print 'Failed to construct rd_digests_dict.'
if debug: print '\n\t-- Reference designators (%d) have (%d) rd_digests' % (len(rds), len(rd_digests... | |
"""Test the custom authorization class."""
import os
import uuid
import time
import secrets
import pytest
import jwt
import datetime
from rest_framework import status
from django.core.exceptions import SuspiciousOperation
from rest_framework.test import APIRequestFactory
from ..api.login import TokenAuthorizationOIDC
f... | |
# Created byMartin.cz
# Copyright (c) <NAME>. All rights reserved.
from .. properties import *
class Frame(object):
"""
Represents a rectangular frame defined by its top-left coordinates, width
and height.
"""
def __init__(self, x, y, width=0, height=0):
"""
Initializes a new instance of Frame.
Args:
... | |
#!/usr/bin/python
#use to parse ms-sql-info nmap xml
#https://nmap.org/nsedoc/scripts/ms-sql-info.html
#nmap -Pn -n -p135,445,1433 --script ms-sql-info <host> -oX results-ms-sql-info.xml
#nmap -Pn -n -p135,445,1433 --script ms-sql-info -iL <hosts_file> -oX results-ms-sql-info.xml
# python3 mssql-info-parser.py re... | |
# Authors: <NAME> <<EMAIL>>
# <NAME>
#
# License: BSD (3-clause)
import logging
import warnings
import numpy as np
from scipy import linalg
from numpy.linalg import pinv
from .asr_utils import (geometric_median, fit_eeg_distribution, yulewalk,
yulewalk_filter, ma_filter, block_covariance)
class ASR():
"""Artifact... | |
import io
import tensorflow as tf
import h5py
from tensorflow.python.keras.saving import hdf5_format
import basics.base_utils as _
from mlpug.trainers.training import *
from mlpug.mlpug_exceptions import TrainerInvalidException, \
TrainerStateInvalidException, \
BatchNotChunkableException, \
MLPugException, \
L... | |
'verbose_name_plural': '24 Penghapusan ATL KESBANGPOL',
},
bases=('atl.penghapusanatl',),
),
migrations.CreateModel(
name='PenghapusanATLKominfo',
fields=[
],
options={
'verbose_name': '43 Penghapusan ATL Kominfo',
'proxy': True,
'verbose_name_plural': '43 Penghapusan ATL Kominfo',
},
bases=('atl.penghapus... | |
# Copyright (c) 2020 <NAME>
"""mech tests"""
import os
import re
from unittest.mock import patch, mock_open, MagicMock
from click.testing import CliRunner
import mech.mech
import mech.vmrun
from mech.mech_cli import cli
import mech.mech_instance
@patch('mech.utils.locate', return_value=None)
def test_mech_list_wit... | |
they exist in
historical data.
"""
name = CharTextField(unique=True)
slug = models.SlugField(null=True)
group = models.CharField(
max_length=10,
choices=(("yes", "yes"), ("no", "no"), ("skip", "skip"), ("other", "other")),
null=True,
)
notes = CharTextField(null=True, blank=True)
disabled = models.BooleanFi... | |
to the
LCOS center. The Xm and Ym shape (array's rows x cols) should
be the same as the spot spot grid shape (pattern's rows x cols).
labels (2D array): array of spot labels (ints) starting from 0.
Defines rectangular regions for each spot on the LCOS image.
phase_max (float): constant phase added to the pattern (... | |
<filename>audioSegmentation.py
import numpy
import sklearn.cluster
import time
import scipy
import os
import audioFeatureExtraction as aF
import audioTrainTest as aT
import audioBasicIO
import matplotlib.pyplot as plt
from scipy.spatial import distance
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import s... | |
<reponame>juliawestermayr/schnetpack
import argparse
from argparse import ArgumentParser
from schnetpack.datasets import (
QM9,
ANI1,
MD17,
OrganicMaterialsDatabase,
MaterialsProject,
)
class StoreDictKeyPair(argparse.Action):
"""
From https://stackoverflow.com/a/42355279
"""
def __init__(self, option_strin... | |
<reponame>nimachm81/SpheroidalFuncs
__all__ = ["SpheroidScattering"]
from scipy.integrate import quadrature, quad
import numpy as np
from scipy import constants
import matplotlib.pyplot as plt
import matplotlib
from scipy.special import pro_rad1, pro_rad2, pro_ang1
import specfun
class SpheroidScattering:
def ... | |
required parameter 'name' is set
if ('name' not in params) or (params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `replace_autoscaling_v1_namespaced_horizontal_pod_autoscaler`")
# verify the required parameter 'namespace' is set
if ('namespace' not in params) or (params['n... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for model evaluation.
Compare the results of some models with other programs.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import types
try:
import cPickle as pickle
except ImportError:
import pi... | |
[]
list_chrom = []
for start,end in breaks:
if len(timespend) == 0:
stimespend = []
else:
stimespend = timespend[start:end]
list_chrom.append(Chrom(start,end,timespend=stimespend))
def MRT():
if len(list_chrom) == 1:
return list_chrom[0].mrt
else:
return np.concatenate([c.mrt for c in list_chrom])
def RF... | |
workflow WHERE market = '{}' AND exchange = '{}' AND userid = {} AND core_strategy = '{}' ".format(
robot.market, robot.exchange_abbr, robot.user_id, robot.core_strategy)
rows = sql.query(sql_string)
# Check workflow if it is not saved in robot
if robot.wf_id is None:
try:
robot.wf_id = rows[0][0] # first result... | |
<reponame>faycalki/tainted-paths
from header_common import *
from header_presentations import *
from header_mission_templates import *
from ID_meshes import *
from header_operations import *
from header_triggers import *
from module_constants import *
from header_items import *
import string
########################... | |
<reponame>john-doe-3141592653/XXX
'''
Copyright or © or Copr.
This software is a computer program whose purpose is to generate random
test case from a template file describing the data model.
This software is governed by the CeCILL-B license under French law and
abiding by the rules of distribution of free software. ... | |
<reponame>Mooonside/SEGS
# Copyright 2018 The TensorFlow Authors 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... | |
# -----------------------------------------------------------------------------
# Copyright 2020 <NAME>
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright... | |
('pad_xx', c_char * 656) )
plist.append( ('rhi_dfov', c_float) )
plist.append( ('pad_xx', c_char * 80) )
plist.append( ('rhi_scanspacing', c_float) )
plist.append( ('pad_xx', c_char * 8) )
plist.append( ('rhi_loc', c_float) )
plist.append( ('rhi_ctr_R', c_float) )
plist.append( ('rhi_ctr_A', c_float) )
plist.ap... | |
<gh_stars>10-100
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021 <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 i... | |
to make DNS changes.'])
assert_failed_change_in_error_response(errors[2], input_name=f"update.{ok_zone_name}", record_data="192.168.127.12",
error_messages=[f'User \"dummy\" is not authorized. Contact zone owner group: {ok_group_name} at <EMAIL> to make DNS changes.'])
assert_failed_change_in_error_response(errors[3... | |
(1. + bervmax / c) / (1. + RV_table[0] / c)
llmax = ll[imax - 1 - 1] / (1. + berv / c) * (1. - bervmax / c) / (1. + RV_table[nx_ccf - 1] / c)
imin = 0; imax = n_mask - 1
#? turns out cpl_table_get indexes stating at 0...
while (imin < n_mask and mask['lambda'][imin] < (llmin + 0.5 * mask_width / c * llmin)): imin... | |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright (c) 2021. <NAME> +
# All rights reserved. +
# This file is part of the edoC discord bot project , +
# and is released under the "MIT License Agreement". Please see the LICENSE +
# file that should have been ... | |
1, None, 1, None ) } )
if on_local_files:
# same deal, just smaller file domain
test_ac( 'mc bad*', my_service_key, CC.LOCAL_FILE_SERVICE_KEY, { 'mc bad' : ( 2, None, 0, None ), 'mc good' : ( 2, None, 0, None ) }, { 'mc good' : ( 3, None, 0, None ) } )
test_ac( 'pc bad*', public_service_key, CC.LOCAL_FILE_SERVI... | |
import occ.spawn as mspawn
import time
import datetime
import occ.yeshup as yeshup
import os
import traceback
import functools
bind = functools.partial
from occ.inbox import *
SHORT_WAIT = 0.01
#############################################################################
# utility functions
# this runs f in anot... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Sept 12 16:35:13 2016
@author: <NAME>
"""
# # fill_array_scan_2b
def maxj_readline_func(expand_data_to_fit_line, nb_px_fast, offset, nb_el_line_list, ct_i, ishg_EOM_AC_flag, ovrsmp_ph, oversampling00, oversampling, method_fast, numpy):
# # only if read_duration_lin... | |
<filename>PhotochemPy/PhotochemPy.py
import numpy as np
from ._photochem import photochem, photochem_data, photochem_vars, photochem_wrk
import sys
import os
rootdir = os.path.dirname(os.path.realpath(__file__))+'/'
photochem_vars.rootdir = "{:500}".format(rootdir)
class PhotochemError(Exception):
pass
class Photoc... | |
def test_get_cmd_in_config(self):
fake_conf = utils.InstanceConfig(
service='',
cluster='',
instance='',
config_dict={'cmd': 'FAKECMD'},
branch_dict=None,
)
assert fake_conf.get_cmd() == 'FAKECMD'
def test_get_env_default(self):
fake_conf = utils.InstanceConfig(
service='fake_service',
cluster='fake_cluste... | |
<reponame>pablobesada/tw
#encoding: utf-8
import re
import pymongo
class ProductMatch(object):
def __init__(self):
self.brand = ""
self.product = ""
self.sentiment = None
self.brand_matched_word = ""
self.brand_matched_pos = (-1, -1)
self.product_matched_word = ""
self.product_matched_pos = (-1, -1)
self.s... | |
value being a tuple with the numpy arrays
containing the aggregates for each range and in second position the genomic ranges
Note that ranges with same same startpoint but different endpoint will
be considered as two separate ranges
:param group_key: The group key under which the grouping has been stored
:param ... | |
(' + debug_info + '): ' + str(e))
# def _load_phytowin_datasets(self):
# """ """
# try:
# toolbox_utils.Logging().log('') # Empty line.
# toolbox_utils.Logging().log('Importing datasets...')
# toolbox_utils.Logging().start_accumulated_logging()
# self._write_to_status_bar('Importing datasets...')
#
# # Show... | |
<reponame>Daulbaev/adversarial-library<gh_stars>10-100
# Adapted from https://github.com/fra31/auto-attack
import math
from functools import partial
from typing import Tuple, Optional, Union
import torch
from torch import nn, Tensor
from torch.nn import functional as F
from adv_lib.utils.losses import difference_of_l... | |
# -*- coding: utf-8 -*-
"""Command line interface for diluvian."""
from __future__ import print_function
import argparse
import logging
import os
import random
import re
import six
from .config import CONFIG
def _make_main_parser():
"""Construct the argparse parser for the main CLI.
This exists as a separate ... | |
import numpy as np
from numpy import dot as dot
from numpy.linalg import inv as inverse
import sys, cv2
from .utils import *
import time
from .processor import Processor
from .line_detection_processor import LineDetectionProcessor
from .dial_processor import DialProcessor
class TrackerProcessor(Processor):
@proper... | |
#!/usr/bin/env python3
"""pybuild -- build python3 from source (currently for macos)
usage: pybuild.py [-h] [-v] {all,framework,shared,static} ...
pybuild: builds python from src
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
subcommands:
v... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygtk
pygtk.require('2.0')
import gobject
import random
import os
import sys
import gtk
import math
import platform
import webbrowser
#EndImports
# Pyperclip v1.3 (Extract, only copy functions have been implemented to use with dualPrint.)
# A cross-... | |
to_datetime : Convert argument to datetime.
Notes
-----
If the precision is higher than nanoseconds, the precision of the duration is
truncated to nanoseconds for string inputs.
Examples
--------
Parsing a single string to a Timedelta:
>>> ps.to_timedelta('1 days 06:05:01.00003')
Timedelta('1 days 06:05:01.... | |
*args, **kwargs):
for k, v in self.widgets.items():
v.pack(side='left', fill='both', expand=True)
super().pack(*args, **kwargs)
def grid(self, *args, **kwargs):
"""Layout child widgets within the only child frame."""
self.grid_rowconfigure(0, weight=1)
# Main widgets
col = 0
for k, v in self.widgets.items(): ... | |
"""
Author: Anonymous
Description:
Contains several features for analyzing and comparing the
performance across multiple experiments:
- perfloss : Performance w.r.t. test/train loss ratio and the
used AE architecture
- perfratio : Showing performance w.r.t. test, train loss and the
used AE architecture
- bd... | |
<gh_stars>0
# Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
thismask
# apply the masks
for col in cols:
if '.' in col:
key, subkey = col.split('.')
lcdict[key][subkey] = lcdict[key][subkey][exclind]
else:
lcdict[col] = lcdict[col][exclind]
nafter = lcdict['time'].size
LOGINFO('removed timestoignore, ndet before = %s, ndet after = %s'
% (nbefore, nafter))
########... | |
<reponame>primkey7607/deeplens-cv
"""This file is part of DeepLens which is released under MIT License and
is copyrighted by the University of Chicago. This project is developed by
the database group (chidata).
tiered_videoio.py uses opencv (cv2) to read and write files to disk. It contains
primitives to encode and d... | |
os.path.exists(os.path.dirname(filename)):
try:
os.makedirs(os.path.dirname(filename))
except OSError as exc: # Guard against race condition
if exc.errno != errno.EEXIST:
raise
with open("files_refactored/" + mainfile, mode='w', newline='') as f:
f.write(my_listener.token_stream_rewriter.getDefaultText())
# ++... | |
#!/usr/bin/env python3
# *******************************************************
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
# * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
# * WARRANTIES OR CO... | |
# userVerificationRequired but not done
continue
d = key_data[:32]
REM_GETASSERTION_PARAMETERS.append([d, user_description, pkc_descriptor['id'], credRandom])
else:
# search for applicable residential keys
for storage in ks_ctap2.load_rk(data[1]):
rk_data = storage['rk_data']
if keepalive(channel) == CTAP2_ERR_... | |
if inPlace:
if agent.currentSpd < 100:
localTarget = toLocal(enemy_goal, agent.me)
angle = math.degrees(math.atan2(localTarget[1], localTarget[0]))
if abs(angle) > 35:
agent.setGuidance(enemy_goal)
#return SimpleControllerState()
return arrest_movement(agent)
return driveController(agent, center, agent.time + ... | |
_invoke_api('ntdtest-iternoread-get', *args)
return api_call
def ntdtest_iternoread_get_alt(*args):
api_call = _invoke_api('ntdtest-iternoread-get-alt', *args)
return api_call
def ntdtest_iternoread_get_iter(*args):
api_call = _invoke_api('ntdtest-iternoread-get-iter', *args)
return api_call
def ntdtest_iternor... | |
<reponame>huangyingw/fastai_fastai
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# split_at_heading: true
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# hide
# skip
from ... | |
)
# Big-endian output
decoded = decode_frame(header + data, 2 * 3, 32, '>')
arr = np.frombuffer(decoded, np.dtype('>u4'))
assert [0, 16777216, 65536, 256, 1, 4294967295] == arr.tolist()
# Little-endian output
decoded = decode_frame(header + data, 2 * 3, 32, '<')
arr = np.frombuffer(decoded, np.dtype('<u4'))
as... | |
(InstanceTaskConfig, InstanceTaskConfig.thrift_spec), None, ), # 2
(3, TType.STRUCT, 'settings', (JobUpdateSettings, JobUpdateSettings.thrift_spec), None, ), # 3
)
def __init__(self, initialState=None, desiredState=None, settings=None,):
self.initialState = initialState
self.desiredState = desiredState
self.sett... | |
from __future__ import unicode_literals
import logging
import os
import sys
import getpass
from six import reraise
from io import StringIO
from functools import wraps
from collections import defaultdict
import sprinter.lib as lib
from sprinter.core import PHASE, load_global_config, Directory, Injections, Manifest, loa... | |
<reponame>JustinTW/pulumi-eks<filename>python/pulumi_eks/_inputs.py
# coding=utf-8
# *** WARNING: this file was generated by pulumi-gen-eks. ***
# *** 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... | |
<filename>scaaml/capture/scope/ps6424e.py<gh_stars>0
"""This code is modified from the ChipWhisperer project:
http://www.github.com/newaetech/chipwhisperer"""
from __future__ import absolute_import
import ctypes
from decimal import Decimal, ROUND_HALF_DOWN
import traceback
from typing import OrderedDict
from chipwhi... | |
# Mar21, 2022
##
#---------------------------------------------------------------------
# SERVER only input all files (.bam and .fa) output MeH matrix in .csv
# August 3, 2021 clean
# FINAL github
#---------------------------------------------------------------------
import random
import math
import pysam
import csv
... | |
else:
self.form.deiconify()
self.ifd.entryByName['mol_list']['widget'].setlist(self.mol_list)
self.ifd.entryByName['+Silder']['widget'].canvas.config(bg="Blue")
self.ifd.entryByName['-Silder']['widget'].canvas.config(bg="Red")
self.ifd.entryByName['-visible']['wcfg']['variable'].set(True)
self.ifd.entryByName['... | |
E501
A list of valid options for the property. This field is required for enumerated properties, but will be empty for other property types. # noqa: E501
:return: The options of this ModelProperty. # noqa: E501
:rtype: list[Option]
"""
return self._options
@options.setter
def options(self, options):
"""Sets ... | |
snapshotsessionname):
volumeGroupUri = self.query_by_name(name)
snapshotsessionUri = self.query_snapshotsession_uri_by_name(name, snapshotsessionname)
(s, h) = common.service_json_request(
self.__ipAddr, self.__port,
"GET",
VolumeGroup.URI_VOLUME_GROUP_SNAPSHOT_SESSION_SHOW.format(volumeGroupUri, snapshotsessionU... | |
#!/usr/bin/env python
""" Locate single cells
Annotate the files with points in a nested layout:
.. code-block:: bash
$ ./cell_locator.py \\
--sel-mode point \\
--layout nested \\
-r /path/to/data
Annotate tiles within a certain range:
.. code-block:: bash
$ ./cell_locator.py \\
--sel-mode point \\
--layo... | |
is reachable
for i in range(0,4):
if (vm5_fixture.ping_to_ip(self.vm2_macvlan_ip.split('/')[0])):
ping_to_macvlan = True
break
self.logger.warn("Retrying ping")
assert ping_to_macvlan, "Ping to macvlan failed."
# checking evpn table
evpn_route = self.agent_inspect[vm5_node_ip].get_vna_evpn_route(
vm5_vrf_id,
... | |
# this is not going to overflow in CPython
raise OverflowError
except OverflowError:
msg = "too many decimal digits in format string"
raise ValueError(msg)
result += c - ord("0")
else:
break
i += 1
if i == start:
result = -1
return result, i
class TemplateFormatter(object):
# Auto number state
ANS_INIT =... | |
prop
@pulumi.output_type
class SeldonDeploymentSpecPredictorsComponentSpecsSpecInitContainersStartupProbeTcpSocket(dict):
"""
TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook
"""
def __init__(__self__, *,
port: 'outputs.SeldonDeploymen... | |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2016 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | |
<filename>utility_active.py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as tick
# Color
from matplotlib.colors import LinearSegmentedColormap
import cartopy.crs as ccrs
projection = ccrs.Mollweide(central_longitude=0)
import matplotlib.colors as colors
color_zesty_cbf = [(0.0, 0.1098... | |
from membase.api.rest_client import RestConnection
from membase.helper.rebalance_helper import RebalanceHelper
from rebalance_new.rebalance_base import RebalanceBaseTest
from BucketLib.BucketOperations import BucketHelper
from rebalance_new import rebalance_base
from sdk_exceptions import SDKException
class Rebalance... | |
= self._DealCalcPriceForSwap(propIGet, propIGive, 0)
if price == Deal.NO :
return self._DealReject()
if price < 0 :
price = -price
return self._DealAccept(monopyly.DealResponse(
action = monopyly.DealResponse.Action.ACCEPT,
minimum_cash_wanted = int(price)))
return self._DealAccept(monopyly.DealResponse(
ac... | |
= kwargs.get(
'ncbiTaxonId', None)
self.sourceAccessions = kwargs.get(
'sourceAccessions', None)
self.sourceDivergence = kwargs.get(
'sourceDivergence', None)
self.sourceURI = kwargs.get(
'sourceURI', None)
class ReferenceSet(ProtocolElement):
"""
A `ReferenceSet` is a set of `Reference`s which typically com... | |
# Setup
from __future__ import print_function
from rh_logger.api import logger
import rh_logger
import logging
import os
import numpy as np
import time
import sys
from scipy.spatial import distance
from scipy import spatial
import cv2
import argparse
from mb_aligner.common import utils
from rh_renderer import models
fr... | |
: 'disable',
'configured' : 'disable',
'starting' : 'disable',
'paused' : 'disable' }
}
# Translate drp alias to detector name
# For example: 'cam_1' -> 'cam'
def detector_name(drp_alias):
return drp_alias.rsplit('_', 1)[0]
# Count the number of drp segments matching a detector name.
# If only_active=True, count ... | |
0x40, 0x81, 0x3E, 0x1C, 0x38, 0x71, 0xF0, 0x0B, 0x06, 0x07, 0x01,
0x03, 0x00, 0x41, 0x00, 0x20, 0x80, 0x10, 0x40, 0x08, 0x20, 0x04, 0x10,
0x02, 0x08, 0x01, 0x04, 0x00, 0x82, 0x00, 0x41, 0x00, 0x20, 0x80, 0x13,
0xF0, 0x3E, 0x07, 0xC0, 0x30, 0x60, 0x80, 0x22, 0x00, 0x24, 0x00, 0x50,
0x00, 0x60, 0x00, 0xC0, 0x01, 0x80... | |
<filename>TDMS/MvImport/MvCameraControl_header.py
# generated by 'xml2py'
# flags '-c -d -v C:\test_h\MvCameraControl.xml -o MvCameraControl_header.py'
from ctypes import *
STRING = c_char_p
PixelType_Gvsp_BayerBG12 = 17825811
MV_TRIGGER_SOURCE_LINE1 = 1
PixelType_Gvsp_Mono8_Signed = 17301506
MV_BALANCEWHI... | |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | |
<reponame>AssembleSoftware/IoTPy
"""
This module has implementations of the prime-number sieve of
Erasthostenes. See:
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
EXAMPLE 1
The first example computes all primes up to N, for some positive
integer N. This example illustrates how one agent's action can
create othe... | |
None:
self.documentSchema = str()
self.tableSchema = str()
@property
def documentSchema(self) -> str:
"""Getter: The native espresso document schema."""
return self._inner_dict.get('documentSchema') # type: ignore
@documentSchema.setter
def documentSchema(self, value: str) -> None:
"""Setter: The native ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.