input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
# Copyright (c) 2021 ING Wholesale Banking Advanced Analytics
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, mo... | |
<filename>sdk/python/pulumi_mongodbatlas/network_peering.py
# 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,... | |
result_dict['utilization_memory'] = float(utilization_memory) or 0
utilization_tensor_slice_match = re.search(r'Block Utilization: (\d+\.\d+) Type: tensor_slice_top', line)
if utilization_tensor_slice_match is not None:
utilization_tensor_slice = utilization_tensor_slice_match.group(1)
result_dict['utilization_ten... | |
<reponame>songhaoyu/percvae
import os
import re
import sys
import time
import numpy as np
from tensorflow.contrib import layers
from tensorflow.contrib.rnn import OutputProjectionWrapper
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import embedding_ops
from tensorflow.python.ops import variabl... | |
<gh_stars>0
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score, mean_squared_error
from sklearn.preprocessing import StandardScaler
def get_multiple_choi... | |
feat is not None:
gdaltest.post_reason('fail')
feat.DumpReadable()
out_ds.ReleaseResultSet(sql_lyr)
return 'fail'
out_ds.ReleaseResultSet(sql_lyr)
sql_lyr = out_ds.ExecuteSQL('SELECT * FROM gpkg_metadata_reference')
feat = sql_lyr.GetNextFeature()
if feat is not None:
gdaltest.post_reason('fail')
feat.DumpRea... | |
}
for i in [xx, yy, xy, yx]:
(pol1, pol2) = pol_dict[i][1]
(sig1_pol, sig2_pol) = pol_dict[i][0]
# broadcast in_inds
broad_inds = np.logical_and(
in_inds[sig1_inds, pol1, :], in_inds[sig2_inds, pol2, :],
)
# broadcast indices and distances for bilinear interpolation
sv_inds_right1 = sv_inds_right[sig1_inds, po... | |
\
heuristic_search.optimize(objective_function, self.iterations)
self.selected_channels = \
[self.channel_names[index] for index in self.selected_indices]
#==============================================================================#
def evaluate_sensor_selection(cns, flow, metric, w, sensor_identifier,
tra... | |
\
Field('fldOeePlantID', 'integer', label='Plant'), \
Field('fldOeeSubPlantID', 'integer', label='Sub-Plant'), \
Field('fldOeeDepartmentID', 'integer', label='Department'), \
Field('fldOeeModuleNr', 'integer', label='Module nr'), \
Field('fldOeeModuleTypeID', 'integer', label='Module-type'), \
Field('fldOee... | |
<reponame>jnietol/DVH-Analytics
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# tools.stats.py
"""
Take numerical data from main app and convert to a format suitable for statistical analysis
in Regression and Control Chart tabs
"""
# Copyright (c) 2016-2019 <NAME>
# This file is part of DVH Analytics, released under ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import datetime
from pathlib import Path
from pbr import git
from packaging import version as pkg_version
from enum import Enum
from . import settings
from . import utils
from . import exceptions
from . import pygittools
from . import wizard
from . im... | |
<gh_stars>0
# flake8: noqa
# type: ignore
# Generated from IceSql.g4 by ANTLR 4.8
from omnibus._vendor.antlr4 import *
if __name__ is not None and "." in __name__:
from .IceSqlParser import IceSqlParser
else:
from IceSqlParser import IceSqlParser
import dataclasses
@dataclasses.dataclass(frozen=True)
class IceSqlP... | |
# -*- coding: utf-8 -*-
import pytz
import re
import time
import openerp
import openerp.service.report
import uuid
import collections
import babel.dates
from werkzeug.exceptions import BadRequest
from datetime import datetime, timedelta
from dateutil import parser
from dateutil import rrule
from dateutil.relativedelta... | |
from __future__ import annotations
from collections import OrderedDict
from datetime import datetime
from decimal import Decimal
from typing import TYPE_CHECKING, Final, Iterable, List, Tuple
import colors
from nation import ALL_NATIONS, Nation
from starship import Starship
if TYPE_CHECKING:
from game_data import Ga... | |
distance (on the matrix-level)."""
num = F @ F.T
l2_norms = np.linalg.norm(F, axis=1) # compute vector l2-norm across rows
denom = np.outer(l2_norms, l2_norms)
cos_mat = (num / denom).clip(min=a_min, max=a_max)
return cos_mat
def compute_rdm(F: np.ndarray, method: str) -> np.ndarray:
"""Compute representational... | |
= ul[0]['_id']
if db_util.add_mongo_id(str(toid)) in user0['contacts']:
ret.append(str(toid))
elif isinstance(_id, list):
userlist = user_query(session, {'_id':from_id})
if len(userlist)==0:
userlist = user_query(session, {'username':from_id})
if len(userlist)>0:
user0 = userlist[0]
if user0.has_key('contacts'... | |
self._py_history.clear()
for i in range(1, readline.get_current_history_length() + 1):
# noinspection PyArgumentList
self._py_history.append(readline.get_history_item(i))
readline.clear_history()
# Restore cmd2's history
for item in cmd2_env.history:
readline.add_history(item)
if self._completion_supported()... | |
1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0],
[1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# Copyright © 2018 Dell Inc. or its subsidiaries. All rights reserved.
# Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
# Other trademarks may be trademarks of their respective owners.
#
# Licensed under the Apache License, Ver... | |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.multinomial import Multinomial
import numpy as np
from encoders import *
# code based on: https://github.com/zalandoresearch/pytorch-vq-vae/blob/master/vq-vae.ipynb
class SequenceQuantizer(nn.Module):
def __init__... | |
from JumpScale import j
from JumpScale.baselib.atyourservice81.Actor import Actor
from JumpScale.baselib.atyourservice81.Blueprint import Blueprint
from JumpScale.baselib.atyourservice81.models.ActorsCollection import ActorsCollection
from JumpScale.baselib.atyourservice81.models.ServicesCollection import ServicesColl... | |
from pprint import pprint
import pokebase as pb
pkmnData = [
{
"name": 'Bulbasaur',
"value": "bulbasaur",
"image": "img/bulbasaur.png"
},
{
"name": 'Ivysaur',
"value": "ivysaur",
"image": "img/ivysaur.png"
},
{
"name": 'Venusaur',
"value": "venusaur",
"image": "img/venusaur.png"
},
{
"name": 'Charman... | |
<gh_stars>1-10
"""
Adapted from https://github.com/YujiaBao/Distributional-Signatures
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import \
pack_padded_sequence, pad_packed_sequence
class BASE(nn.Module):
'''
BASE model
'''
def __init__(self, args):
super(BASE,... | |
missing_keys = []
unexpected_keys = []
error_msgs = []
# copy state_dict 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... | |
%s" % str(delta_p));
common.DebugPrint("update_step(): t = %s" % str(t));
assert delta_p.ndim < 3;
#% Compute and apply the update
if time_flag == 1:
#t=t+delta_p[end];
t += delta_p[-1]; # t is scalar
#delta_p = [delta_p(1:end-1); 0];
delta_p = np.r_[np.ravel(delta_p, order="F")[: -1], 0];
else:
#delta_p ... | |
= {curve.oid: curve for curve in supportedCurves}
hexAt = "\x00"
class PrivateKey:
def __init__(self, curve=secp256k1, secret=None):
self.curve = curve
self.secret = secret or RandomInteger.between(1, curve.N - 1)
def publicKey(self):
curve = self.curve
publicPoint = Math.multiply(
p=curve.G,
n=self.secre... | |
further than max radius are
stopped. Between the two, the velocity decreases linearly"""
self._base_min_radius = (self._road_front_vehicles + self._road_extra_front_actors) * self._road_spawn_dist
self._base_max_radius = (self._road_front_vehicles + self._road_extra_front_actors + 1) * self._road_spawn_dist
self._m... | |
<reponame>jzcmyz/OpenManage-Enterprise
#
# _author_ = <NAME> <<EMAIL>>
#
# Copyright (c) 2021 Dell EMC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | |
RiskMeasureUnit) else get_enum_value(RiskMeasureUnit, value)
self._property_changed('unit')
class CSLCurrencyArray(Base):
"""An array of currencies"""
def __init__(self, currencyValues: Tuple[CSLCurrency, ...] = None):
super().__init__()
self.__currencyValues = currencyValues
@property
def currencyValues... | |
<filename>src/main_nosim.py
import random
import numpy as np
import torch
from torch import nn, optim
import torchvision.transforms as transforms
from data import NADataset, TorchDataset
import argparse
from tqdm import tqdm
from decoders_nosim import ActionDecoder
from metric_dtw import DTW
from sim_mul import simula... | |
always fit first item
skips = np.empty((num_x, 2), dtype=np.intp)
else:
# TODO maybe use another function when fitting all points in order
# to skip the if check_fits check for every x-value; does it affect
# calculation time that much?
check_fits = False
# TODO once numba minimum version is >= 0.47, can use dty... | |
from __future__ import annotations
import sys
from PyQt5.uic import loadUi
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSize, Qt, QRect, QObject, QCoreApplication, QMetaObject, QPropertyAnimation
from PyQt5.QtWidgets import QApplication, QWidget, QProgressBar, QLabel, QTabWidget, QGridLayout, QVBoxLayout,... | |
filter_entity,
'is_warning_list': is_warning_list,
'entity': entity
}
@view_config(
route_name='check_login_availability',
renderer='json'
)
def check_login_availability(request):
"""checks it the given login is available
"""
login_name = request.matchdict['login']
logger.debug('checking availability for: %s... | |
<filename>line_breaker.py
# encoding: utf-8
'''Line breaking'''
from numpy import array, float64, argmax, argmin, uint8, ones, floor, mean, std, where, argsort
import cv2 as cv
from utils import check_for_overlap
from fast_utils import ftrim, fadd_padding
import sys
from bisect import bisect, bisect_right
from feature_... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import sys
py3 = sys.version_info.major == 3
def warn(msg):
print('[powerline-bash] ', msg)
if py3:
def unicode(x):
return x
class Powerline:
symbols = {
'compatible': {
'lock': 'RO',
'network': ... | |
<reponame>etherlabsio/ai-engine<filename>services/keyphrase/extract_keyphrases.py
import networkx as nx
import logging
from timeit import default_timer as timer
import traceback
from typing import List, Dict, Tuple, Text
import numpy as np
from fuzzywuzzy import fuzz, process
from graphrank.core import GraphRank
from ... | |
self.buffer if self.compressed else self.file
# move the buffer to the starting position
buffer.seek(0 if self.compressed else self.offset + 1)
return buffer
def _read_offsets(self):
# get the buffer for this cluster
buffer = self._source_buffer()
# read the offset for the first blob
offset0 = unpack("<I", buf... | |
<gh_stars>1-10
#!/usr/bin/python2
import certifi
import ipwhois
import itertools
import json
import logging
import netaddr
import os
import pymysql
import re
import requests
import socket
import subprocess
import sys
import threading
import time
import urllib2
import urllib3
import uuid
import Queue
from multiprocessi... | |
self.wavepattern == 'SWS':
res_df.loc[i, :] = self.norm_sws(param_c, channel)
elif self.wavepattern == 'SPN':
res_df.loc[i, :] = self.norm_spn(param_c, channel)
else:
raise NameError(f'Wavepattern {self.wavepattern} is unvalid.')
if i%10 == 0:
with open(res_p/resname, 'wb') as f:
pickle.dump(res_df, f)
print(... | |
<reponame>hyperion-ml/hyperion<filename>hyperion/io/audio_reader.py
"""
Copyright 2018 Johns Hopkins University (Author: <NAME>)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
import os
import logging
import io
import math
import subprocess
import soundfile as sf
import numpy as np
from ..hyp_defs imp... | |
* (c[13] + c[17] * p_r + c[19] * SA_r)
# + x * (c[11] + p_r * (c[14] + c[18] * p_r) + SA_r * (c[16] +
# c[20] * p_r + c[22] * SA_r))) - saturation_fraction * 1e-3 *
# (2.4 - a * SA) * (1 + b * (1 - SA / SSO))
#
# CT_error = np.abs(CT_freeze - CT)
#
# tmp = np.logical_or(p > 10000, SA > 120
# out = np.logical_an... | |
bal['asset'].lower() == asset.lower():
return bal
return None
async def get_my_trades(self, **params):
return await self._get('myTrades', True, data=params)
async def get_system_status(self):
return await self._request_margin_api('get', 'system/status')
async def get_account_status(self, **params):
return aw... | |
<reponame>QBioLab/Nymphscopy
import ctypes
def PIGCS(dll):
# DLL initialization and comm functions
# int PI_FUNC_DECL PI_InterfaceSetupDlg(const char* szRegKeyName);
dll.PI_InterfaceSetupDlg.argtypes = [ctypes.c_char_p]
dll.PI_InterfaceSetupDlg.restype = ctypes.c_int
# int PI_FUNC_DECL PI_ConnectRS232(... | |
# Opencart countries
# {"name": "Aaland Islands", "iso_code_2": "AX", "iso_code_3": "ALA"},
# {"name": "Afghanistan", "iso_code_2": "AF", "iso_code_3": "AFG"},
# {"name": "Albania", "iso_code_2": "AL", "iso_code_3": "ALB"},
# {"name": "Algeria", "iso_code_2": "DZ", "iso_code_3": "DZA"},
# {"name": "American Samoa", "... | |
<filename>biasMetrics/metrics.py
class NuancedROC:
"""Method for calculating nuanced AUR ROC scores to assess model bias.
Nuanced AUC ROC scores allow for a closer look into how a classification
model performs across any specifed sub-population in the trainging set.
There are three different types of nuanced roc m... | |
<reponame>inesmersak/minesweeper<filename>minolovec.py
from tkinter import *
from tkinter import messagebox
from PIL import Image, ImageTk
from polje import *
import racunalnik
import random
import threading
# array barv za stevilke na polju
BARVE = {1: '#8B00FF',
2: '#4B0082',
3: '#0000FF',
4: '#20A106',
5: '#F2C... | |
# /***********************************************************************
#
# This file is part of KEEL-software, the Data Mining tool for regression,
# classification, clustering, pattern mining and so on.
#
# Copyright (C) 2004-2010
#
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>)
#... | |
<gh_stars>10-100
import abc
import enum
import functools
import itertools
import json
import pathlib
import shutil
import subprocess
from collections import defaultdict
from enum import Enum
from logging import getLogger
from subprocess import PIPE
from typing import *
from onlinejudge_verify.config import get_config
... | |
<filename>sal/plugin.py<gh_stars>0
"""Plugin classes and helpers
This module contains the base plugin class (`BasePlugin`), from which
the three actual-plugin classes are derived: `Widget`, `DetailPlugin`,
and `ReportPlugin`.
It also provides a manager for locating plugin modules that have been
properly deployed into... | |
return example
class SpeakerActivityMapper:
def __init__(self, options, context=0, json_path=database_jsons):
"""
Add speaker activity per STFT frame to each example.
:param options: nt.Options object containing arguments for STFT length
and shift.
:param context: Speaker activity added before and after actual
... | |
to input list with identifier '{matcher}'. Please use unique identifier")
new_list.append(ff)
return new_list
def get_file_from_substring(filt, path, return_msg='error', exclude=None):
"""get_file_from_substring
This function returns the file given a path and a substring. Avoids annoying stuff with glob. Now als... | |
<gh_stars>0
import csv
import codecs
import logging
from django import forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from django.db import IntegrityError
from django.core.exceptions import ValidationError
from .constants import VALUE_UNITS, PACKAGE_TYPES, ... | |
list(self.coordList[0][subDictName].keys())
labels = sorted(list(set(labels)))
return labels
def WriteCoordsToTable(self, mode=['ALL']):
'''
This function gathers all the Pix info from the master dictionary,
and parses it down into data suitable for several dat tables.
You can provide an alternate m... | |
start sweeping:
stat = ENA.sweep(bench) #getting the estimated sweeping time
print("Time-taken for this loop would be: %s (%spts)" %(stat[1]['TIME'], stat[1]['POINTS']))
print("Operation Complete: %s" %bool(ENA.measure(bench)))
# adjusting display on ENA:
ENA.autoscal(bench)
ENA.selectrace(bench, action=['Set', '... | |
for explanation.
"""
if platform.system() == 'Windows':
return os.path.getctime(path_to_file)
else:
stat = os.stat(path_to_file)
try:
return stat.st_birthtime
except AttributeError:
# We're probably on Linux. No easy way to get creation dates here,
# so we'll settle for when its content was last modified.
re... | |
<reponame>BenjaminLiuPenrose/Berkeley-CS-100
# Databricks notebook source exported at Fri, 24 Jun 2016 23:04:35 UTC
# MAGIC %md
# MAGIC <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"> <img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0... | |
<reponame>Abhi58/sympy
from sympy import (Symbol, Matrix, MatrixSymbol, S, Indexed, Basic,
Set, And, Tuple, Eq, FiniteSet, ImmutableMatrix,
nsimplify, Lambda, Mul, Sum, Dummy, Lt, IndexedBase,
linsolve, Piecewise, eye)
from sympy.stats.rv import (RandomIndexedSymbol, random_symbols, RandomSymbol,
_symbol_converter)... | |
<reponame>hulecom/read-GRACE-harmonics
#!/usr/bin/env python
u"""
calc_sensitivity_kernel.py
Written by <NAME> (06/2021)
Calculates spatial sensitivity kernels through a least-squares mascon procedure
COMMAND LINE OPTIONS:
--help: list the command line options
-O X, --output-directory X: output directory for mascon... | |
FITS filename
Seq = Sequence number
Disk = Disk number for underlying files
FOV = Field of view (deg) for Mosaic
doFull = If True, create full field (FOV) image
NField = Number of fields defined in input,
if unspecified derive from data and FOV
xCells = Cell spacing in X (asec) for all images,
if unspecified de... | |
'frame': 377, 'jobName': 'OneTaper3D'})
mdb.jobs['OneTaper3D']._Message(STATUS, {'totalTime': 0.958358564980967,
'attempts': 2, 'timeIncrement': 0.000258234416308831, 'increment': 377,
'stepTime': 0.958358564980967, 'step': 1, 'jobName': 'OneTaper3D',
'severe': 0, 'iterations': 3, 'phase': STANDARD_PHASE, 'equi... | |
import re
from urllib import urlencode
from django.http import Http404
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.core.files.storage import default_storage
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib import me... | |
u'4', u'5', u'6', u'7', u'8', u'9', u'A', u'B', u'C', u'D', u'E', u'F', u'G', u'H', u'J', u'K', u'L', u'M', u'N', u'O', u'P', u'Q', u'R', u'S', u'SA', u'SB', u'SC', u'SD', u'SG', u'SL', u'SP', u'SX', u'SY', u'SZ', u'T', u'U', u'V', u'W', u'X', u'Y'] ) ),
Element( u'HSD08', Properties(desc=u'Ship/Delivery Pattern Time ... | |
<reponame>rsdoherty/azure-sdk-for-python
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsof... | |
<reponame>mitdo/o2ac-ur<gh_stars>10-100
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, OMRON SINIC X
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... | |
specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
bt_app_element_modify_info.BTAppElementModifyInfo
If the method is called asynchronously, returns the request
thread.
"""
kwargs["async_req"] = kwargs.get("async_req", False)
kwargs[... | |
# Copyright 2020 Petuum, Inc. All Rights Reserved.
#
# It includes the derived work based on:
#
# 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 ... | |
#!/usr/bin/env python3
"""Game Engine
Provides the logic for a simplified connect the dots game.
The code in this module determines and enforces the rules of the game.
Callers are responsible for the game's presentation component,
or user experience (UX)
The playing surface consits of 3x3 grid of dots:
@ @ @
@ @... | |
#!bin/env python
import os
from functools import partial
import copy
import numpy as np
from numpy import sqrt, tanh
from scipy import optimize
import matplotlib.pyplot as plt
__author__ = '<NAME>'
__copyright__ = 'Copyright 2015'
__license__ = 'MIT'
__version__ = '0.95'
__email__ = '<EMAIL>'
__statu... | |
# -*- coding: utf-8 -*-
"""
Created on 29/03/2020
@author: Mahdad
THIS IS THE CLASS FOR "MACHINE LEARNING & DEPRESSION PROJECT."
The class is capable of extracting relevant features, applying various machine-
learning algorithms and finally applying Randomized grid search to tune hyper-
parameters of different classi... | |
<reponame>heavyairship/LambdaCalc<gh_stars>1-10
##########################################################################
# Parsing/reduction for the Lambda Calculus
#
#
# Syntax for valid Lambda terms:
#
# x Variable: A character or string that represents an atomic value.
#
# (Lx.M) Abstraction: A function definitio... | |
import threading
from numpy.core.fromnumeric import std
import py_trees
from py_trees.common import Status
import py_trees_ros
import rospy
import numpy as np
import subprocess
import os
import signal
from threading import Thread
import sys
import time
try:
from queue import Queue,LifoQueue, Empty
except ImportErro... | |
<reponame>vandenberghinc/dev0s<filename>dev0s/classes/encryption/aes.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# imports.
from dev0s.classes.defaults.files import *
from dev0s.classes.defaults.defaults import defaults
from dev0s.classes.response import response as _response_
from dev0s.classes.defaults.objects... | |
#
# Tests CellML 1.0 schema validation
#
from __future__ import absolute_import, division
from __future__ import print_function, unicode_literals
import logging
import os
import pytest
from lxml import etree
import check
from . import shared
from .report import Report_1_0 as Report
# Expected instances where the sc... | |
#!/usr/bin/env python
# Copyright (c) 2011 The Chromium 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 glob
import logging
import os
import shutil
import tempfile
import pyauto_functional # Must be imported before pyauto
impor... | |
except Exception:
return "Could not retrieve object: %s" % box_name
if box is None:
self.app.inform.emit('[WARNING_NOTCL] %s: %s' % (_("No object Box. Using instead"), obj))
box = obj
scale_factor_x = scale_factor_x
scale_factor_y = scale_factor_y
def make_negative_film(scale_factor_x, scale_factor_y):
log.d... | |
todays_charge = Decimal(0)
else:
tier_type = 'downgrade'
todays_charge = Decimal(0)
else:
if tier_limit <= current_limit:
# This means the customer is underpaying, by today's standards.
# We should not let them upgrade in the normal way.
# If we don't want this to happen, we should work it out via
# the Perma ... | |
c.PDFExporter.latex_count = 3
#
# c.PDFExporter.jinja_logic_block_end = '*))'
# Shell command used to compile latex.
# c.PDFExporter.latex_command = [u'pdflatex', u'{filename}']
# ------------------------------------------------------------------------------
# PythonExporter configuration
# -------------------------... | |
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API do... | |
"LSZR" : "ACH",
"LSZT" : "",
"KUOS" : "",
"LSZH" : "ZRH",
"LSZK" : "",
"LSZJ" : "",
"KLUF" : "LUF",
"LSZL" : "ZJI",
"LSZA" : "LUG",
"KLUK" : "LUK",
"LSZC" : "BXO",
"LSZB" : "BRN",
"LSZG" : "",
"LSZF" : "",
"UMOO" : "MVQ",
"KBMI" : "BMI",
"SNOX" : "ORX",
"YMNE" : "WME",
"RJKI" : "KKX",
"RJKN" : "TKN",... | |
<reponame>artberryx/LSD
import copy
import pathlib
import time
import dowel_wrapper
import akro
import numpy as np
import torch
from PIL import Image
from moviepy import editor as mpy
from garage.envs import EnvSpec
from garage.misc.tensor_utils import discount_cumsum
from matplotlib import figure
from matplotlib.patc... | |
from datetime import date, datetime, timedelta
from flask import current_app
from notifications_utils.timezones import convert_utc_to_bst
from sqlalchemy import Date, Integer, and_, desc, func, union
from sqlalchemy.dialects.postgresql import insert
from sqlalchemy.sql.expression import case, literal
from app import ... | |
696611, 696617, 696623, 696629, 696653,
696659, 696679, 696691, 696719, 696721, 696737, 696743, 696757,
696763, 696793, 696809, 696811, 696823, 696827, 696833, 696851,
696853, 696887, 696889, 696893, 696907, 696929, 696937, 696961,
696989, 696991, 697009, 697013, 697019, 697033, 697049, 697063,
697069, 697079, 697... | |
Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 0.97034,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime D... | |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2014-2020 BigML
#
# 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 ... | |
b9f==''\
and board.s6f+board.s7f+board.s8f=='':
moves = '5f9f'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if re.match(r'\+B|B', Bboard.b5f)and b2i==''\
and board.s3h+board.s4g=='':
moves ='5f2i'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if re.match(r'\+B|B',Bboard.b5f)and b3h=='... | |
sort alphabetically
self.all_shapes = sorted(self.all_shapes, key=lambda x: x.qname)
# compute top layer
exit = []
for c in self.all_shapes:
if not c.parents():
exit += [c]
self.toplayer_shapes = exit # sorted(exit, key=lambda x: x.id) # doesnt work
def build_entity_from_uri(self, uri, ontospyClass... | |
value is selected
self.click_edit_section('cat_1')
self.findBy('xpath', '//span[@class="meter" and @style="width:0%"]')
self.findBy('xpath', '//select[@name="qg_3-0-key_4"]')
chosen_field = self.findBy('xpath', '//a[@class="chosen-single"]')
self.assertEqual(chosen_field.text, '-')
# She sees that she can select... | |
<gh_stars>1-10
import torch.nn as nn
import torch
class ConvBnRelu(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, strides=1, padding=0, dilation=1, groups=1, is_bn_relu=False, use_bias=False, name=" "):
super(ConvBnRelu, self).__init__()
self.block_name = name
self.in_channels = in_channe... | |
def ws_27(self, ws):
"""
Cols: Subject Sex
Rows: Photographed
"""
counts = Counter()
for media_type, model in tm_person_models.items():
if 'is_photograph' in [field_name.name for field_name in model._meta.get_fields()]:
rows = model.objects\
.values('sex', 'is_photograph')\
.filter(**{model.sheet_name() + '__... | |
#!/usr/bin/python
# Wrap everything in a single function to avoid polluting the global namespace
# more than necessary.
def main(): # noqa
import ctypes
import os
import six
import sys
import warnings
AllModules = False
if len(sys.argv) == 1 and not hasattr(sys, 'frozen'):
AllModules = True
if not AllModule... | |
return '%s' % (self.__major)
else:
return 'any version'
def __repr__(self):
if self.__major is not None:
if self.__minor is not None:
if self.__subminor is not None:
return 'Version(%s, %s, %s)' % (self.__major,
self.__minor,
self.__subminor)
else:
return 'Version(%s, %s)' % (self.__major, self.__minor)
el... | |
params={
"access_token": "Zenodo access token required with every request.",
"bucket_url": "bucket url is found in zenodo.links.bucket",
"file_path": "file path of file to upload",
},
)
def post(self):
"""Upload a file into a zenodo deposition"""
parser = reqparse.RequestParser()
parser.add_argument(
"access... | |
import logging
import re
import datetime
from django import forms
from django.conf import settings
from django.core.cache import cache
from django.db.models.signals import pre_save, pre_delete
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse, Http404
# Create your views here.
from django.url... | |
"ctype" : self._ctype,
"refname" : self._refname,
"optpointer" : self._optpointer and "*" or "",
"optreference" : self._optpointer and "&" or "",
"optaddarg" :
self._optaddarg and ", const %s value" % self._ctype or ""
}
for (k, v) in extradict.items():
mapping[k] = v
return mapping
def GetVarName(self, var... | |
############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTW... | |
<filename>PerformanceGraphs.py
#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3 python36Packages.matplotlib
# (C) Copyright 2018-2019 Hewlett Packard Enterprise Development LP
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation fil... | |
<gh_stars>1-10
# =====================================================================================================================
#
# Tensor Abstraction Layer Objects 0.0.8-ALPHA
# EVALUATION METRICS
#
# Framework design by <NAME>
# Licensed under the MIT License
#
# ======================================... | |
# sapid lisp
# python implementation
# <EMAIL>, https://github.com/GillesArcas/sapid-lisp
# MIT license
from __future__ import print_function
import sys
import os
import time
# Configuration
TailRecursionOptimization = 'MutualRecursion' # None | 'TailRecursion' | 'MutualRecursion'
# 2/3 compatibility
if sys.versi... | |
this properly, so it is returned as-is.
# Hm, should we call __ctypes_from_outparam__ on the
# result?
return result
@patcher.no_replace
def __setitem__(self, index, value):
"Attempt 'self.Item[index] = value'"
try:
self.Item[index] = value
except ArgumentError as err:
(hresult, text, details) = err.args
i... | |
<filename>hyperion/instrument/polarization/variable_waveplate.py
"""
======================
LCC25 (thorlabs) model
======================
This class (variable_waveplate_gui.py) is the model to drive the LCC25 variable waveplate controller.
It ads the use of units with pint and the wavelength calibration to obtain mak... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.