input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"city": "Placentia",
"growth_from_2000_to_2013": "11.8%",
"latitude": 33.8722371,
"longitude": -117.8703363,
"population": "52206",
"rank": "704",
"state": "California",
},
{
"city": "West New York",
"growth_from_2000_to_2013": "13.3%",
"latitude": 40.7878788,
"longitude": -74.0143064,
"population": "52122... | |
33, -3, -5): (1, 1),
(4, 33, -3, -4): (-1, 1),
(4, 33, -3, -3): (0, 1),
(4, 33, -3, -2): (0, 1),
(4, 33, -3, -1): (0, 1),
(4, 33, -3, 0): (0, 1),
(4, 33, -3, 1): (0, 1),
(4, 33, -3, 2): (0, 0),
(4, 33, -3, 3): (-1, -1),
(4, 33, -3, 4): (0, 1),
(4, 33, -3, 5): (0, 1),
(4, 33, -2, -5): (0, 1),
(4, 33, -2, -4)... | |
338, 772, 629, 726, 296, 672,
282, 268, 741, 330, 272, 217, 188, 754, 875,
58],
[869, 349, 328, 585, 442, 812, 645, 854, 317,
437, 314, 343, 571, 202, 534, 22, 307, 874,
859],
[161, 579, 865, 703, 276, 889, 374, 792, 123,
668, 970, 737, 846, 416, 704, 204, 660, 223,
509],
[243, 645, 359, 427, 636, 193, 663, 85... | |
used as the '
'file\n'
'for output.\n',
'raise': '\n'
'The "raise" statement\n'
'*********************\n'
'\n'
' raise_stmt ::= "raise" [expression ["," expression ["," '
'expression]]]\n'
'\n'
'If no expressions are present, "raise" re-raises the last '
'exception\n'
'that was active in the cur... | |
<gh_stars>0
from collections import OrderedDict
from django import forms
from django.contrib import admin
from django.core.paginator import Paginator
from django.db.models import Count, Q, Prefetch
from django.template import loader
from django.utils.translation import ugettext
from rangefilter.filter import (
DateR... | |
name='res4b12_branch2a')
.batch_normalization(scale=True, center=True, relu=True, name='bn4b12_branch2a')
.conv(3, 256, 1, biased=False, relu=False, name='res4b12_branch2b')
.batch_normalization(scale=True, center=True, relu=True, name='bn4b12_branch2b')
.conv(1, 1024, 1, biased=False, relu=False, name='res4b12_bra... | |
if _newclass:hostInterfaceMajorVersion = _swig_property(_ok.okTDeviceInfo_hostInterfaceMajorVersion_get, _ok.okTDeviceInfo_hostInterfaceMajorVersion_set)
__swig_setmethods__["hostInterfaceMinorVersion"] = _ok.okTDeviceInfo_hostInterfaceMinorVersion_set
__swig_getmethods__["hostInterfaceMinorVersion"] = _ok.okTDeviceI... | |
<filename>research/syntaxnet/dragnn/python/component.py
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | |
fabric_name, # type: str
protection_container_name, # type: str
replicated_protected_item_name, # type: str
cleanup_input, # type: "_models.TestFailoverCleanupInput"
**kwargs # type: Any
):
# type: (...) -> Optional["_models.ReplicationProtectedItem"]
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_mode... | |
'''ResNet in PyTorch.'''
import os
import argparse
import shutil
import time
import json
import math
import operator
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torchvision.datasets as dset
import torchvision.transforms as t... | |
and word[3] != "o" and word[4] != "O" and word[4] != "o" and word[5] != "O" and word[5] != "o" and word[6] != "O" and word[6] != "o" :
print("\nWrong!\n")
numberOfErrors = numberOfErrors + 1
wrongChars = wrongChars + "o" + ", "
if guessChar == "P" or guessChar == "p" :
if word[1] == "P" or word[1] == "... | |
full_delex:
if value == 'yes':
value = 'family friendly'
else:
value = 'not family friendly'
elif value == "yes" or value == "no":
value = attribute + "_" + value
if forTrain and singlePredicate not in self.attributes:
self.attributes[singlePredicate] = set()
if attribute:
if forTrain:
self.attributes[singl... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The F4PGA Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
""" Classes for representing and creating a physica... | |
"▁edition": 21752,
"▁leader": 21753,
"Secret": 21754,
"eń": 21755,
"lase": 21756,
"struct": 21757,
"tamina": 21758,
"▁Stanisław": 21759,
"▁baro": 21760,
"▁twee": 21761,
"indra": 21762,
"nello": 21763,
"statt": 21764,
"▁Something": 21765,
"▁Tant": 21766,
"▁Workshop": 21767,
"▁million": 21768,
"▁nin": 21... | |
<filename>bindings/python/cntk/utils/progress_print.py
# ==============================================================================
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ===========================... | |
<filename>docker/deps/torchlayers/torchlayers/convolution.py
import collections
import itertools
import math
import typing
import torch
from ._dev_utils import modules
from .pooling import GlobalAvgPool
class Conv(modules.InferDimension):
"""Standard convolution layer.
Based on input shape it either creates 1D, ... | |
x = self.cache['cloudtrail']['get_trail_status'].get(region,{})[ct['TrailARN']]['LatestCloudWatchLogsDeliveryTime']
if (time.time() - x) < 86400:
evidence = {region : self.cache['cloudtrail']['get_trail_status'].get(region,{})[ct['TrailARN']]['LatestCloudWatchLogsDeliveryTime']}
compliance = 1
self.finding(polic... | |
"""
Module for building and manipulating astronomical catalogues.
@author: A.Ruiz
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import zip, range
from io import open
import os
import warnings
import tempfile
import subprocess
from copy ... | |
# -*- coding: utf-8 -*-
"""
Group Routes
List Groups
Count Groups
State of Group
Create Group
Get Group
Add User to Group
Remove User to Group
"""
import asyncio
import uuid
from datetime import datetime
from fastapi import APIRouter, Query, status
from fastapi.responses import JSONResponse, ORJSONResponse
from loguru... | |
block(config['channel_label_num'], 4, 1, order=['c', 'b', 's'], order_param=[conv_param, None, None])(x)
if config['feed_pos']:
return create_and_compile_model([inputs, in_pos], out, config)
else:
return create_and_compile_model(inputs, out, config)
def model_dilated_dense_net(self, config, len_dense=None, base_... | |
"next-hop": li.ip.split('/')[0]
}
if preference > 0:
static_entry[
"preference"] = preference
preference += 1
srs = static_routes.setdefault(
ri_obj.service_chain_address, [])
srs.append(static_entry)
return static_routes
# end compute_pnf_static_route
def push_config(self):
if not self.config_manager:
s... | |
import json
from importlib import import_module
import logging
from pathlib import Path
import pkg_resources
import shutil
import sys
import tarfile
from furl import furl
import requests
from semver import max_satisfying
from django.apps import apps
from django.utils.encoding import (
force_bytes, force_text, python... | |
= "meta" in prefixes
clazz.broadcast = "broadcast" in prefixes
clazz.urgent = "urgent" in prefixes
return prefixes, clazz
def bounded_int_type(evaluator, ast, state):
"""Evaluates "int[a,b]"."""
uppaal_clazz_name = f'bounded_int' # f'Uppaal_bounded_int'
lower_val = evaluator.eval_ast(ast["lower"], state)
upper... | |
<reponame>jbalint/spark
"""
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the i... | |
0, 0, 0, 0],
[1529, 8.704895, 0, 9999, -9999, 1.0, 100, 1, 84.378012, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1530, 2.692923, 0, 9999, -9999, 1.0, 100, 1, 79.055155, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1531, 104.653862, 0, 9999, -9999, 1.0, 100, 1, 183.821409, 0.0, 0, 0, 0, 0, 0,... | |
"""Objects representing regions in space."""
import math
import random
import itertools
import numpy
import scipy.spatial
import shapely.geometry
import shapely.ops
from scenic.core.distributions import Samplable, RejectionException, needsSampling
from scenic.core.lazy_eval import valueInContext
from scenic.core.vec... | |
"""Database schema functions and information for Toron node files.
Toron nodes are stored as individual files. The file format is
managed, internally, as a relational database. The schema for this
database is shown below as a simplified ERD (entity relationship
diagram). SQL foreign key relationships are represented w... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import copy
import re
from collections import OrderedDict
from ..errors import ArgumentError, CubesError
from ..metadata import Dimension, Cube
from ..logging import get_logger
from .. import compat
__all__ = [
"Cell",
"Cut",
"PointCut",
"RangeCut... | |
<gh_stars>1-10
#
# Python stuff to improve portability
#
from __future__ import print_function
#
# Generic python packages used
#
import datetime
import fcntl
import getpass
import os
import select
import SocketServer
import socket
import subprocess
import sys
import threading
import time
from stat import *
#
# XDD ... | |
testMonthlyByMinuteAndSecond(self):
self.assertEqual(list(rrule(MONTHLY,
count=3,
byminute=(6, 18),
bysecond=(6, 18),
dtstart=datetime(1997, 9, 2, 9, 0))),
[datetime(1997, 9, 2, 9, 6, 6),
datetime(1997, 9, 2, 9, 6, 18),
datetime(1997, 9, 2, 9, 18, 6)])
def testMonthlyByHourAndMinuteAndSecond(self):
self.asse... | |
# Copyright (c) Lawrence Livermore National Security, LLC and other Conduit
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Conduit.
"""
file: t_python_conduit_node.py
description: Unit tests for conduit::Node python m... | |
import sys
import threading
import ctypes
from os import path,remove,unlink,mkdir
import time
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt,QEvent,QPoint,QRect,QLine
from PyQt5.QtWidgets import QAbstractSlider, QApplication, QMainWindow, QToolBar
from PyQt5.QtGui import QMouseEvent
from PyQt5.... | |
icon to TOIF format"""
# TODO: move this to python-trezor at some point
DIM = 32
icon = icon.resize((DIM, DIM), Image.LANCZOS)
# remove alpha channel, replace with black
bg = Image.new("RGBA", icon.size, (0, 0, 0, 255))
icon = Image.alpha_composite(bg, icon)
# process pixels
pix = icon.load()
data = bytes()
f... | |
suites mode
announcement -- The description/announcement of the project
show_announcement -- True to show the announcement/description on
project page and false otherwise
is_completed -- True if the project is marked as completed and
false otherwise
completed_on -- The date/time when the project was marked as
co... | |
#!/usr/bin/env python3
import mysql.connector as mysql
import datetime
from math import floor
from threading import RLock
from configparser import ConfigParser
class PlaylistDatabase():
'''
This database is designed to manage songs played by a
internet radio station. It stores the web address of the station,
so... | |
<gh_stars>0
"""
Support for Lenco DIR150BK and other Airmusic based Internet Radios.
"""
import logging
import requests
import xmltodict
VERSION = '0.0.1'
class airmusic(object):
"""
This class contains constants ands methods to implement the AirMusic API.
"""
# The KEY_... constants represent the correspondin... | |
an invalid generation
number.
"""
generation = request.args.get(version_field_name)
if generation is None:
return self.get_latest()
version = self.revisions.get(int(generation))
if version is None:
raise error_response.ErrorResponse(
'Precondition Failed: generation %s not found' % generation)
return version
... | |
# coding=utf-8
""" Google Earth Engine Landsat Collections """
from .visualization import *
from .datasets import OpticalSatellite, ImageCollection
from .bands import OpticalBand, BitBand, ClassificationBand, ExpressionBand,\
Precisions
from .helpers import TODAY
from functools import partial
from . import register
fr... | |
show version
Cisco IOS Software, 901 Software (ASR901-UNIVERSALK9-M), Version 15.6(2)SP4, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2018 by Cisco Systems, Inc.
Compiled Mon 19-Mar-18 16:39 by prod_rel_team
ROM: System Bootstrap, Version 15.6(2r)SP4, RELEASE SOFT... | |
FilenamePrefix + "_" + str(i) + Suffix
#write to file
BasinChannelData.to_csv(OutputFilename, index=False)
def RemoveSmallSegments(BasinHillslopeData, n_traces=50):
"""
Remove hilltop segments with less than a specified number of traces in a basin
Args:
BasinHillslopeData (pandas dataframe): The dataframe conta... | |
distribution function. Because the
Notes
-----
This is needed because the azimuthal bin locations in the
burst data FPI distribution functions is time dependent. By
extracting single distributions, the phi, theta, and energy
variables become time-independent and easier to work with.
Calculation of velocity ... | |
#import necessary libraries
import numpy as np
from arqtic.program import Program, Gate
from arqtic.qite import make_QITE_program
from arqtic.arqtic_for_ibm import ibm_circ_to_program, get_ibm_circuit
from arqtic.ds_compiler import get_constant_depth_program
from arqtic.real_time import heisenberg_evolution_program
fro... | |
if not isinstance(model_desc, MDescriptor):
raise TypeError("Invalid model descriptor")
if not model_desc.validate():
raise ValueError("Model definition not successfully validated")
if model_desc.name not in self._mReg:
self._mReg.add(model_desc)
else:
raise KeyError('Model with this name already exists in regis... | |
in list(self.config_dict_base[key].keys()):
yangpath=self.model_url_name_map[self.config_dict_base[key]["@xmlns"]]["module"][0]
self.grpc_getparam_list_base.append(yangpath+":"+key)
else:
self.config_dict_base.pop(key)
elif (dict_type == "candidate"):
for key in list(self.config_dict.keys()):
if isinstance(self.... | |
assert np.all(np.logical_and(1 <= image_aug, image_aug <= 10))
assert not np.allclose(image_aug[1:, :], image_aug[:-1, :], atol=0.01)
aug = iaa.ReplaceElementwise(mask=0.5, replacement=iap.DiscreteUniform(1, 10), per_channel=True)
image = np.full((1, 1, 100), 0, dtype=dtype)
image_aug = aug.augment_image(image)
a... | |
from datetime import datetime
import discord
import itertools
from .utils import formatString, getUsageEmbed, getOopsEmbed
# IDEAS
# 1. Paying out points (without bets)
class DiscordPoints:
"""
Class that parses Discord Points info and interactions
Attributes
__________
fire (Fire obj): The fire instance where... | |
<filename>ContestAnalyzerOnline/views.py<gh_stars>1-10
from django.shortcuts import render, redirect
from string import ascii_uppercase
import itertools
from ContestAnalyzerOnline.forms import ContestForm
from pycontestanalyzer.contest import Contest
from pycontestanalyzer.utils.downloads.logs import get_list_of_logs
f... | |
import logging
import configparser
from pymongo import MongoClient
from bson import ObjectId
import os
logger = logging.getLogger("MongoDB Controller")
logger.setLevel(logging.INFO)
# create file handler which logs even debug messages
log_file_handler = logging.FileHandler("covid_chatbot.log")
log_file_handler.setLeve... | |
<filename>sdk/python/pulumi_linode/_inputs.py<gh_stars>0
# 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, Ma... | |
view_layer, "select")
cls.isolated = False
elif modifiers == {"ctrl", "shift"}:
isolate_rto(cls, self, view_layer, "select", children=True)
else:
# toggle selectable
# reset select history
del rto_history["select"][view_layer]
# toggle selectability of collection
laycol_ptr.collection.hide_select = not la... | |
z3.is_true(m.eval(encode_equality(t,w))):
return w
# print "model: {}".format(m.sexpr())
# print "term: {}".format(t)
res = ivy_logic.Constant(ivy_logic.Symbol(s.defines()[0],s))
print "warning: model doesn't give a value for enumerated term {}. returning {}.".format(t,res)
return res
# assert False # model doesn't... | |
<filename>heat/tests/test_volume.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | |
species.generate_resonance_structures()
# Get the thermo data for the molecule
symmetry_number = None
thermo_data_list = []
word_list = []
ref_dict = {}
for data, library, entry in database.thermo.get_all_thermo_data(species):
# Make sure we calculate Cp0 and CpInf
find_cp0_and_cpinf(species, data)
# Round t... | |
if A is None else vstack([eyex, A], "csr")
ll = r_[xmin, l]
uu = r_[xmax, u]
# split up linear constraints
ieq = flatnonzero( absolute(uu - ll) <= EPS )
igt = flatnonzero( (uu >= 1e10) & (ll > -1e10) )
ilt = flatnonzero( (ll <= -1e10) & (uu < 1e10) )
ibx = flatnonzero( (absolute(uu - ll) > EPS) & (uu < 1e10) & ... | |
<filename>win/devkit/other/pymel/extras/completion/py/PySide/QtNetwork.py
from PySide.QtCore import QObject as _QObject
from PySide.QtCore import QIODevice as _QIODevice
class _Object(object):
__dict__ = None
class QNetworkCookieJar(_QObject):
def __init__(*args, **kwargs):
"""
x.__init__(...) initializes x; see... | |
s.write('}')
s.newline()
def get_all_dependent_pkgs(search_path, context, package, indir):
msgs = msg_list_full_path(package, search_path, '.msg')
srvs = msg_list_full_path(package, search_path, '.srv')
all_pkgs = set()
for msg in msgs:
msg_name = os.path.basename(msg)
full_type = genmsg.gentools.compute_full_t... | |
"""
"""
# Libraries
import numpy as np
import pandas as pd
# Pint libraries
from pint.errors import UndefinedUnitError
# DataBlend libraries
from datablend.core.settings import textwrapper
from datablend.core.settings import ureg
from datablend.utils.pandas import nanunique
from datablend.utils.pandas_schema import... | |
<reponame>martinhoefling/smbprotocol<gh_stars>0
import pytest
from smbprotocol.security_descriptor import AccessAllowedAce, \
AccessDeniedAce, AceType, AclPacket, AclRevision, SDControl, SIDPacket, \
SMB2CreateSDBuffer, SystemAuditAce
class TestSIDPacket(object):
def test_create_message(self):
sid = "S-1-1-0"
... | |
in the calculation array for a model
places startposition for each variable in model.allvar[variable]['startpos']
places the max startposition in model.maxstart '''
if self.maxstart == 0:
variabler = (x for x in sorted(self.allvar.keys()))
start = 0
for v, m in ((v, self.allvar[v]['maxlag']) for v in variabler)... | |
<reponame>seandong37tt4qu/jeszhengq
#!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of th... | |
deprel: {word.deprel} :: misc: {word.misc}")
#the following get generated over function to use different attributes of the words (see function for more info)
child_val, tuple_child_val = get_comparison_attributes(word, sub_tuple[child_index], eric)
deprel_val, tuple_deprel_val = get_comparison_attributes(word, sub... | |
==> 1968532 (Roth -W)
# sh Y2H_Blastn.sh 2016-12-22_MiSeq 17544_S2_R1 17544_S2_R2 ../data/roth2016_control_set_plus_control.-100 17544_S2 > qjobs/qjob_2016-12-22_MiSeq_S2.sh # ==> 1541502 (Roth -A) from 2418986 (trimed seq) from xxx
# sh Y2H_Blastn.sh 2016-12-22_MiSeq 17545_S3_R1 17545_S3_R2 ../data/roth2016_control_se... | |
#!/usr/bin/env python
"""
Copyright (C) 2018 Intel 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/licenses/LICENSE-2.0
?
Unless required by applicable law or ag... | |
table header
#loop through parameters provided and write to table with formating
for l in range(numLay):
lay = str(l+1) #conver current layer to string
z = '%.3f' % sum(h[0:l+1]) #gets depth to layer through cumulative summation
VS, VP, PR, RHO, QS, QP = '%.3f' %vs[l], '%.3f' %vp[l], '%.3f' %sigma[l], ... | |
output_format == "Phase":
return torch.atan2(
-spec_imag + 0.0, spec_real
) # +0.0 removes -0.0 elements, which leads to error in calculating phase
def inverse(self, X, onesided=True, length=None, refresh_win=True):
"""
This function is same as the :func:`~nnAudio.Spectrogram.iSTFT` class,
which is to convert s... | |
"long-short-exit":
self.plt_3.addItem(self.scatter_exit_pred_long)
self.plt_3.addItem(self.scatter_exit_pred_short)
self.plt_3.addItem(self.scatter_exit_gain_pred)
self.plt_3.addItem(self.scatter_exit_stop_pred)
self.plt_3.addItem(self.x_line_plt3, ignoreBounds=True)
self.plt_3.addItem(self.y_line_plt3, ignoreBo... | |
<reponame>kwilcox/flopy<gh_stars>0
from numpy import empty,zeros,ones,where
from flopy.mbase import Package
class ModflowMnw2(Package):
'Multi-node well 2 package class\n'
'''
NOTE: This implementation does not allow well loss parameters {Rw,Rskin,Kskin,B,C,P,CWC,PP} to vary along the length of a given well. ... | |
"""
Created on 03/27/18.
@author: <NAME>, <NAME>
"""
import json
import numpy as np
from collections import OrderedDict
import multiprocessing as mp
import sys
from os import listdir, path
import re
import matplotlib.pyplot as plt
import matplotlib as mpl
def json_to_ordered_dict(file):
"""
Reads a timeline.json fi... | |
<gh_stars>0
"""
Email-based login system
Evennia contrib - Griatch 2012
This is a variant of the login system that requires an email-address
instead of a username to login.
This used to be the default Evennia login before replacing it with a
more standard username + password system (having to supply an email
for so... | |
"""dspritesb.py
Stuff to know:
- a basic class to load the dSprites and paint a randomly centered 2D gaussian blob behind each sprite.
- uses pytorch DataLoader.
- dspritesb.demo() runs basic unit tests
"""
from torch.utils.data import Dataset, DataLoader
import torch
import os
import numpy as np
from matplotlib imp... | |
9, column = 0)
self.image_trim_dim = PhotoImage(file = os.path.join(appPath, 'res', 'chain_dim.gif'))
self.buttonTrim_dim=Button(self.frame2p, image = self.image_trim_dim, command = self.parent.trim_dim)#, bg = self.button_func_color)
self.buttonTrim_dim.grid(row = 10, column = 0)
#ToolTips
self.tooltip_line = Too... | |
<reponame>SolarAlma/SALAT
import numpy as np
from astropy.io import fits
import astropy.units as u
from datetime import datetime,timedelta
import scipy
from scipy import ndimage
from scipy import stats as scpstats
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
... | |
<gh_stars>1-10
# Copyright (c) 2014 Rackspace, 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 law or agr... | |
#!/usr/bin/env python
"""This is the GRR config management code.
This handles opening and parsing of config files.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import copy
import errno
impor... | |
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2022 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restricti... | |
"""Test functions based on illustrations and exercises from
the book (in progress):
<NAME>, Structured Probabilistic Reasoning
Draft available from:
http://www.cs.ru.nl/B.Jacobs/PAPERS/ProbabilisticReasoning.pdf
Instruction: (install and) run "pytest -v" on this file.
One can also copy code fragements from this f... | |
# "Grinch Finger Wallpaper": "",
# "Naughty Present": "",
# "Baby Grinch's Mischief Whistle": "",
# "Ice Queen Trophy": "",
# "Santa-NK1 Trophy": "",
# "Everscream Trophy": "",
# "Music Box (Pumpkin Moon)": "",
# "Music Box (Alt Underground)": "",
# "Music Box (Frost Moon)": "",
# "Brown Paint": "",
# "Shadow... | |
auto()
Demades = auto()
Demaratos = auto()
Demarmenos = auto()
Demas = auto()
Demeas = auto()
Demetrios = auto()
Democedes = auto()
Demodocus = auto()
Demokrates = auto()
Demoleon = auto()
Demonax = auto()
Demonous = auto()
Demophlos = auto()
Demosthenes = auto()
Deon = auto()
Derkylos = auto()
Deukali... | |
Spider and use other storage engines for you
default task queue.
"""
# If queue is still not configured
# then configure it with default backend
if self.taskq is None:
self.setup_queue()
def process_task_generator(self):
"""
Load new tasks from `self.task_generator_object`
Create new tasks.
If task queue... | |
"""The graphical representation of devices as nodes"""
import sys, time, os
if sys.version_info < (2, 6):
print "importing newer subprocess module from python 2.6"
from Core import subprocess
else:
import subprocess
from PyQt4 import QtCore, QtGui
from Core.globals import options, environ, mainWidgets, def... | |
"""
summary_data = []
#
totalcounted = 0
counted_dict = {}
size_range_dict = {} # Value for sizeclasses aggregated.
locked_list = []
#
for sampleobject in self._sample_rows.values():
# Check method step.
if method_step:
if not method_step == sampleobject.get_method_step():
continue
# Count on ... | |
from operator import itemgetter
from collections import OrderedDict
from typing import List, Tuple, Dict, Optional
import torch
from torch import nn, Tensor
import torch.nn.functional as F
from torchvision.models.detection.image_list import ImageList
from torchvision.models.detection.rpn import (
RegionProposalNetw... | |
<filename>src/python/packages/metadapter/processors/mdoAzimuth_processor.py
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 03 2017
@author: <NAME>
"""
import numpy
import math
from sys import version_info
if version_info.major <= 2:
import OSC
else:
# Use the self-made port for Python 3 (experimental)
from ..thi... | |
échantillons
st.write("R² score train modèle Lasso : ",r2_score(y_train2, pred_train2).round(5))
st.write("R² score test modèle Lasso : ",r2_score(y_test2, pred_test2).round(5))
st.write("Le score R² est très bon sur les 2 échantillons (valeur à maximiser , entre 0 et 1).")
st.write("")
# MAPE (Mean Abs... | |
n
except NameError:
raise NameError('Inputs N_e, temperature, and n must be specified')
if not isinstance(n, (int, NP.ndarray)):
raise TypeError('Input n must be an integer or numpy array')
n = NP.asarray(n).reshape(-1)
if NP.any(n < 1):
raise ValueError('Lower electron level must be greater than 1')
if not ... | |
from rdflib import Graph, plugin
from rdflib.parser import Parser
from rdflib.serializer import Serializer
import sys
import os
import argparse
import fnmatch
#It is a parse library that we can use
#Try to integrate Web Service
plugin.register("rdf-json", Parser, "rdflib_rdfjson.rdfjson_parser", "RdfJsonParser")
plug... | |
@var sql: str -- The sql statement
# @var err: str -- The error message for SQLite
# @var conn: object -- The custom database connection for Postgres and MySQL
# @var cur: object -- The custom connection cursor for Postgres and MySQL
#
# @return bool
##
def _create_database(self, database:str=None):
# Check th... | |
<reponame>hmtrii/tirg
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | |
"SR": ("Structured Report Document", [32, 33]),
},
"StudentTTest": {
"113068": ("Student's T-test", [218, 7180, 7469]),
},
"StudiesImported": {
"110027": ("Studies Imported", [7008]),
},
"Study": {
"113014": ("Study", [7012, 10000]),
},
"StudyDate": {
"111060": ("Study Date", []),
},
"StudyInstanceUID": {... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | |
different conn and cur to avoid error +++096 (old code)
fn_con, acur = litedb.connect(self.xcfg.DB_PATH)
for filepic in sfiles:
# filepic[1] = path for the file from table files
# filepic[2] = set_id from files table
setname = faw.set_name_from_file(filepic[1],
self.xcfg.FILES_DIR,
self.xcfg.FULL_SET_NAME)
as... | |
resource_path = '/amendments/{amendment-ID}'.replace('{format}', 'json')
path_params = {}
if 'amendment_id' in params:
path_params['amendment-ID'] = params['amendment_id']
query_params = {}
if 'organizations' in params:
query_params['organizations'] = params['organizations']
header_params = {}
form_params = ... | |
"""This module contains the backend implementation for tf Agents (see https://github.com/tensorflow/agents)"""
from abc import ABCMeta
from typing import Dict, Type
import math
import os
# noinspection PyUnresolvedReferences
import easyagents.agents
from easyagents import core
from easyagents.backends import core as b... | |
assert (particle_index == check_index ), "Attempting to add incorrect particle to hybrid system"
# Charge will be turned off at lambda_electrostatics_delete = 0, on at lambda_electrostatics_delete = 1; kill charge with lambda_electrostatics_delete = 0 --> 1
self._hybrid_system_forces['standard_nonbonded_force'].addP... | |
<reponame>0u812/roadrunner
# Test Module for RoadRunner
#
# Usage:
# import rrTester
# runTester (pathtoModelFile, modelFileName)
#-------------------------------------------------------------
# Tests for steady state and stoichiometric calculations in
# roadRunner. <NAME> November 2012
# Nov 2013: Modified to test A... | |
<reponame>bmdepesa/validation-tests
from common_fixtures import * # NOQA
shared_services = []
@pytest.fixture(scope='session', autouse=True)
def create_services_for_selectors(request, client, admin_client):
labels = [{"c1": "value1"}, {"c1": "value2"}, {"c2": "value1"},
{"c2": "value2"}, {"c2": "value3"},
{"c2": ... | |
the old stack counter for dead code elimination
stackRestore = self.stackCounter
# keep track of old assembly so that dead code can be removed
asmrestore = len(self.asm)
# declaration datatype
t = self.checkForType()
# ensure that non-valuetype structures cannot be declared in registers
if(not (isIntrinsic(t.na... | |
from inspect import getattr_static
from platform import node
import sqlite3
import asyncio
from sys import argv, exit, stdout, executable
from os import execl
from os.path import dirname, realpath, join
from PyQt6 import QtCore, QtWidgets
from PyQt6.QtCore import QThread, QTimer,pyqtSlot
from PyQt6.QtWidgets i... | |
# -*- coding: utf-8 -*-
"""
flask_oauth
~~~~~~~~~~~
Implements basic OAuth support for Flask.
:copyright: (c) 2010 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
import httplib2
from functools import wraps
from urllib.parse import urljoin
from flask import request, session, json, redirect, Response
... | |
<gh_stars>1-10
r"""The field module calculates the potentials and fields of silicon sensors.
The potential is determined numerically by solving these equations on a mesh:
.. math:: \nabla^2 \Phi = 0
:label: laplace
.. math:: \nabla^2 \Phi = \frac{\rho}{\epsilon}
:label: poisson
For the weighting potential equatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.