input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"""
Shared methods for Batch pipelines.
Batch docs: https://hail.is/docs/batch/api/batch/hailtop.batch.job.Job.html#hailtop.batch.job.Job
"""
import collections
import contextlib
import itertools
import logging
import os
import subprocess
from typing import List, Union
import configargparse
import hailtop.batch as ... | |
MOL 2 24.096 12.184 15.639 1.00 0.00 C \n',
'ATOM 834 H1 MOL 2 24.205 9.449 21.095 1.00 0.00 H1- \n',
'ATOM 835 H2 MOL 2 22.553 12.378 19.986 1.00 0.00 H1- \n',
'ATOM 836 H3 MOL 2 23.476 12.911 18.186 1.00 0.00 H1- \n',
'ATOM 837 H4 MOL 2 22.898 11.048 16.874 1.00 0.00 H1- \n',
'ATOM 838 H5 MOL 2 24.391 10.557 16.... | |
# for the prefix check, it is important that the compared pathes both have trailing slashes,
# so that a path /foobar will NOT be accepted with --restrict-to-path /foo option.
path_with_sep = os.path.join(path, '') # make sure there is a trailing slash (os.sep)
for restrict_to_path in self.restrict_to_paths:
restri... | |
# -*- 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 obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
template = {"group": "", "alternate_configs": [{"members": [], "linked_song": []}]}
same_group_different_artists = [
{
"group": "StylipS",
"alternate_configs": [
{
"members": [
"<NAME>",
"<NAME>",
"<NAME>",
"<NAME>",
],
"linked_song": [
13264,
13265,
20633,
13731,
13807,
13809,
14336,
21216,
14835,... | |
"""
Getter method for idle, mapped from YANG variable /system/cpus/cpu/state/idle (container)
YANG Description: Percentage of CPU time spent idle.
"""
return self.__idle
def _set_idle(self, v, load=False):
"""
Setter method for idle, mapped from YANG variable /system/cpus/cpu/state/idle (container)
If this v... | |
indexes'''
self.__open_db()
self.__open_collections()
u, v = self.endpoint_names
self.edges.create_index(
[
(u, ASCENDING),
(v, ASCENDING)
],
name='incident',
unique=True)
def __check_metadata(self, metadata):
'''Checks if the provided metadata matches the existing
metadata in the meta collection'''
if... | |
116.50 SOURCE3_SOURCE5 720 1.3034
c3-c -ca 64.2 118.40 SOURCE4_SOURCE5 749 1.4991
c3-c -cc 65.0 117.29 CORR_SOURCE5 118 1.7737
c3-c -cd 65.0 117.29 CORR_SOURCE5 118 1.7737
c3-c -ce 64.9 116.44 CORR_SOURCE5 543 1.3559
c3-c -cf 64.9 116.44 CORR_SOURCE5 543 1.3559
c3-c -cg 66.0 115.00 SOURCE2 1
c3-c -ch 66.0 115.00 SOURCE... | |
<filename>network.py
import numpy as np
import tensorflow as tf
import re
import math
from config import *
from .deform_conv_layer import deform_conv_op as deform_conv_op
DEFAULT_PADDING = 'SAME'
DEFAULT_TYPE = tf.float32
def include_original(dec):
""" Meta decorator, which make the original function callable (vi... | |
import datetime
import json
from StringIO import StringIO
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.serializers import json as djson
from django.utils.encoding import force_unicode
from tastypie.bundle import Bundle
from tastypie.exceptions import Unsuppor... | |
kdt
:param random_kdt_num_archs: Number of architectures for random kdt
:return: None
"""
prefix_name = lambda prefix, name: name if prefix is None else f'{prefix}-{name}'
try:
fname = prefix_name(prefix, f'rank_change-{epoch}.pdf')
fig = process_rank_data_nasbench(save_data, os.path.join(self.exp_dir, fname))
... | |
import asyncio
import functools
import collections
import locale
import threading
from contextlib import contextmanager
__all__ = (
"with_timeout",
"StreamIO",
"Throttle",
"StreamThrottle",
"ThrottleStreamIO",
"END_OF_LINE",
"DEFAULT_BLOCK_SIZE",
"wrap_with_container",
"AsyncStreamIterator",
"AbstractAsyncL... | |
z_range[1], nsim )
# Draw a random redshift from a uniform distribution
self.z = uniform( low=z_range[0], high=z_range[1], size=nsim )
lightcurvelist = []
peakabsmagRlist = []
modelparamlist = []
subclasslist = []
modelindexlist = []
sourcenamelist = []
t0list = []
if sntype=='Ia':
x0list = []
x1list = []... | |
'states', 'cells'],
outputs=['output_policy', 'states', 'cells'])
def apply_policy(self, input_image, states, cells):
h, c = self.lstm_block.apply(inputs=self.linear_to_lstm.apply(
self.shared_a3c.apply(input_image)),
states=states, cells=cells)
h = h.sum(axis=1)
c = c.sum(axis=1)
output_policy = self.policy... | |
<filename>tensorflow_model_analysis/view/util.py<gh_stars>0
# Lint as: python3
# Copyright 2018 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 obtain a copy of the License at
#
# https://www.apache.org/licenses/... | |
E501
:return: The os_api_level of this Device. # noqa: E501
:rtype: integer
"""
return self._os_api_level
@os_api_level.setter
def os_api_level(self, os_api_level):
"""Sets the os_api_level of this Device.
API level when applicable like in Android (example: 15).
# noqa: E501
:param os_api_level: The os_ap... | |
def pid_query
def query_changes (self, * filter, ** kw) :
"""Return changes matching `filter` and `kw`"""
return self.ems.changes (* filter, ** kw)
# end def query_changes
@TFL.Meta.Lazy_Method_RLV
def r_incorrect (self, gauge = Gauge_Logger (), eiter = None) :
"""Returns all objects which are region-wise inco... | |
#!/usr/bin/env python3
"""
USBI2C AVR Miner 3.1 © MIT licensed
Modified by JK-Rolling
20220101
Full credit belong to
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2022
"""
from os import _exit, mkdir
from os import name as osname
from os import path
from os import syst... | |
<reponame>henriktao/pulumi-azure
# 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, Sequenc... | |
})
// SV length
sizeChart
.width(plotw).height(ploth).gap(1)
.margins({top: 10, right: 50, bottom: 30, left: 40})
.x(d3.scaleLinear().domain([0, sizeKeys.length]))
.round(Math.floor)
.brushOn(true)
.elasticX(true)
.dimension(sizeDimension)
.group(index_group(nonEmptySizeGroup))
.elasticY(true)
.yAxisLabel(... | |
params or
params['list_id'] is None):
raise ValueError("Missing the required parameter `list_id` when calling ``") # noqa: E501
# verify the required parameter 'month' is set
if ('month' not in params or
params['month'] is None):
raise ValueError("Missing the required parameter `month` when calling ``") # noqa: E... | |
AuiDockingGuideWindow(self, rectCenter, wx.CENTER, True, useAero)
# top-left diamond
tld = [wx.Point(rectTop.x, rectTop.y+rectTop.height-8),
wx.Point(rectLeft.x+rectLeft.width-8, rectLeft.y),
rectTop.GetBottomLeft()]
# bottom-left diamond
bld = [wx.Point(rectLeft.x+rectLeft.width-8, rectLeft.y+rectLeft.height),... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 <NAME> <<EMAIL>>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 withou... | |
from __future__ import division
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import cPickle as pickle
import numpy as np
import os, sys
try:
from scipy.stats import linregress
except ImportError:
print "Didn't load linregress from scipy.stats"
class Collecting_clashscore_data(object):
d... | |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# TODO: import only necessary tensorflow functions
import tensorflow as tf
import tensorflow_datasets as tfds
from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay,\
roc_curve, roc_auc_score, cl... | |
""" Wrapper function for performing CCI analysis, varrying the analysis based on
the inputted data / state of the anndata object.
"""
import os
import numba
import numpy as np
import pandas as pd
from typing import Union
from anndata import AnnData
from .base import calc_neighbours, get_lrs_scores, calc_distance
from... | |
pulumi.get(self, "locations")
@locations.setter
def locations(self, value: pulumi.Input[Sequence[pulumi.Input['AlbLoadBalancerAllocationPolicyLocationArgs']]]):
pulumi.set(self, "locations", value)
@pulumi.input_type
class AlbLoadBalancerAllocationPolicyLocationArgs:
def __init__(__self__, *,
subnet_id: pulumi.... | |
= ['_'.join(i.split('(')) for i in sixyNineVideos] ### Renaming the experiment Ids taken from csv file
sixyNineVideos = ['_'.join(i.split(')')) for i in sixyNineVideos] ### Renaming the experiment Ids taken from csv file
sixyNineVideos = ['_'.join(i.split('&')) for i in sixyNineVideos] ### Renaming the experiment Ids... | |
fourier_amplitude[numpy.where(fourier_amplitude > 1.0)] = 1.0
fourier_amplitude[2:][numpy.where(numpy.greater(fourier_amplitude[2:], fourier_amplitude[1:-1]))] = 0
else:
if fourier_amplitude > 1.0 : return 1.0
if fourier_amplitude < 0.0 : return 0.0
#check the previous
return fourier_amplitude
#################... | |
#!/usr/bin/env python
#
# pKaTool - analysis of systems of titratable groups
# Copyright (C) 2010 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | |
####Please do not remove lines below####
from lmfit import Parameters
import numpy as np
import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('./Functions'))
sys.path.append(os.path.abspath('./Fortran_rountines'))
####Please do not remove lines above####
####Import your modules be... | |
<reponame>zackbatist/QualCoder
# -*- coding: utf-8 -*-
'''
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
t... | |
<reponame>robot-acceleration/RBDReference<filename>RBDReference.py
import numpy as np
import copy
np.set_printoptions(precision=4, suppress=True, linewidth = 100)
class RBDReference:
def __init__(self, robotObj):
self.robot = robotObj
def mxS(self, S, vec, alpha = 1.0):
if S[0] == 1:
return self.mx1(vec,alpha)
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# # PyKOALA: KOALA data processing and analysis
# by <NAME> and <NAME>
# Extra work by <NAME> (MQ PACE student)
# Plus Taylah and Matt (sky subtraction)
from __future__ import absolute_import, division, print_function
from past.utils import old_div
version = "Version 0.72 - 13t... | |
# Copyright 2014 Altera Corporation. All Rights Reserved.
# Copyright 2015-2017 <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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | |
<gh_stars>10-100
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, mod... | |
in the header
3
>>> field_expected_1 = 'project.s1'+util.str_source_variable_separator+'a'
>>> field_expected_1 in header_combined
True
>>> f_expect2 = 'project.s1'+util.str_source_variable_separator+'b'
>>> f_expect3 = 'project.s2'+util.str_source_variable_separator+'z'
>>> all([f_expect3 in header_combined, f... | |
utils.runscript(script, args)
assert os.path.exists(outfile)
return outfile
def test_filter_stoptags():
infile = utils.copy_test_data('test-abund-read-2.fa')
in_dir = os.path.dirname(infile)
stopfile = utils.get_temp_filename('stoptags', in_dir)
# first, copy test-abund-read-2.fa to 'test.fa' in the temp dir.... | |
<reponame>pyrv/pycontract<filename>pycontract_core.py<gh_stars>0
"""
PyContract
"""
import copy
import inspect
from abc import ABC
from dataclasses import dataclass
from typing import List, Set, Callable, Optional, Dict
import pyfiglet
def print_banner(text: str):
'''
Prints a banner as ASCII art in slant format.
... | |
"1.7",
"пытлив": "1.7",
"укромн": "1.7",
"обдума": "1.7",
"ценостн": "1.7",
"звучн": "1.7",
"кокетлив": "1.7",
"неуязвим": "1.7",
"статусн": "1.7",
"горчичн": "1.7",
"обезжирен": "1.7",
"эталон": "1.7",
"разоблачительн": "1.7",
"прийшл": "1.7",
"юниорск": "1.7",
"зрим": "1.7",
"взыскательн": "1.7",
"эт... | |
'фагоцит',
'falsifika(ts)iya': 'фальсификация',
'farma(ts)evt': 'фармацевт',
'farma(ts)evtika': 'фармацевтика',
'farma(ts)iya': 'фармация',
'federa(ts)iya': 'федерация',
'fermenta(ts)iya': 'ферментация',
'film-kon(s)ert': 'фильм-концерт',
'filtra(ts)iya': 'фильтрация',
'fiton(s)id': 'фитонцид',
'forma(ts)iya'... | |
Markers', icon='RENDER_RESULT').tmarkers = True
elif len(marker_list_camera) == len(cameras):
if scene.frame_current>0 :
row.operator("cameramanager.render_all_camera",text='Render All Cameras', icon='RENDER_RESULT')
else:
row.operator("cameramanager.render_all_camera",text='Render All', icon='RENDER_RESULT')
r... | |
<gh_stars>10-100
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_almost_equal
import scarlet
class TestProjections(object):
"""Test project_image
Because the behavior of projections is dependent on
whether the input image and the output image have an
even or odd number of p... | |
- mckin/mbkin)))/
(1216215*mbkin) + (64*mckin**2*(-72701 + 99099*np.log(2) +
99099*np.log(1 - mckin/mbkin)))/(405405*mbkin**2) -
(64*mckin**3*(-72701 + 99099*np.log(2) + 99099*np.log(1 - mckin/mbkin)))/
(110565*mbkin**3) + (32*mckin**4*(-72701 + 99099*np.log(2) +
99099*np.log(1 - mckin/mbkin)))/(22113*mbkin**4) -
... | |
from abc import ABC, abstractmethod
from enum import Enum
from functools import partial
# from math import isinf
from typing import Union, Optional, Any
from typing import Callable, Tuple, Dict, List, Set, Type # noqa: F401
from ..builtin_values import Bool, ops_symbols
from ..abstract_value import AbstractValue
from ... | |
description_btn]
box244 = Box(children=row, layout=box_layout)
name_btn = Button(description='activated_speed', disabled=True, layout=name_button_layout)
name_btn.style.button_color = 'lightgreen'
self.float229 = FloatText(value='0.4', step='0.1', style=style, layout=widget_layout)
units_btn = Button(description... | |
+ Ad[3, 2] * tp2_2 + Ad[3, 3] * tp2_3
)
values[n] = (
Phi0_0
* (
Phi1_0
* (
Phi2_0 * (coefs[i0 + 0, i1 + 0, i2 + 0])
+ Phi2_1 * (coefs[i0 + 0, i1 + 0, i2 + 1])
+ Phi2_2 * (coefs[i0 + 0, i1 + 0, i2 + 2])
+ Phi2_3 * (coefs[i0 + 0, i1 + 0, i2 + 3])
)
+ Phi1_1
* (
Phi2_0 * (coefs[i0 + 0, i1 + 1, i2 + 0])
+ ... | |
import argparse
import glob
import re
import sys
from typing import List
print_columns = ["name", "total_synthesis_time"]
regel_columns = ["regel_time", "regel_timeout", "regel_sketch", "regel_solution"]
all_columns = ["name", "enumerator", "timed_out", "total_synthesis_time", "regex_synthesis_time",
"first_regex_t... | |
the form in order to minimize fetching of data. If the query parameter is ommitted all variables are fetched. If the query parameter contains non-existent variable names, the variable names are ignored.
:param bool deserialize_values: Determines whether serializable variable values (typically variables that store cust... | |
# Copyright (c) 2017, Teriks
# All rights reserved.
#
# pake is distributed under the following BSD 3-Clause License
#
# 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 ab... | |
<filename>cblb/models_8bit_cblb.py
import numpy as np
from models import *
def MUX_8_1_model_ode(state, T, params):
delta_L, gamma_L_X, n_y, theta_L_X, eta_x, omega_x, m_x, delta_x, rho_x, gamma_x, theta_x, r_X = params
params_yes = gamma_x, n_y, theta_x, delta_x, rho_x
params_not = delta_L, gamma_L_X, n_y, theta_L... | |
<reponame>mmabey/fhir.resources<gh_stars>0
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. import capa... | |
<gh_stars>0
from abc import ABC, abstractmethod
from threading import Timer, Lock, Thread
import serial
import io
import logging
import json
import re
import queue
import time
import RPi.GPIO as GPIO
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTShadowClient
class PhysicalThing(object):
_logger = logging.getLogger... | |
import os
import unittest
import pikepdf
import pdf_preflight.rules as rules
import pdf_preflight.profiles as profiles
pdf_folder = os.path.join(os.path.dirname(__file__), "pdfs")
class TestPdfPreflight(unittest.TestCase):
def test_profile__pdfa1a(self):
filename = os.path.join(pdf_folder, "pdfa-1a.pdf")
self.a... | |
plot-metrics can be specified as keyboard argument 'plot_metrics'. It's value can be:
- Empty: default value used is 'price'
- plot_metrics = a String 'method' corresponding to a valid '.method()' implemented by self.fin_inst object
- if plot_metrics == 'implied_volatility', method .plot_iv() is called (implement... | |
<filename>volttron/platform/vip/agent/subsystems/configstore.py
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2017, Battelle Memorial Institute.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | |
<filename>common/firewall/base.py
from builtins import range
from common.neutron.base import BaseNeutronTest
from tcutils.util import get_random_name, retry
from vn_test import VNFixture
from vm_test import VMFixture
from project_test import ProjectFixture
from port_fixture import PortFixture
from firewall_rule import ... | |
import socket
import sys
import threading
import time
import uuid
import unittest
from mock import patch
from nose import SkipTest
from nose.tools import eq_
from nose.tools import raises
from kazoo.testing import KazooTestCase
from kazoo.exceptions import (
AuthFailedError,
BadArgumentsError,
ConfigurationError,
... | |
from inspect import isfunction, isclass
import warnings
import pytest
try: # python 3.5+
from typing import Set, Any, List, Iterable
except ImportError:
pass
from _pytest.mark import MarkDecorator
from .pytest_compat import itermarkers, apply_mark_to, PytestUnknownMarkWarning
info_mode = False
debug_mode = False... | |
None
return
""" Next some funcs that just say stuff"""
def repeat_me(text=""):
to_repeat = text.replace('repeat after me', '', 1)
say(to_repeat)
return
def say_time(text=""):
now = datetime.now()
dt_string = now.strftime("Your space time co ordinates are %I %M %p on %A %B %d, %Y.")
say(dt_string)
return
"""
U... | |
else:
t = type(val)
cls = t.__module__+"."+t.__qualname__
add = id(val)
return MPackage.F(MPackage.PackageContext+"PyObject", self.ref, cls, add)
def __add__(self, amt):
from operator import add
return self.handler.ref(self.handler._op(add, self.ref, amt))
def __sub__(self, amt):
from operator import sub
re... | |
of tuples,with the
# strategies you are looking to apply
# to each type.
[
(list, ["append"]),
(dict, ["merge"])
],
# next, choose the fallback strategies,
# applied to all other types:
["override"],
# finally, choose the strategies in
# the case where the types conflict:
["override"]
)
return my_merger.m... | |
dingtalkyida__1__0_models.RenewApplicationAuthorizationServiceOrderRequest,
) -> dingtalkyida__1__0_models.RenewApplicationAuthorizationServiceOrderResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkyida__1__0_models.RenewApplicationAuthorizationServiceOrderHeaders()
return self.renew_application_au... | |
Header "Accept" is "application/json"
When I make a "POST" request with the repository id
Then I should receive a "200" response code
And response should have key "status" of 200
And response header "Content-Type" should be "application/json; charset=UTF-8"
And response should not have key "errors"
""")
@give... | |
<gh_stars>0
import os
from datetime import date as datetime
from flask import Flask, Markup, redirect, render_template, request, session
from flask_session import Session
from sqlalchemy import (
Column,
ForeignKey,
Integer,
Sequence,
String,
create_engine,
)
from sqlalchemy.ext.declarative import declarative_ba... | |
<reponame>sassoftware/conary<gh_stars>10-100
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
, rloc , port ) :
self . rloc . copy_address ( rloc )
self . translated_rloc . copy_address ( rloc )
self . translated_port = port
if 73 - 73: OOooOOo / Oo0Ooo
if 80 - 80: OoO0O00 + I1IiiI % i1IIi / I11i % i1IIi * i11iIiiIii
def is_rloc_translated ( self ) :
return ( self . translated_rloc . is_null ( ) == False... | |
<reponame>arccode/factory
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import errno
import json
import os
from unittest import mock
import xmlrpc.client
import rest_framework.statu... | |
<filename>tests/test_preview_item.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""Unit tests for PreviewItem."""
from __future__ import unicode_literals
import unittest
from mock import mock
from collections import OrderedDict
import pywikibot
from wikidatastuff.preview_item import PreviewItem
from wikidatastuff.qualifi... | |
if lib_conf == None or not os.path.exists(lib_conf):
return
with open(lib_conf) as lib_conf_handle:
for line in lib_conf_handle:
# remove comments
match = re.search('^[^#]*', line)
line = match.group()
# skip empty lines
if re.search('^\s*$', line):
continue
# parse (allowing spaces)
# <confLibName>:<con... | |
None),
('CRC', 'i'),
('SwHolding', '16d'),
('UserParamEx','8d'),
]
size_check = 352
class V9_SweepRecord(TreeNode):
field_info = [
('Mark', 'i'),
('Label', '32s', cstr),
('AuxDataFileOffset', 'i'),
('StimCount', 'i'),
('SweepCount', 'i'),
('Time', 'd'),
('Timer', 'd'),
('SwUserParams', '4d'),
('Tempera... | |
"""
detector
Copyright (c) 2020 <NAME>
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
"""
import os
import sys
import json
# import datetime # not really useful so remove soon pls
import numpy as np
import skimage.draw
import imgaug # should augment this improt as well haha
# from PIL impor... | |
"RBS Status", "Source Storage", "Archival Storage"]
page_cursor = response.get('data', {}).get('vSphereVmNewConnection', {}).get('pageInfo', {})
next_page_context = {
"next_page_token": page_cursor.get('endCursor', ''),
"name": "rubrik-polaris-vm-objects-list",
"has_next_page": page_cursor.get('hasNextPage', '')
... | |
New `forcefield` keyword to switch between different values of
DEFAULT_DONORS/ACCEPTORS to accomodate different force fields.
Also has an option "other" for no default values.
.. versionchanged:: 0.8
The new default for `update_selection1` and `update_selection2` is now
``True`` (see `Issue 138`_). Set to ``False... | |
#
# The next three lines are self-descriptive. But you will need the *\maketitle* **after** the \begin{document} for those items to appear.
#
# ### The Body
#
# The body is similar to what you would find in a normal word processor. The first element to add to the body is the *abstract*. An abstract informs the read... | |
(len(raw) < 3): continue
self.ShowProgress( iline* 100.0 /(maxlines+1))
if mode == '2d':
self.dimension = 2
sx = raw.split()
yval = float(sx[2])
tmp_y.append(yval)
self.yaddr = sx[1].strip()
if self.yaddr.endswith(':'): self.yaddr = self.yaddr[:-1]
mode = None
if len(tmp_dat)>0:
ntotal_at_2d.append(len(tmp_... | |
<filename>ball_catching/strategies/soc_solvers.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 26 09:29:13 2016
@author: Hoefer
"""
import argparse
import os
import sys
import yaml
import numpy as np
import matplotlib.pylab as plt
from ball_catching.config import settings_root
from ball_catching.dyn... | |
<filename>colour/notation/munsell.py
"""
Munsell Renotation System
=========================
Defines various objects for *Munsell Renotation System* computations:
- :func:`colour.notation.munsell_value_Priest1920`: *Munsell* value :math:`V`
computation of given *luminance* :math:`Y` using
*Priest, Gibson and MacNic... | |
model_base.predict_proba(X_sample)
time_predict_frac = time.time() - time_start_predict
time_predict_estimate = time_predict_frac / frac
logger.log(15, f'\t{round(time_predict_estimate, 2)}s\t= Estimated out-of-fold prediction time...')
if time_predict_estimate > time_left:
logger.warning(f'\tNot enough time to ge... | |
<gh_stars>0
# Copyright 2019 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 obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
code was not 201')
self.assertEqual(response_data['job_type'], input_job_type, 'job_type was not set properly')
self.assertEqual(response_data['artifact_id'], input_artifact_id, 'artifact_id was not set properly')
self.assertRegex(response_data['id'],
r'[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f... | |
"""Mutation.
Usage:
mutation play [--verbose] [--exclude=<globs>] [--only-deadcode-detection] [--include=<globs>] [--sampling=<s>] [--randomly-seed=<n>] [--max-workers=<n>] [<file-or-directory> ...] [-- TEST-COMMAND ...]
mutation replay [--verbose] [--max-workers=<n>]
mutation list
mutation show MUTATION
mutation... | |
# Licensed under the Apache License Version 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt
"""Celery tasks relating to Twitter."""
__author__ = '<NAME>'
from datetime import datetime
from celery import chain, group
from celery.task.control import revoke
from celery.utils.log import get_task_logger
from iterto... | |
after the Remote Passive
Rendezvous completes. If the assisting device does not observe traffic across the tunnel from both
sides within a period of time equal to or great than this timeout, it will close the tunnel.
"""
args = shlex.split(line)
optParser = OptionParser(usage=optparse.SUPPRESS_USAGE, option_clas... | |
if settings['setKey']['status']:
if xmobz.startswith(settings['setKey']['key']):
cmd = xmobz.replace(settings['setKey']['key'],'')
else:
cmd = 'Undefined command'
else:
cmd = text.lower()
return cmd
def removeCmd(text, key=''):
if key == '':
setKey = '' if not settings['setKey']['status'] else settings['setKe... | |
<filename>gs_manager/servers/generic/steam.py<gh_stars>1-10
import os
import re
import time
from queue import Empty, Queue
from threading import Thread
from typing import List, Optional, Type, Dict
from subprocess import CalledProcessError # nosec
import click
import click_spinner
import requests
from steamfiles impor... | |
<gh_stars>1-10
from __future__ import print_function
from __future__ import unicode_literals
from future.builtins import str
#coding=utf8
import sys
sys.path.insert(0, '..')
from par import SimpleVisitor
from par.md import MarkdownGrammar, MarkdownHtmlVisitor
template="""<!DOCTYPE html>
<html>
<head>
<meta http-equiv... | |
<reponame>ojhall94/halletal2019<gh_stars>1-10
# !/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib
sns.set_palette('colorblind')
matplotlib.rc('xtick', labelsize=15)
matplotlib.rc('ytick', labelsize=15)
matplotlib.rc('axes',labelsize=15)
... | |
<reponame>bilgelm/NiMARE<gh_stars>0
"""
Topic modeling with generalized correspondence latent Dirichlet allocation.
"""
import logging
import os.path as op
import numpy as np
import pandas as pd
import nibabel as nib
from scipy.stats import multivariate_normal
from ...base import AnnotationModel
from ...due import du... | |
import csv
import logging
import os
from dataset_manager.enums import FeatureType, FeatureFunctionType
logger = logging.getLogger(__name__)
class OpensmileExtractor():
CONFIG_ENERGY = os.path.join(os.path.dirname(__file__), "configurations/energy.conf")
CONFIG_EMOTION_FEATURES = os.path.join(os.path.dirname(__file_... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Plivo Team. See LICENSE.txt for details.
import os
import uuid
import time
import math
import unittest
import msgpack
from sharq import SharQ
from sharq.utils import generate_epoch
class SharQTestCase(unittest.TestCase):
"""
`SharQTestCase` contains the functional test c... | |
1, self.heads, C // self.heads).permute(2, 0, 3, 1, 4)
kv = self.to_kv(attn_kv).reshape(B_, N, 2, self.heads, C // self.heads).permute(2, 0, 3, 1, 4)
q = q[0]
k, v = kv[0], kv[1]
return q,k,v
def flops(self, H, W):
flops = H*W*self.dim*self.inner_dim*3
return flops
class LinearProjection_Concat_kv(nn.Module... | |
'''
This module contains the ConfigForm class (a popup dialog).
@author: <NAME>
'''
import clr
import log
from cvform import CVForm
from configuration import Configuration
import i18n
import System
clr.AddReference('System.Windows.Forms')
from System.Windows.Forms import AutoScaleMode, Button, CheckBox... | |
import os
import sys
import time
import random
from collections import OrderedDict
import boto3
import pandas as pd
import numpy as np
from six import raise_from
from PIL import Image, ImageFile, ImageDraw
from botocore.exceptions import ClientError
from keras_retinanet.preprocessing.csv_generator import Generator
fro... | |
<filename>tests/test_data/netsim_data.py
SCENARIO_1_STAT = {
"stat_samples": {
"D": {
(0, 9): {
"avg_drop_rate_bps": 0.0,
"avg_drop_rate_pps": 0.0,
"avg_latency_at_arrival": 0.0,
"avg_latency_at_departure": 0,
"avg_latency_at_drop": 0,
"avg_receive_rate_bps": 8888.888888888889,
"avg_receive_rate_pps": 1.11111... | |
import numpy as np
from scipy.optimize import minimize
from scipy.io import loadmat
from math import sqrt,exp
import pickle
import sys
from time import time
def initializeWeights(n_in, n_out):
"""
# initializeWeights return the random weights for Neural Network given the
# number of node in the input... | |
-m 10',
{
'm': '10',
'n': '10',
'lda': '10',
}
),
(
'getf2_npvt_batched',
'-f getf2_npvt_batched -m 10',
{
'm': '10',
'n': '10',
'lda': '10',
'batch_c': '1',
}
),
(
'getf2_npvt_strided_batched',
'-f getf2_npvt_strided_batched -m 10',
{
'm': '10',
'n': '10',
'lda': '10',
'strideA': '100',
'batch... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import random
from datetime import date, timedelta
import mock
from dateutil.relativedelta import relativedelta
from django.core.management import call_command
from django.test import override_settings
from django.urls import reve... | |
uuid,
):
"""Delete.
:param uuid: Id of the purge rule
"""
request_data = {
'uuid': uuid,
}
errors_mapping = {}
errors_mapping[('MISSING_FIELDS', None)] = MissingFields('A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields')
errors_mapping[('NOT_... | |
try:
params = request._serialize()
body = self.call("DescribeDDoSEvInfo", params)
response = json.loads(body)
if "Error" not in response["Response"]:
model = models.DescribeDDoSEvInfoResponse()
model._deserialize(response["Response"])
return model
else:
code = response["Response"]["Error"]["Code"]
message = r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.