input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
of the disk in the Linode API.
"""
return pulumi.get(self, "id")
@property
@pulumi.getter
def image(self) -> Optional[str]:
"""
An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See /images for more information on the Images available for you ... | |
# /usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2019-2020, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification... | |
# Geographical helper functions for nmea_info.py and friends
#
# Helps with geographic functions, including:
# Lat+Long+Height -> XYZ
# XYZ -> Lat+Long+Height
# Lat+Long -> other Lat+Long (Helmert Transform)
# Lat+Long -> easting/northing (OS GB+IE Only)
# easting/northing -> Lat+Long (OS GB+IE Only)
# OS easting/north... | |
<filename>run_semgrep.py
#!/usr/bin/env python3
# -*- coding: future_fstrings -*-
import pprint
import subprocess
import configparser
import os
import shutil
import json
import hashlib
import time
import argparse
import sys
import requests
import re
import glob
import datetime
from pathlib import Path
import webhooks... | |
some effort.
# Ascertain fitness
# First iteration just write the values
if not self.fitness:
self.fitness = newFitness
self.essPPaBest = self.essPPa
self.essEPaBest = self.essEPa
# Random next guess: The power level can be chose freely between the previously determined bounds.
self.essPPa = int(self.minESSPP... | |
if position == 'bottom':
x = window[2] + loc[1][0] + int(w/2) - 250
y = window[0] + loc[0][0] - 250
return x,y
def template_match(grayscale_unit8_image_array,template_file):
img_gray = grayscale_unit8_image_array
template = cv2.imread(template_file)
template = cv2.cvtColor(template,cv2.COLOR_BGR2GRAY)
template... | |
YANG variable /relay_agent/dhcp/agent_information_option/state/enable (boolean)
YANG Description: Enable sending the DHCP option for Relay Agent information
-- option 82.
"""
return self.__enable
def _set_enable(self, v, load=False):
"""
Setter method for enable, mapped from YANG variable /relay_agent/dhcp/age... | |
'Gyy', 'Gyy', 'Gyi', 'Gxi', 'Gxi', 'Gxi']
clifford_compilation['Gc14c20'] = ['Gxx', 'Gyy', 'Gyy', 'Gyy', 'Gxx', 'Gxi', 'Gxi']
clifford_compilation['Gc14c21'] = ['Gxy', 'Gyi', 'Gyi', 'Gyi', 'Gxi', 'Gxi', 'Gxi']
clifford_compilation['Gc14c22'] = ['Gxx', 'Gyx', 'Gyx', 'Gyy', 'Gxy', 'Gxi', 'Gxi']
clifford_compilation['Gc14... | |
import gc
import sys
from typing import List
import pytest
from _pytest.config import ExitCode
from _pytest.monkeypatch import MonkeyPatch
from _pytest.pytester import Pytester
def test_simple_unittest(pytester: Pytester) -> None:
testpath = pytester.makepyfile(
"""
import unittest
class MyTestCase(unittest.Test... | |
#!/usr/bin/env python3
#
# Copyright (c) 2021 Red Hat, 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 required by applicable l... | |
"""
TITLE: asset.py
AUTHOR: <NAME> & <NAME>
VERSION: 2020-08-26
DESCRIPTION: Defines the Asset and AssetList classes.
Asset:
Attributes:
url: str, the URL to download an asset. Ex: https://ca-menlopark.civicplus.com/AgendaCenter/ViewFile/Agenda/_12082020-3549
asset_name: str, the title of an asset. Ex: City Council... | |
"""
@package mi.instrument.sunburst.driver
@file marine-integrations/mi/instrument/sunburst/driver.py
@author <NAME>, <NAME> & <NAME>
@brief Base Driver for the SAMI instruments
Release notes:
Sunburst Instruments SAMI2-PCO2 partial CO2 & SAMI2-PH pH underwater
sensors.
This is the base driver that contains common ... | |
"""Common get info functions for Interface"""
# Python
import re
import logging
import copy
import ipaddress
# Genie
from genie.metaparser.util.exceptions import SchemaEmptyParserError
from genie.utils.timeout import Timeout
from genie.libs.sdk.libs.utils.normalize import GroupKeys
from genie.utils import Dq
# Pyats
... | |
== 1)
assert(v.minor == 0)
assert(v.patch is None)
assert(str(v) == s)
s = 'mod_auth_passthrough/2.1'
v = Version.parse(s)
assert(v.name_clean == 'mod_auth_passthrough')
assert(v.name == 'mod_auth_passthrough')
assert(v.major == 2)
assert(v.minor == 1)
assert(v.patch is None)
assert(str(v) == s)
s = 'Fr... | |
<gh_stars>10-100
import re
import ast
import _ast
import operator as op
import json
import base64
import inspect
import types
import sys
try: # Python2
from itertools import izip as zip
except ImportError: # python3 = zip is a buildin
pass
PY3 = sys.version_info >= (3,)
from .collectormanager import collectormgr
f... | |
<reponame>waffle620/fagyhal
import asyncio
import time
import steam
import steamapi
import discord
import datetime
import texttable
import wolframalpha
import copy
from discord.ext import commands
from utils import checks
from steam.steamid import SteamId
from steam.steamprofile import SteamProfile
from steam.steamacco... | |
self.dbapi.idisk_update(ipv['disk_or_part_uuid'],
{'foripvid': None})
except exception.DiskNotFound:
pass
elif ipv['pv_type'] == constants.PV_TYPE_PARTITION:
if not ipv.get('disk_or_part_uuid'):
return
try:
ihost = self.dbapi.ihost_get(ipv.get('forihostid'))
values = {'foripvid': None}
if ihost['invprovision... | |
from __future__ import unicode_literals
import sys, os, shutil, re, getpass, io, certifi, plura_dl
from plura_dl import PluraDL
from plura_dl.utils import ExtractorError, DownloadError
if sys.version_info[0] <3:
raise Exception("Must be using Python 3")
certpath = os.path.abspath(certifi.where())
os.environ["SSL_CERT... | |
<filename>yoapi/accounts.py
# -*- coding: utf-8 -*-
"""Account management package."""
import random
import pytz
import sys
from base64 import b64decode
from uuid import uuid4
import re
import requests
from bson import ObjectId
from datetime import datetime
from flask import current_app, g, request
from mongoengine i... | |
<reponame>richardangell/pitci
import numpy as np
import pandas as pd
import re
from pitci.base import LeafNodeScaledConformalPredictor
import pitci
import pytest
from unittest.mock import Mock
class DummyLeafNodeScaledConformalPredictor(LeafNodeScaledConformalPredictor):
"""Dummy class inheriting from LeafNodeScal... | |
###########################################################################
#
# 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
#
# https://www.apache.org/licenses/L... | |
<gh_stars>0
# coding: utf-8
# # CIG96 - Deep optical reduction and calibration
#
# ### Observation date: 11sep12
# ### Telescope: CAHA2.2m
#
# #I. GENERAL INFORMATION
#
# Notebook with the full data reduction and calibration plus external IRAF steps.
#
# - Further info from this CAHA campaign and log can be found... | |
display_name
body['email'] = email
body['last_modified_date_time'] = last_modified_date_time
body['number'] = number
body['payment_method_id'] = payment_method_id
body['payment_terms_id'] = payment_terms_id
body['phone_number'] = phone_number
body['shipment_method_id'] = shipment_method_id
body['tax_are... | |
import pycropml.transpiler.antlr_py.grammars
from pycropml.transpiler.antlr_py.grammars.CSharpLexer import CSharpLexer
from pycropml.transpiler.antlr_py.grammars.CSharpParser import CSharpParser
from pycropml.transpiler.antlr_py.grammars.Fortran90Lexer import Fortran90Lexer
from pycropml.transpiler.antlr_py.grammars.F... | |
Shotel+4",
402905: "Chaos Shotel+5",
403000: "Jagged Ghost Blade",
403001: "Jagged Ghost Blade+1",
403002: "Jagged Ghost Blade+2",
403003: "Jagged Ghost Blade+3",
403004: "Jagged Ghost Blade+4",
403005: "Jagged Ghost Blade+5",
405000: "Painting Guardian Sword",
405001: "Painting Guardian Sword+1",
4... | |
and fat, trimmed to 1/8" fat, choice, raw
17247: [], # Lamb, shoulder, arm, separable lean and fat, trimmed to 1/8" fat, choice, cooked, braised
17248: [], # Lamb, shoulder, arm, separable lean and fat, trimmed to 1/8" fat, cooked, broiled
17249: [], # Lamb, shoulder, arm, separable lean and fat, trimmed to 1/8" fat... | |
import base64
import json
import re
import time
import urllib
import requests
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
class TokenInvalid(Exception):
pass
class FofaError(Exception):
"""docstring for FofaError"""
def __init__(self, code, message = ""):
self... | |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import argparse
import datetime
from distutils.dir_util import copy_tree
import os
import shutil
import sys
import operator
import tempfile
import traceback
from seedot.compiler.converter.converter import Converter
import s... | |
targetfiletype = 'image'
argvalues = {}
arginfo = []
argBox = None
def __init__(self, parent, uiProfile, scModel, targetfiletype, end_im, name, description=None):
"""
:param parent:
:param uiProfile:
:param scModel:
:param targetfiletype:
:param im:
:param name:
:param description:
@type scModel: ImagePr... | |
<reponame>Jay4C/API
import unittest
from mollie.api.client import Client
import requests
# https://github.com/mollie/mollie-api-python
# https://docs.mollie.com/reference/v2/payments-api/create-payment
class UnitTestsPaymentsAPI(unittest.TestCase):
# https://docs.mollie.com/reference/v2/payments-api/create-payment
... | |
truncated tunnel information, we still would
# like to know. This is due to the special tunnel handling
# needed for port matching.
#
result[RecvUpcall.get_ovs_key_attr_str(nla_type)] = bytes()
else:
result[RecvUpcall.get_ovs_key_attr_str(nla_type)] = nla_data
if dump:
print("{}nla_len {}, nla_type {}[{}], dat... | |
<reponame>vamshi98/salt-formulas
# -*- coding: utf-8 -*-
'''
Module for returning various status data about a minion.
These data can be useful for compiling into stats later.
'''
from __future__ import absolute_import
# Import python libs
import os
import re
import fnmatch
import collections
from salt.ext.six.moves i... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
<reponame>kiss2u/google-research
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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
#
... | |
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("dark")
plt.rcParams['figure.figsize'] = 16, 12
import pandas as pd
from tqdm import tqdm_notebook, tqdm
import io
from PIL import Image
from glob import glob
from collections import defaultdict
import os
import pic... | |
# -*- coding: utf-8 -*-
# python 3.7.2
# 2019/07/16 by sryml.
import os
import io
import struct
import threading
import json
import shutil
from argparse import ArgumentParser
from binascii import crc32
from time import sleep
from math import ceil
from timeit import timeit
from concurrent.futures import ThreadPoolExec... | |
= 'https://www.baidu.com/s?pn={page_no}&wd={query}&oq={query}'
self.engine_name = "Baidu"
self.MAX_DOMAINS = 2
self.MAX_PAGES = 760
enumratorBaseThreaded.__init__(self, base_url, self.engine_name, domain, subdomains, q=q, silent=silent, verbose=verbose)
self.querydomain = self.domain
self.q = q
return
... | |
11390625 * uk_161
+ 961875 * uk_162
+ 81225 * uk_163
+ 6859 * uk_164
+ 3025 * uk_17
+ 5665 * uk_18
+ 1045 * uk_19
+ 55 * uk_2
+ 880 * uk_20
+ 9405 * uk_21
+ 12375 * uk_22
+ 1045 * uk_23
+ 10609 * uk_24
+ 1957 * uk_25
+ 1648 * uk_26
+ 17613 * uk_27
+ 23175 * uk_28
+ 1957 * uk_29
+ 103 * uk_3
+ 361 * u... | |
<reponame>ianhussey/destigmatize-suicide-bot<gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to resolve double redirects, and to delete broken redirects.
Requires access to MediaWiki's maintenance pages or to a XML dump file.
Delete function requires adminship.
Syntax:
python pwb.py redirect acti... | |
j, k] * self.lsmhe.nuk_mhe[i, k] for k in self.lsmhe.ykk_mhe)
for j in self.lsmhe.ykk_mhe) for i in self.lsmhe.fe_t))
expr_u_obf = 0
for i in self.lsmhe.fe_t:
for u in self.u:
var_w = getattr(self.lsmhe, "w_" + u + "_mhe") #: u_noise
expr_u_obf += self.lsmhe.U_mhe[i, u] * var_w[i] ** 2
self.lsmhe.U_e_mhe = Expr... | |
remaining -= 1
cur_address += 1
if start > end and cur_address > max_address:
needs_wrap = False
cur_address = 0
def _format_disassembly(self, address, length, disasm):
cur_address = address
max_address = (2 ** self._mpu.ADDR_WIDTH) - 1
bytes_remaining = length
dump = ''
while bytes_remaining:
if cur_addr... | |
#!/usr/local/bin/python
##################
# import modules #
##################
from math import sqrt,exp
from random import random,randint,seed
####################
# define constants #
####################
nAtoms = 40 # nb of atoms
Radius = 25.0 # beware that Radius must be in a good range (according to nAtoms)
... | |
for bp in bit_position:
if not self.bit_position_limits[0] <= bp <= self.bit_position_limits[1]:
raise ValueError('Data generator pattern bit position needs to be between 0 and 35.')
if not isinstance(pattern_array, np.ndarray):
raise TypeError('Data generator pattern needs to be numpy.ndarray type')
if np.any(p... | |
# This config is runs the parallelism benchmarks from Savina.
#
# Each experiment only has one sequence parameter, they are
# intended to produce box plots and not line diagrams.
#
# It runs the Akka implementation and LF C++ implementations.
#
# Recommended plotter module: plotterBoxerrorbar
import os
########### I... | |
cmap_file = os.path.join(CMAPSFILE_DIR, "ncar_ncl", "UKM_hadcrut.rgb")
cmap = Colormap(self._coltbl(cmap_file)[::-1], name=cname)
matplotlib.cm.register_cmap(name=cname, cmap=cmap)
return cmap
@property
def ViBlGrWhYeOrRe(self):
cname = "ViBlGrWhYeOrRe"
if cname in matplotlib.cm._cmap_registry:
return matplotl... | |
<filename>dali/python/nvidia/dali/plugin/pytorch.py
# Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | |
"""
Basic greyscale analysis of aligned frames and original (non-aligned)
frame stacks.
Contains:
- analyze_frame(): function that displays the analysis results
- class FrameSeries: getting and analysing aligned and original frames
# Author: <NAME> (Max Planck Institute for Biochemistry)
# $Id$
"""
from __future__ ... | |
(optional) The content of the document to ingest. The
maximum supported file size when adding a file to a collection is 50
megabytes, the maximum supported file size when testing a configuration is
1 megabyte. Files larger than the supported size are rejected.
:param str filename: (optional) The filename for file.
... | |
<reponame>harrispirie/stmpy<gh_stars>1-10
import matplotlib as mpl
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import ticker
from matplotlib.colors import Colormap
from matplotlib.widgets import AxesWidget
from .misc import format_eng, grab_bg, blit_bg, volumetype
class SpecLinkedCursors:
'''
... | |
a comparison in a nice list format
if output='fail' return the number of failed process -- for test--
"""
# Special output for loop processes
if comparison_results[0]['process']['perturbation_couplings']!=[]:
return output_lorentz_inv_loop(comparison_results, output)
proc_col_size = 17
threshold=1e-10
proce... | |
any normalization function kwargs we've set
if formatspec['lcnorm_kwargs'] is not None:
normkwargs = formatspec['lcnorm_kwargs']
else:
normkwargs = None
# finally, get the magsarefluxes key and fileglob key
magsarefluxes = formatspec['magsarefluxes']
fileglob = formatspec['fileglob']
if not ('neighbors' in c... | |
consumerLevelChecks,
assetLevelChecks)
self.ResetCaches()
def _HasGprimAncestor(self, prim):
from pxr import Sdf, UsdGeom
path = prim.GetPath()
if path in self._hasGprimInPathMap:
return self._hasGprimInPathMap[path]
elif path == Sdf.Path.absoluteRootPath:
self._hasGprimInPathMap[path] = False
return False
... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
"""
An example that uses TensorRT's Python api to make inferences.
"""
import ctypes
import os
import shutil
import random
import argparse
import time
import cv2
import numpy as np
import pycuda.autoinit
import pycuda.driver as cuda
import tensorrt as trt
MAX_OUTPUT_BBOX_COUNT = 1000 #must match with 'MAX_OUTPUT_BBOX... | |
import torch
from torch.autograd import Variable
import torch.nn.functional as F
from torch.utils import data
from torch.utils.data import SequentialSampler
from torch import nn
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from time import time
from sklearn.metrics impo... | |
eds, rev_eds = _parser(_lexer(fmt))
self.assertRaises(ValueError, _input, eds, rev_eds, inp)
@attr(platform='9-1_linux_intel')
@attr('input')
@attr(ed='B')
def test_b_ed_input_505(self):
inp = '''10000'''
fmt = '''(B10.1)'''
result = [16]
eds, rev_eds = _parser(_lexer(fmt))
self.assertEqual(result, _input(ed... | |
<reponame>samcaf/JetMonteCarlo
import random
import numpy as np
# Local utils:
# Utilities for parton showering
from jetmontecarlo.utils.vector_utils import *
from jetmontecarlo.utils.montecarlo_utils import *
from jetmontecarlo.utils.partonshower_utils import *
from jetmontecarlo.analytics.QCD_utils import *
# Utili... | |
"""Collection of layers that are using producing weight allocations."""
import cvxpy as cp
from cvxpylayers.torch import CvxpyLayer
import torch
from torch.distributions import MultivariateNormal
import torch.nn as nn
from .misc import Cov2Corr, CovarianceMatrix, KMeans
class AnalyticalMarkowitz(nn.Module):
"""Min... | |
<gh_stars>0
"""
traits: tools for examining classes, instances, and other python objects
<NAME> <<EMAIL>>
Copyright 2021, <NAME>
License: Apache-2.0
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 a... | |
+ 2 + 2*dumpBytesPerLine + 1
sumLine = ' ' * dumpchars + self.line
sumWrap = ""
# if the line is longer and operation exists, a wrap needs to occur
ops = ""
if self.opcodedef is not None and shopOperation:
ops = self.opcodedef.operation.strip()
if len(ops) > 0:
if len(sumLine) >= cwbchars + colPosOperation - ... | |
<reponame>buahaha/aa-freight
import datetime as dt
from unittest.mock import Mock, patch
import grpc
from dhooks_lite import Embed
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.utils.timezone import now
from esi.errors import TokenExpiredError, TokenInvalid... | |
145, 163, 170 ],
[ 240, 145, 163, 171 ],
[ 240, 145, 163, 172 ],
[ 240, 145, 163, 173 ],
[ 240, 145, 163, 174 ],
[ 240, 145, 163, 175 ],
[ 240, 145, 163, 176 ],
[ 240, 145, 163, 177 ],
[ 240, 145, 163, 178 ],
[ 240, 146, 144, 128 ],
[ 240, 146, 144, 129 ],
[ 240, 146, 144, 130 ],
[ 240, 146, 144, 131 ],
[ ... | |
Minimum Stock Quantity. Usually blank, unless a user override to the'
'automatically calculated minimum, (reorder point, as viewed in the Product'
'Analysis) is entered in this field.'),
Column('Max_Stock_Qty',
Numeric(precision=19, scale=4),
nullable=True,
doc='Maximum Stock Quantity',
comment='The maximum stoc... | |
x s y t a f c b k e c s s w w p w o p n n g
... sample3 e b s w t l f c b n e c s s w w p w o p n n m
... sample4 p x y w t p f c n n e e s s w w p w o p k s u
... sample5 e x s g f n f w b k t e s s w w p w o e n a g
... sample6 e x y y t a f c b n e c s s w w p w o p k n g
... sample7 e b s w t a f c b g e c s s... | |
the absolute visual magnitude (Mv) from the richness
by transforming the isochrone in the SDSS system and using the
g,r -> V transform equations from Jester 2005
[astro-ph/0506022].
TODO: ADW If richness not specified, should use self.richness
Parameters:
-----------
richness : isochrone normalization paramete... | |
- Task #2160: Test skyline with bandit
# Added nosec to exclude from bandit tests
timeseries_dump_dir = "/tmp/skyline/boundary/" + algorithm # nosec
self.mkdir_p(timeseries_dump_dir)
timeseries_dump_file = timeseries_dump_dir + "/" + metric_name + ".json"
with open(timeseries_dump_file, 'w+') as f:
f.write(str(ti... | |
# -*- coding: utf-8 -*-
# Copyright (c) Vlachos Group, Jung Group
# GNU v3.0 license
__author__ = '<NAME>'
__copyright__ = "Copyright 2019, Vlachos Group, Jung Group"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__date__ = "July 31, 2019"
import numpy as np
import json
import os
from collection... | |
<filename>epistasis/__init__.py
__author__ = 'Paul. Made OO by MF'
__version__ = '1.3'
__date__ = '3 Sept 2020'
import numpy as np
#from scipy.stats import ttest_ind_from_stats as ttest
from warnings import warn
import math, random
from .epi_aux_mixin import EpiAuxMixin as _EA
from .epi_base_mixin import EpiBaseMixin... | |
<filename>lib/oeqa/selftest/cases/updater_qemux86_64.py
# pylint: disable=C0111,C0325
import os
import logging
import re
import subprocess
import unittest
from time import sleep
from uuid import uuid4
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_... | |
dx * dx
x = nx
w += s * dx
if nx == nxL:
iL += 1
if nx == nxU:
iU += 1
if iL >= len(L) - 1:
break
if iU >= len(U) - 1:
break
return na
def func_f407b7da6ff34d83b31a2d34af60a647(U, cuts, G, part, L):
w = U[0][1] - L[0][1]
a = 0
x = 0
while True:
sL = (L[iL + 1][1] - L[iL][1]) * 1.0 / (L[iL + 1][0] - L[... | |
<filename>test/some-old-test-cases.py
#!/bin/env python3
import asyncio
import sys
from pprint import pprint
import random
import pyfca
import scramjet.utils as utils
from scramjet.ansi_color_codes import *
log = utils.LogWithTimer.log
fmt = utils.print_formatted
random.seed('Pyfca')
# Use to change delays mocking ... | |
import configparser
import logging
import random
import sys
from copy import deepcopy
import discord
import GameTimer
def load_config():
c = configparser.ConfigParser()
c.read('config.ini')
try:
time = c.getint('game', 'time')
except ValueError:
logger.error(
"В config.ini неверно указано значение time. Зна... | |
<filename>eeg_project/plot_data.py<gh_stars>0
""" some tools for plotting EEG data and doing visual comparison """
from eeg_project.read_data import (my_read_eeg_generic, SAMP_FREQ,
pass_through, accumulate_subject_file_list, files_skip_processing,
sample_file_list, match_types)
import numpy as np
import pandas as pd... | |
double quote escapes it in option tag
result = substitute('@',
'<@case\ttest > <@option "option ""1""" >option one<@else>no options<@/case>',
{'test': 'option "1"'})
self.assertEqual('option one', result)
def test_quoted_option2(self):
result = substitute('@',
'<@case\ttest > <@option "option\n 1" >option one<@... | |
so _load_from_state_dict can modify it
metadata = getattr(state_dict, '_metadata', None)
state_dict = state_dict.copy()
if metadata is not None:
state_dict._metadata = metadata
def load(module, prefix=''):
local_metadata = {} if metadata is None else metadata.get(
prefix[:-1], {})
module._load_from_state_dict(... | |
"""
Environment.py
"""
__author__ = "<EMAIL>"
import numpy as np
from scipy import stats
import subprocess
import networkx as nx
from helper import pretty, softmax
from Traffic import Traffic
OMTRAFFIC = 'Traffic.txt'
OMBALANCING = 'Balancing.txt'
OMROUTING = 'Routing.txt'
OMDELAY = 'Delay.txt'
TRAFFICLOG = 'Traff... | |
<filename>src/models/xception_padding_do.py<gh_stars>0
# -*- coding: utf-8 -*-
"""Xception V1 model for Keras.
On ImageNet, this model gets to a top-1 validation accuracy of 0.790
and a top-5 validation accuracy of 0.945.
Do note that the input image format for this model is different than for
the VGG16 and ResNet mo... | |
res.shift = fit_res.shift
res.ro_amp = 10**(fit_res.power/20)
return True
def find_test_resonators_test(self, with_VNA=None, resonators=None):
"""
Does a power sweep over the resonators to see if they have a qubit
attached or not, and changes the state in the resonator object
"""
if with_VNA is None:
try:
i... | |
from contextlib import contextmanager
from queue import Queue
from threading import Event, Timer
from time import sleep
from unittest import TestCase
from unittest.mock import MagicMock
from dakara_base.safe_workers import (
BaseSafeThread,
BaseWorker,
Runner,
SafeThread,
SafeTimer,
UnredefinedThreadError,
Unre... | |
import ctypes
import os
import matplotlib.pyplot as plt
import nlopt
import numpy as np
from numba import njit
from numba import vectorize
from numba.extending import get_cython_function_address
from scipy import special
from tables import ComplexCol
from tables import Float64Col
from tables import IsDescription
from ... | |
<reponame>svenbuder/SummerSchool
"""
Definition of :class:`EventList`.
:class:`EventList` is used to handle photon arrival times.
"""
from __future__ import absolute_import, division, print_function
from .io import read, write
from .utils import simon, assign_value_if_none
from .gti import cross_gtis, append_gtis, ch... | |
of the identity.
- **IdentityId** *(string) --*
A unique identifier in the format REGION:GUID.
- **Logins** *(list) --*
The provider names.
- *(string) --*
- **CreationDate** *(datetime) --*
Date on which the identity was created.
- **LastModifiedDate** *(datetime) --*
Date on which the identity was last ... | |
logger.critical("Output of InitialCollinearVariables.get():")
logger.critical(str(kinematic_variables))
return
@staticmethod
def set(
PS_point, is_child, fs_children, na, nb, kinematic_variables,
precision=1e-6 ):
"""Given the lower multiplicity momentum of the incoming parton
as PS_point[is_child] and colline... | |
0 indicating
positions that should be assigned 0 probability in the output.
dim (int): Dimension over which to take softmax.
log_softmax (bool): Take log-softmax rather than regular softmax.
E.g., some PyTorch functions such as `F.nll_loss` expect log-softmax.
Returns:
probs (torch.Tensor): Result of taking mask... | |
"""
Functions to perform normal, weighted and robust fitting.
"""
from __future__ import annotations
import inspect
from typing import Callable, Union, Sized, Optional
import warnings
import numpy as np
import pandas as pd
import scipy.optimize
from xdem.spatialstats import nd_binning
from geoutils.spatial_tools imp... | |
x = self.window.winfo_rootx() + self.make_canvas.winfo_x()+10
y = self.window.winfo_rooty() + self.make_canvas.winfo_y()+10
x1 = x + self.make_canvas.winfo_width()-20
y1 = y + self.make_canvas.winfo_height()-20
ImageGrab.grab().crop((x,y,x1,y1)).save(file+'.png')
self.window.title("Sketch With Sam" + "-----" + fil... | |
interval variables in the sequence variable
of the no_overlap constraint.
* In a state function, the transition matrix represents the minimal distance between two integer
states of the function.
A transition matrix can be created:
* Deprecated.
Giving only its size. In this case, a transition matrix is created... | |
and line plot that visualizes the
operation of a component on the basis of a selected commodity.
:param component_name: Name of the component that holds the commodity
of interest.
:type component_name: str
:param commodity: Name of the commodity that should be plotted.
:type commodity: str
:param level_of_det... | |
of an object dtype with a number type could
# hit here
if (new_result == result).all():
return new_result
# a datetimelike
elif dtype.kind in ['M','m'] and result.dtype.kind in ['i']:
try:
result = result.astype(dtype)
except:
pass
except:
pass
return result
def _lcd_dtypes(a_dtype, b_dtype):
""" retu... | |
# -*- coding: utf-8 -*-
"""
The view module hosts the View class, the central object of cv2d.
"""
import logging
import os
import sys
import six
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
from matplotlib.widgets import Slider, Button
import yaml
from colorvie... | |
<filename>src/ai_training/http_server.py
"""
Module to show/control status of AIs via HTTP (asyncio/aiohttp)
"""
import asyncio
import datetime
import http
import json
import logging
import multiprocessing
import socket
import random
import traceback
import sys
import aiohttp
from aiohttp import web
import ai_trainin... | |
import copy
import datetime
from decimal import Decimal
import logging
import uuid
import json
import cStringIO
from couchdbkit import ResourceNotFound
import dateutil
from django.core.paginator import Paginator
from django.views.generic import View
from django.db.models import Sum
from django.conf import settings
fro... | |
<reponame>RandalJBarnes/NagadanPy<filename>nagadanpy/nagadan.py
"""
The entry point for the NagadanPy project.
Classes
-------
None
Exceptions
----------
None.
Functions
---------
nagadan(target, npaths, duration,
base, conductivity, porosity, thickness,
wells, observations,
buffer=100, spacing=10, umbra=10,
... | |
json.loads(f.read())
allID = allPlayers[ID]
string = f'Login ID of {name} is:'
for i in allID:
#_ba.chatmessage(i)
if (i != ID): string += '\n' + i
ba.screenmessage(string, transient=True, color=(1, 1, 1))
commandSuccess = True
except:
ba.screenmessage(f"Using: /whois [ClientID or Name]", clients=[clientID], t... | |
<reponame>ConnectionMaster/graphite-influxdb<filename>graphite_influxdb.py<gh_stars>100-1000
import re
import time
import logging
from logging.handlers import TimedRotatingFileHandler
import datetime
from influxdb import InfluxDBClient
try:
import statsd
except ImportError:
pass
logger = logging.getLogger('graphite_... | |
"""
runtime = util_models.RuntimeOptions()
headers = {}
return await self.update_buildpack_ex_async(request, headers, runtime)
def update_buildpack_ex(
self,
request: deps_models.UpdateBuildpackRequest,
headers: Dict[str, str],
runtime: util_models.RuntimeOptions,
) -> deps_models.UpdateBuildpackResponse:
""... | |
<gh_stars>10-100
#!/usr/bin/env python
"""
CLI tool to runs various tasks related to QA.
"""
import os
import time
from pathlib import Path
import sys
import traceback
import json
import yaml
import uuid
import datetime
import click
from .run import RunContext
from .runners import runners, Job, JobGroup
from .runners... | |
'NOT_COMPLIANT'
standards_severity = 'requirements'
audit_name_severity = 'insufficient'
file_names_links = [audit_link(path_to_text(file), file) for file in files]
detail = ('Files {} have {} of {}, which is below ENCODE {}. According to '
'ENCODE data standards, a number for this property in a replicate of > {:,... | |
<reponame>felixmiller/ot-dsim<filename>sim_ecc_tests.py<gh_stars>0
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""Runs ECC operations based on p256 firmware.
Runs ECC operations based on the primitives contained in ... | |
import math
import random
import pytorch_lightning as pl
import torch
import os
import pickle
import cv2
import numpy as np
from torch.utils import data
from datasets.init_dataset import get_dataset
from ACT_utils.ACT_utils import tubelet_in_out_tubes, tubelet_has_gt
from MOC_utils.gaussian_hm import gaussian_radius,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.