input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
dimenson is supplied
we assume meters per second.
reference_height : float or pint.quantity.build_quantity_class.<locals>.Quantity
The height in which we measure the reference speed,
usually taken to be 10m/s in SimScale. If no dimenson is supplied
we assume meters.
height : float or np.array().astype(float64... | |
return pulumi.get(self, "protocol")
@protocol.setter
def protocol(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "protocol", value)
@property
@pulumi.getter(name="proxyProtocol")
def proxy_protocol(self) -> Optional[pulumi.Input[bool]]:
"""
The proxy protocol of the listener. Default value is `fa... | |
<reponame>EFrion/montepython_public
# bicep_util.py
#
# This is a module containing subfunctions to evaluate the bicep1 or bicep2 likelihood
#
# get_bpwf
# load_cmbfast
# calc_expvals
# read_data_products_bandpowers
# read_M
# calc_vecp
# g
# vecp
# saveLikelihoodToText
#
#$Id: bicep_util.py,v 1.1.2.5 2014/03/12 18:20:... | |
This
# will happen if one node is an ancestor of the other.
if n2 in ancestors.get(n1, []) or n1 in ancestors.get(n2, []):
continue
network = network.merge_nodes(
[n1, n2], nodeid2parents=nodeid2parents)
duplicates = _fix_node_id_pairs_after_merge(duplicates, n1, n2)
ancestors = _fix_node_id_dict_after_merge(anc... | |
' ').replace('\n', ' ').replace('\r', ' ')
r1c8 = request.POST.get('r1c8').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r1c9 = request.POST.get('r1c9').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r1c10 = request.POST.get('r1c10').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r1c1... | |
try:
os.remove(filePath + '.busy')
except:
pass
await bot.delete_message(message)
return
if message.content.lower().startswith('.iam'):
if message.content.lower().startswith('.iamz') and is_zig(message):
zigBot = discord.utils.get(message.server.roles, id = botRole)
if not zigBot in message.author.roles:
awa... | |
initialize=0)
m.x302 = Var(within=Reals, bounds=(0,None), initialize=0)
m.x303 = Var(within=Reals, bounds=(0,None), initialize=0)
m.x304 = Var(within=Reals, bounds=(0,None), initialize=0)
m.x305 = Var(within=Reals, bounds=(0,None), initialize=0)
m.x306 = Var(within=Reals, bounds=(0,None), initialize=0)
m.x307 = Var(wit... | |
Flag",
"DF183": "LaPC - Latitude of Projection Center",
"DF184": "LoPC - Longitude of Projection Center",
"DF185": "AzIL - Azimuth of Initial Line",
"DF186": "Diff ARSG - Difference, Angle from Rectified to Skew Grid",
"DF187": "Add SIL - Scale factor on Initial Line",
"DF188": "EPC - Easting at Projection Center... | |
device_parameters: List of device parameters to override default values in Device_Catalog.
:type device_parameters: list
:param flash_file_path: Flash file full path.
:type flash_file_path: str
:param random_mode: Enable random mode if your campaign is configured to run random TC.
:type random_mode: bool
:para... | |
#!/usr/bin/env python
import datetime
from glob import glob
import os
import re
from requests import get
from shutil import rmtree
import tarfile
import zipfile
from tethys_dataset_services.engines import CkanDatasetEngine
#------------------------------------------------------------------------------
#Main Dataset M... | |
import os
import gc
import numpy as np
import numpy.ma as ma
import matplotlib
matplotlib.use('TKAgg')
import matplotlib.pyplot as plt
###############################################################################
###############################################################################
####################... | |
<reponame>double-sigma/golem
import os
import pytest
import golem
from golem.cli import messages, commands
from golem.core import errors, test_directory
class TestGolemHelp:
run_commands = [
('golem', messages.USAGE_MSG),
('golem -h', messages.USAGE_MSG),
('golem --help', messages.USAGE_MSG),
('golem -h run',... | |
6, 9, 12, 15]
.. note::
This implementation assumes a score range of [1, 5].
Use :func:`~biopsykit.questionnaires.utils.convert_scale()` to convert the items into the correct range
beforehand.
.. warning::
Column indices in ``subscales`` are assumed to start at 1 (instead of 0) to avoid confusion with
question... | |
'_olo_is_breaked', False):
depth = self.__ctx__.instantiate_depth or 0
if not isinstance(_olo_is_new, bool):
_olo_is_new = depth <= 1
self._olo_is_new = _olo_is_new
self._olo_decrypt = _olo_decrypt and not self._olo_is_new
if self._olo_is_new:
self._check_attrs(attrs)
attrs = self._wash_attrs(attrs)
attrs = s... | |
code.append(indent(2) + 'initial_round++;\n')
code.append(indent(2) + 'LAYER_OUT_NUM_T_prev = LAYER_OUT_NUM_T;\n')
code.append(indent(2) + 'LAYER_IN_IMG_H_T_prev = LAYER_IN_IMG_H_T;\n')
code.append(indent(2) + 'LAYER_IN_IMG_W_T_prev = LAYER_IN_IMG_W_T;\n')
code.append(indent(2) + 'LAYER_COL_IL_FACTOR_prev = LAYER_C... | |
<gh_stars>1-10
'''
SEG2020 is a script that runs all the computations for the different results
presented at the SEG2020 conference (Houston, Texas).
***Improving BEL1D accuracy for geophysical imaging of the subsurface***
It runs at first the numerical benchmark for a dataset that is created directly.
- Creating t... | |
1: "OFPT_ERROR",
2: "OFPT_ECHO_REQUEST",
3: "OFPT_ECHO_REPLY",
4: "OFPT_VENDOR",
5: "OFPT_FEATURES_REQUEST",
6: "OFPT_FEATURES_REPLY",
7: "OFPT_GET_CONFIG_REQUEST",
8: "OFPT_GET_CONFIG_REPLY",
9: "OFPT_SET_CONFIG",
10: "OFPT_PACKET_IN",
11: "OFPT_FLOW_REMOVED",
12: "OFPT_PORT_STATUS",
13: "OFPT_PACKET_OUT",... | |
<reponame>sourav-majumder/qtlab<gh_stars>0
# <NAME> <<EMAIL>>, 2008
# <NAME> <<EMAIL>>, 2008
# <NAME> <<EMAIL>>, 2015
#
# 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 2 of the Li... | |
invoice is validated.\n"
"Based on Payment: the tax is due as soon as the payment of the invoice is received.")
cash_basis_transition_account_id = fields.Many2one(
comodel_name='account.account.template',
string="Cash Basis Transition Account",
domain=[('deprecated', '=', False)],
help="Account used to transition... | |
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
import json
import os
import requests
from webexteamssdk import WebexTeamsAPI
# CHAT BOT v3.0.0
# Integracao Cisco Operations Insights & Webex Teams & CMX
# (c) 2019
# <NAME>
# <NAME>
# <NAME>
# <NAME>
#####################... | |
when a column is not in dataframe
"""
# Check types
if cols is not None and not isinstance(cols, (list, str)):
raise TypeError('cols must be None, or a list or a string')
if isinstance(cols, list):
if not all(isinstance(c, str) for c in cols):
raise TypeError('each element of cols must be a string')
if not isi... | |
= '/contents%s' % filePrimer
contents = 'hello, world!\n'
if not filePrimer:
filePrimer = '\0'
filePrimer = str(filePrimer)
# Pad it on the left with zeros, up to 16 chars long
pathId = filePrimer.rjust(16, '\1')
pathId = pathId[0:16]
contents = RegularFile(contents = contents, pathId = pathId,
config = None... | |
SearchIndexingError """
self.publish_item(store, self.vertical.location)
with self.assertRaises(SearchIndexingError):
self.reindex_course(store)
@ddt.data(*WORKS_WITH_STORES)
def test_indexing_course(self, store_type):
self._perform_test_using_store(store_type, self._test_indexing_course)
@ddt.data(*WORKS_WITH... | |
f.GetField('elr')
pt_tup_list.append((n,frac))
f.Destroy()
f = read_layer.GetNextFeature()
# print pt_id_list
# print pt_frac_list
# print pt_dist_list
'''
ST_Line_Substring
'''
if len(pt_tup_list) > 0:
pt_id_sorted = [x for (x,y) in sorted(pt_tup_list, key=lambda pair: pair[1])]... | |
<reponame>jcchin/project_clippy
""" Base class for Driver."""
from collections import OrderedDict
from itertools import chain
from six import iteritems
import numpy as np
from openmdao.core.options import OptionsDictionary
from openmdao.util.record_util import create_local_meta, update_local_meta
class Driver(obje... | |
<reponame>nathanheidacker/AlphaGradient<gh_stars>0
# -*- coding: utf-8 -*-
"""
AlphaGradient's algorithm library is a collection of financial algorithms built
using AlphaGradient. These algorithms are public domain and free to use. We
highly encourage the open-sourcing of algorithms, as it contributes to a
vibrant a... | |
longer ' + \
'than 3200 bytes'
raise SEGYWritingError(msg)
# Assert the encoding.
enc = self.textual_header_encoding.upper()
# Make sure revision number and end header marker are present. If
# not: add them - if something else is already present, raise a
# warning but don't do anything.
# Make sure the textu... | |
if session['admin_logged_in']:
customer_dict = {}
db = shelve.open('CustomerStorage.db', 'c')
session['username'] = "Admin"
try:
customer_dict = db['Customers']
print("For Programmer: SUCCESS --> Success in retrieving Customers from CustomerStorage.db")
except:
print("For Programmer: ERROR --> Error in retrievi... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 Alibaba Group Holding Limited.
#
# 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/LICENS... | |
#!/usr/bin/env python3
import argparse
import binascii
import collections.abc
import contextlib
import errno
import itertools
import json
import logging
import os
import pickle
import platform
import queue
import shutil
import subprocess
import sys
import threading
import time
from multiprocessing import Process, cpu_c... | |
# -*- coding: utf-8 -*-
# RainbowBox
# Copyright (C) 2015-2016 <NAME>
# LIMICS (Laboratoire d'informatique médicale et d'ingénierie des connaissances en santé), UMR_S 1142
# University Paris 13, Sorbonne paris-Cité, Bobigny, France
# This program is free software: you can redistribute it and/or modify
# it under the t... | |
from the previous patterns with the application of b < 0 <=>
# 0 < -b. The transformation should be applied if either comparison is
# used once as this ensures that the number of comparisons will not
# increase. The sources to the ior and iand are not symmetric, so the
# rules have to be duplicated to get this beha... | |
# "Marble Table": "",
# "Granite Table": "",
# "Meteorite Work Bench": "",
# "Marble Work Bench": "",
# "Granite Work Bench": "",
# "Meteorite Bathtub": "",
# "Marble Bathtub": "",
# "Granite Bathtub": "",
# "Meteorite Bed": "",
# "Marble Bed": "",
# "Granite Bed": "",
# "Meteorite Bookcase": "",
# "Marble ... | |
:raise: ``PermissionDenied`` -- authorization failure
*compliance: mandatory -- This method is must be implemented.*
"""
return # osid.calendaring.OffsetEventList
@abc.abstractmethod
def get_offset_events(self):
"""Gets all ``OffsetEvents``.
:return: an ``OffsetEventList``
:rtype: ``osid.calendaring.OffsetE... | |
S_s, I_s, Inew_s, R_s, D_s = solve_SIR_difference_equations(p, p_dict_SIR, travel_data)
rho_SIR = p_dict_SIR.get('rho', p.rho)
Iinit_SIR = p_dict_SIR.get('Iinit1', p.Iinit1)
theta_fit_SIR = p_dict_SIR.get('theta',theta_SIR)
R_0_s = (rho_SIR * p.beta * 1) / theta_fit_SIR
R_eff_s = ((rho_SIR * p.beta * alpha_SIR) / ... | |
<filename>tests/base.py
#!/usr/bin/env python3
# Copyright 2019 Canonical Ltd.
#
# 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 requir... | |
<reponame>kmantel/graph-scheduler
import logging
import graph_scheduler
import pytest
from psyneulink import _unit_registry
from psyneulink.core.components.functions.nonstateful.transferfunctions import Linear
from psyneulink.core.components.mechanisms.processing.transfermechanism import TransferMechanism
from psyneul... | |
1 5 tegar_ID 1 3 6 3 4 4 3 6 7 4 3 3 4 2 2 6 1 4 9 1 \
4 5 3 4 4 3 8 9 4 3 3 4 2 2 6 1 5 tegar_ID 1 3 6 3 4 4 3 6 \
7 4 3 3 4 2 2 6 1 4 9 1 5 4 2 2 6 1 4 9 1 5 7 3 4 4 3 8 9 \
4 3 3 4 2 2 6 1 5 tegar_ID 1 3 6 3 4 4 3 6 7 4 3 3 4 2 2 6 \
1 4 9 1 4 5 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 4 4\
3 8 9 4 3 3 4 9 1 3 4 4... | |
already exists, we will allow ceph config file to be overwritten.
# Thus, we won't raise an exception if the file already exists.
if os.path.exists(opt_ceph_conf_file):
LOG.info("Overwriting file %s in %s " %
(ceph_conf_filename, tsc.PLATFORM_CEPH_CONF_PATH))
try:
with open(opt_ceph_conf_file, 'w+') as f:
f.wri... | |
<reponame>mitsuhiko/zine<filename>zine/upgrades/versions/001_split_tables.py<gh_stars>10-100
"""Switch to split tables for comments, posts and texts"""
from copy import deepcopy
from sqlalchemy.exceptions import ProgrammingError, OperationalError
from sqlalchemy.types import MutableType, TypeDecorator
from zine.upgra... | |
<reponame>vladosstrawberry/aim_tracker
import json
class App:
main_names = dict()
def __init__(self, file):
self.file = file
try:
with open(file, 'r') as f:
self.main_names = json.load(f)
except OSError:
print("No such file, will do a new one")
f = open(file, 'w+')
f.close()
print("Initialized")
def run... | |
from functools import partial
from collections import Sequence
import os
from pathlib import Path
import random
from ..utils import _norm_path
from menpo.base import menpo_src_dir_path, LazyList
from menpo.visualize import print_progress
def data_dir_path():
r"""A path to the Menpo built in ./data folder on this mac... | |
<reponame>traveller-san/Blender-CM3D2-Converter
# 「プロパティ」エリア → 「メッシュデータ」タブ → 「シェイプキー」パネル → ▼ボタン
import time
import bpy
import bmesh
import mathutils
import traceback
from . import common
from . import compat
from . import model_export
# メニュー等に項目追加
def menu_func(self, context):
icon_id = common.kiss_icon()
self.layo... | |
from torch import nn
from ops.basic_ops import ConsensusModule
from ops.transforms import *
from torch.nn.init import normal_, constant_
import torch.nn.functional as F
from efficientnet_pytorch import EfficientNet
from ops.net_flops_table import feat_dim_dict
from torch.distributions import Categorical
def init_hid... | |
import threading, logging, socket, os, select, re
from threading import Timer
# Defines
AODV_HELLO_INTERVAL = 10
AODV_HELLO_TIMEOUT = 30
AODV_PATH_DISCOVERY_TIME = 30
AODV_ACTIVE_ROUTE_TIMEOUT = 300
# Class Definition
class aodv(threading.Thread):
# Constructor
def __init__(self):
threading.Thread.__init__(self)
... | |
<filename>models/attention_gan_model.py
import torch
import itertools
from util.image_pool import ImagePool
from .base_model import BaseModel
from . import networks
from util.util import prob_2_entropy,to_3dim,to_4dim
import numpy as np
import torch.nn.functional as F
class AttentionGANModel(BaseModel):
@staticmetho... | |
["+str(info['totalsupply'])+"]", 'green'))
print(colorize("Gateways Remaining Supply ["+str(info['remaining'])+"]", 'green'))
print(colorize("Gateways Issued Supply ["+str(info['issued'])+"]", 'green'))
input("Press [Enter] to continue...")
return gw_index
except Exception as e:
print(info)
print(e)
print("Some... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# 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/LIC... | |
)
if 11 - 11: OoOoOO00 % OOooOOo . i11iIiiIii * I1IiiI % O0 % iIii1I11I1II1
if 18 - 18: Oo0Ooo % OOooOOo + IiII
if 28 - 28: OOooOOo . OoO0O00 / o0oOOo0O0Ooo + II111iiii / iIii1I11I1II1 * II111iiii
if 83 - 83: II111iiii . OoOoOO00 - i11iIiiIii . OoOoOO00 . i1IIi % OoooooooOO
if 47 - 47: II111iiii
if 30 - 30: i1IIi... | |
Images can be stored as list of file directories when using tif file,
or as a dynamic hdf link to a hdf file.
:param hdf_group: hdf5 File or Group object
:param address_list: list of str: list of str to search in
:param multiple: if True, return list of all addresses matching criteria
:return: str or list of str
... | |
<gh_stars>1-10
"""A data structure containing a Graph of coronal holes (or a set of connected sub-graphs).
Here, we analyze coronal hole connectivity- when do coronal holes merge? split? etc..
Note: this module imports networkx library.
Last Modified: May 17th, 2021 (Opal)
# todo: plot only on one axes???
"""
impor... | |
"""The main Optimiser class."""
import biopharma as bp
from biopharma.server.tasks import SoftTimeLimitExceeded
from biopharma.specs import Value, Table, in_units
from .individual import Individual, Variable
from .util import get_item, with_units
import numbers
import random
from enum import Enum
import deap.base
im... | |
import numpy as np
import theano
import theano.tensor as T
from . import model
""" optimizer.py (module)
The optimizer module contains the Optimizer class that is used
to configure low-rank MNE models, initialize the solver, and
minimize the (possibly constrained and regularized) objective
function.
"""
class ... | |
<gh_stars>1-10
from flask import abort, Response, jsonify, request
from flask_jwt_extended import current_user
from flask_restful import Resource
from sqlalchemy import exc
from datetime import date
from backend.app import db
from backend.common.permissions import roles_allowed
from backend.models import Team, Tribe, ... | |
import os
import numpy as np
import pytest
import vtk
import pyvista
from pyvista import examples
from pyvista.plotting import system_supports_plotting
beam = pyvista.UnstructuredGrid(examples.hexbeamfile)
# create structured grid
x = np.arange(-10, 10, 2)
y = np.arange(-10, 10, 2)
z = np.arange(-10, 10, 2)
x, y, z... | |
<gh_stars>0
import inspect
import math
import sys
from abc import ABC, abstractmethod
from typing import Union, Tuple
import numpy as np
from scipy import stats
from scipy.special import erfcinv
from autoconf import conf
from autofit import exc
from autofit.mapper.model_object import ModelObject
from aut... | |
"""
Clip del texto, la parte encerrada en el texto es visible.
clip(x1, x2, x3, x4)
clip(vector)
"""
tipo = ""
if reverse:
tipo = "i"
if y1 == None and x2 == None and y2 == None:
vector = x1 # clip vectorial
return '\\{:s}clip({:s})'.format(tipo, vector)
elif x2 == None and y2 == None:
scale, vector = x1, ... | |
<reponame>joeferg425/ws281x_lightberries
"""Class defines methods for interacting with Light Strings, Patterns, and Functions."""
import time
import random
import logging
from typing import (
Callable,
Dict,
List,
Optional,
Union,
Any,
)
from nptyping import NDArray
import numpy as np
from LightBerries import Lig... | |
from __future__ import absolute_import, division, print_function
import iotbx.ncs
import iotbx.ncs as ncs
from iotbx import pdb
pdb_str_1="""\
ATOM 1 N GLU A 3 189.385 151.249 151.584 1.00100.71 N
ATOM 2 CA GLU A 3 190.604 152.017 151.807 1.00100.71 C
ATOM 3 C GLU A 3 191.582 151.843 150.650 1.00100.71 C
ATOM 4 O GLU ... | |
results['xlim']: (`left`, `right`), optional
results['ylim']: (`up`, `down`), optional
results['plot_method']: str, optional
'contourf', 'pcolor', 'pcolormesh', or 'plot_surface'
default 'contourf', if 'Z' all zeros, default is 'pcolormesh'
results['plot_method_args']: list, optional
args for *plot_method*, like ... | |
from PyQt5 import QtCore, QtWidgets, QtGui
from PyQt5.QtWebEngineWidgets import QWebEngineView
import application
import cache
import view
from math import sin, cos, sqrt, atan2, radians
import graph
import view
import time
import traceback
import sys
class searchForm():
"""
Initializes an instance of the search for... | |
length in detrendlens
roundN = N/detrendlen * detrendlen
numchunks = roundN / chunklen
# Read in the file
print 'Reading "%s"...'%filenm
timeseries = Num.fromfile(filenm, dtype=Num.float32, count=roundN)
# Split the timeseries into chunks for detrending
numblocks = roundN/detrendlen
timeseries.shape = (numblock... | |
"""
@author: <NAME>
@since: 21/08/2016
@modified:
A BST implementation supporting
- insert = O(h)
- remove = O(h)
- look up = O(h)
- get min = O(h)
- get max = O(h)
assuming left < key =< right
Time Complexity:
- best case, avg case = O(log n) as in inserting, removing, looking up, finding min/max we needed to tra... | |
<reponame>ssimbox/ssimbox-rigTools
from ctrlUI_lib import createClav2, createSphere
import maya.cmds as cmds
import maya.OpenMaya as om
from functools import partial
def duplicateChain(*args):
global ogChain
global chainLen
global switcherLoc
global side
global controllerColor
global clavCheckbox
global rigGr... | |
L[i - 2], L[i - 1], L[i] = L[i - 1], L[i], L[i - 2]
bribes += 2
else:
return "Too chaotic" # Expected person is more than 2 steps away.
return bribes
test_count = int(input())
for _ in range(test_count):
input()
line = list(map(int, input().split()))
print(bribe_count(line))
def brute_force(rt="O(n^2"): # F... | |
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
import logging
from asyncio import iscoroutinefunction, run, ensure_future
from inspect import isasyncgenfunction
from typing import Optional, Any, Union, Dict, Tuple, List
f... | |
<filename>gui.py
from PySide import QtGui, QtCore
import pymouse
import watchman
import collections
import threading
import time
import mixer
window_w = 640
window_h = 400
class SPApp(QtGui.QMainWindow):
orch_text = "A light orchestral accompaniment, reacting to colour changes."
elec_text = "A soft-pad synth acco... | |
arg0.ctx
res = isl.isl_multi_pw_aff_has_range_tuple_id(arg0.ptr)
if res < 0:
raise
return bool(res)
def identity(*args):
if len(args) == 1:
ctx = args[0].ctx
res = isl.isl_multi_pw_aff_identity_multi_pw_aff(isl.isl_multi_pw_aff_copy(args[0].ptr))
obj = multi_pw_aff(ctx=ctx, ptr=res)
return obj
raise Error
@... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
wz_compat/import_pupils.py - last updated 2019-12-03
Convert the pupil data from the form supplied by the school database.
Retain only the relevant fields, add additional fields needed by this
application.
==============================
Copyright 2019 <NAME>
Lice... | |
<filename>data_utils/MyDataLoader.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 28 13:38:48 2020
@author: fa19
"""
import nibabel as nb
import numpy as np
import torch
import random
from scipy.interpolate import griddata
import os
means_birth_age = torch.Tensor([1.18443463... | |
<gh_stars>10-100
'''
Created on Jun 14, 2017
@author: teor
See LICENSE for licensing information
'''
import logging
from privcount.config import validate_ip_address
from privcount.log import summarise_string
def parse_tagged_event(event_field_list):
'''
Parse event_field_list from an event with tagged fields.
E... | |
gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.update_secret), "__call__") as call:
call.return_value = resources.Secret()
client.update_secret(request)
# Establish that the underlying gRPC stub method was called.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
as... | |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ##... | |
<gh_stars>1-10
from datetime import datetime
from itertools import groupby
import json
import requests
from .base import matchcommon
from .exceptions import FSConnectionError
from .matchdict import MatchDict
from .matchdict import MatchDictKeys as MDKey
from .matchevent import MatchEvent
from .playeraction import Play... | |
'\x1b[1;93m(+) Katasandi : \x1b[1;97m ' + pass9
print '\x1b[1;93m(+) DD/MM/YY : \x1b[1;97m ' + c['birthday']
print '\x1b[1;93m(+) Followers : \x1b[1;97m ' + c['subscribers'] + '\n'
print '\x1b[1;91m\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x9... | |
<reponame>tngTUDOR/presamples
from copy import deepcopy
from pathlib import Path
import json
import numpy as np
import os
import shutil
import uuid
import copy
import warnings
from .errors import InconsistentSampleNumber, ShapeMismatch, NameConflicts
from .utils import validate_presamples_dirpath, md5
try:
from bw2d... | |
#!/usr/bin/env python
# coding: utf-8
# ! ./setup.sh # uncomment if you wish to install any new packages
get_ipython().run_line_magic('matplotlib', 'inline')
import tensorflow as tf
import tensorflow_docs as tfdocs
import tensorflow_docs.modeling
import sys
from pathlib import Path
import datetime
import time
impo... | |
'arabian_camel', 'aliases': []},
'1f42b': {'canonical_name': 'camel', 'aliases': []},
'1f418': {'canonical_name': 'elephant', 'aliases': []},
'1f98f': {'canonical_name': 'rhinoceros', 'aliases': []},
'1f98d': {'canonical_name': 'gorilla', 'aliases': []},
'1f40e': {'canonical_name': 'horse', 'aliases': []},
'1f416... | |
# Copyright 2020 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
<filename>zunclient/tests/unit/v1/test_containers.py<gh_stars>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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
!= c.primary)
self.assertEqual('baz', db.test.find_one({'bar': 'baz'})['bar'])
def tearDown(self):
Monitor._refresh_interval = MONITOR_INTERVAL
super(TestWritesWithFailover, self).tearDown()
class TestReadWithFailover(HATestCase):
def setUp(self):
res = ha_tools.start_replica_set([{}, {}, {}])
self.seed, sel... | |
252588 * uk_153
+ 112908 * uk_154
+ 5929741 * uk_155
+ 7109137 * uk_156
+ 3177817 * uk_157
+ 8523109 * uk_158
+ 3809869 * uk_159
+ 4593241 * uk_16
+ 1703029 * uk_160
+ 10218313 * uk_161
+ 4567633 * uk_162
+ 2041753 * uk_163
+ 912673 * uk_164
+ 3969 * uk_17
+ 7056 * uk_18
+ 6111 * uk_19
+ 63 * uk_2
+ 75... | |
The values for arguments and options can be
parsed from :data:`sys.argv` or supplied by a client via keyword arguments.
A command is defined by creating an instance of :class:`Cmd`
with the :meth:`~Cmd.__init__` arguments defining the command's arguments,
options, and possibly sub-commands.
Calling a :class:`Cmd` ins... | |
- 1.25*log(1 + m.x724/(1e-6 + m.b985)))*(1e-6 + m.b985) <= 0)
m.c803 = Constraint(expr= m.x725 == 0)
m.c804 = Constraint(expr= m.x726 == 0)
m.c805 = Constraint(expr= m.x727 == 0)
m.c806 = Constraint(expr= m.x758 == 0)
m.c807 = Constraint(expr= m.x759 == 0)
m.c808 = Constraint(expr= m.x760 == 0)
m.c809 = Constrai... | |
"""Test the Uonet+ Vulcan config flow."""
import json
from unittest import mock
from unittest.mock import patch
from vulcan import Account
from vulcan.model import Student
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.vulcan import config_flow, const, register
from homeassist... | |
<filename>stringencrypt/stringencrypt.py
#!/usr/bin/env python
###############################################################################
#
# String Encryption and File Encryption for programmers & developers
#
# String Encrypt can help you hide the things that shouldn't be visible at
# first glance in your sourc... | |
<filename>libs/utils.py
#!/usr/bin/env python3
import os
import re
import numpy as np
import bottleneck as bn
import pandas as pd
from scipy.special import gamma, binom
from scipy.stats import chi2
from scipy.spatial.distance import pdist, squareform
from sklearn.metrics import adjusted_rand_score
from sklearn.metrics... | |
"""
Twisted integration for Urwid.
This module allows you to serve Urwid applications remotely over ssh.
The idea is that the server listens as an SSH server, and each connection is
routed by Twisted to urwid, and the urwid UI is routed back to the console.
The concept was a bit of a head-bender for me, but really we... | |
THERMAL SUB-NODES IN THIS SYSTEM HAS EXCEEDED 600.
THIS FATAL ERROR PREVENTS FURTHER INTERPRETATION OF THIS SYSTEM INPUT FILE.
SOME FATAL ERRORS MAY BE CORRECTED BY EITHER CHANGING THE NUMBER OF ITEMS INPUT OR CHANGING THE PROGRAM
ARRAY SIZES. PLEASE SEE DISCUSSIONS IN BOTH THE 'ERROR MESSAGES' PORTION OF THE USER'S... | |
#+= imports =+#
import sys
import os
import time
if sys.version_info < (3, 8):
os.system('cls' if os.name == 'nt' else 'clear')
print('[Warning] Your version of Python is lower than the recommended Python version')
print('This program officially supports Python version 3.8 and higher')
print(sys.version_inf... | |
<filename>parsimony/utils/linalgs.py
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 23 19:15:22 2014
Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin. All rights reserved.
@author: <NAME>, <NAME>
@email: <EMAIL>, <EMAIL>
@license: BSD 3-clause.
"""
from six import with_metaclass
import abc
import numpy as np
import s... | |
financials_financial_company_item_update_item_category(client,
company_id,
item_id,
id_=None,
code=None,
display_name=None,
last_modified_date_time=None):
body = {}
body['id'] = id_
body['code'] = code
body['display_name'] = display_name
body['last_modified_date_time'] = last_modified_date_time
... | |
<reponame>salistito/Computer-Graphics
# coding=utf-8
"""
<NAME>, CC3501-Tarea3a, 2020-1
Finite Differences for Partial Differential Equations
Solving the Laplace equation in 3D with Dirichlet and
Neumann border conditions over a parallelepiped domain.
"""
import numpy as np
import sys
import json_reader as r
import sc... | |
True,
"v6.0.11": True
}
}
],
"revisions": {
"v6.0.0": True,
"v7.0.0": True,
"v6.0.5": True,
"v6.4.4": True,
"v7.0.1": True,
"v6.4.0": True,
"v6.4.1": True,
"v6.2.0": True,
"v6.2.3": True,
"v6.2.5": True,
"v6.2.7": True,
"v6.0.11": True
}
},
"name": {
"type": "string",
"revisions": {
"v6.4.4": Tru... | |
import json
import unittest
from flask_caching import Cache
from sqlalchemy import asc
from app import app, db
from apps.releases.models import (
Releases,
ReleaseFormats,
ReleasesFormatsMapping,
ReleaseCategories,
ReleasesCategoriesMapping,
ReleasesReports
)
from apps.releases.patches import pat... | |
# -*- coding: utf-8 -*-
tests = r"""
>>> from django.forms import *
>>> from django.forms.widgets import RadioFieldRenderer
>>> from django.core.files.uploadedfile import SimpleUploadedFile
>>> import datetime
>>> import time
>>> import re
>>> try:
... from decimal import Decimal
... except ImportError:
... from django... | |
# <NAME>, 2017:
from structuredPredictionNLG.Action import Action
from structuredPredictionNLG.MeaningRepresentation import MeaningRepresentation
from structuredPredictionNLG.DatasetInstance import DatasetInstance, cleanAndGetAttr, lexicalize_word_sequence
from structuredPredictionNLG.FullDelexicalizator import full_de... | |
+ self._SEPARATOR + query.kind() + \
dbconstants.KIND_SEPARATOR + \
str(ancestor_filter) + \
self._TERM_STRING
if '__key__' not in filter_info:
return startrow, endrow, start_inclusive, end_inclusive
for key_filter in filter_info['__key__']:
op = key_filter[0]
__key__ = str(key_filter[1])
if op and op == data... | |
self._bank.get_item_form_for_create([MULTI_LANGUAGE_OBJECT_RECORD])
form.add_description(self._english())
form.add_description(self._telugu())
item = self._bank.create_item(form)
hi_bank = self.get_bank_with_proxy_set_to_locale('HIN')
hi_item = hi_bank.get_item(item.ident)
self.assertEqual(
hi_item.description.... | |
microseconds = divmod(microseconds, 1000000)
days, seconds = divmod(seconds, 24*3600)
d += days
s += seconds
microseconds = round(microseconds + usdouble)
assert isinstance(s, int)
assert isinstance(microseconds, int)
assert abs(s) <= 3 * 24 * 3600
assert abs(microseconds) < 3.1e6
# Just a little bit of carry... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.