input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<gh_stars>1-10
######################
# (c) 2012 <NAME> <<EMAIL>>
# License: BSD 3-clause
#
# Implements structured SVM as described in Joachims et. al.
# Cutting-Plane Training of Structural SVMs
#def warn(*args, **kwargs):
# pass
#import warnings
#warnings.warn = warn
from time import time
import numpy as np
import... | |
<filename>data/dataset.py
#!/usr/bin/env python3
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | |
and there is
at least one cased character in S, False otherwise.
"""
def isnumeric():
"""S.isnumeric() -> bool
Return True if there are only numeric characters in S,
False otherwise.
"""
def isprintable():
"""S.isprintable() -> bool
Return True if all characters in S are considered printable in
repr() or... | |
reset win monitor -> dip exceeded threshold
df.iat[lossix[slot], lix] = TARGETS[SELL]
if (lossix[slot] + time_agg) > tix:
break
lossix[slot] += time_agg
loss[slot] = close_delta_ratio(lossix[slot], tix, cix)
elif delta > 0:
if win[slot] > 0: # win monitoring is running
win[slot] = close_delta_ratio(winix[slot],... | |
<filename>tests/examples/minlplib/pooling_foulds5tp.py<gh_stars>1-10
# NLP written by GAMS Convert at 04/21/18 13:53:11
#
# Equation counts
# Total E G L N X C B
# 564 517 0 47 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 609 609 0 0 0 0 0 0
# FX 0 0 0 0 0 0 0 0... | |
target is not already defined: we should try to infer the type
if self.type_inference is True:
# Perform type inference
# Build dictionary with symbols
def_symbols = {}
def_symbols.update(self.locals.get_name_type_associations())
def_symbols.update(self.defined_symbols)
inferred_symbols = type_inference.infer_ty... | |
= query_states.shape[1], key_states.shape[1]
if self.has_variable("cache", "cached_key"):
mask_shift = self.variables["cache"]["cache_index"]
max_decoder_length = self.variables["cache"]["cached_key"].shape[1]
causal_mask = lax.dynamic_slice(
self.causal_mask, (0, 0, mask_shift, 0), (1, 1, query_length, max_decode... | |
str(numberOfElements)+'\n'
gamText = self.addSignalParameters(
inputDict['value_nid'].getParent().getNode('parameters'), gamText)
signalDict['dimensions'] = numberOfDimensions
signalDict['elements'] = numberOfElements
# endif len(inputDict['fields']) > 0
# endif Normal Reference
gamText += ' }\n'
inputSignals.ap... | |
<filename>dcos/package.py
import abc
import base64
import collections
import copy
import hashlib
import json
import os
import re
import shutil
import stat
import subprocess
import zipfile
from distutils.version import LooseVersion
import git
import portalocker
import pystache
import six
from dcos import (constants, em... | |
from Discord into an integration update event object.
Parameters
----------
shard : hikari.api.shard.GatewayShard
The shard that emitted this event.
payload : hikari.internal.data_binding.JSONObject
The dict payload to parse.
Returns
-------
hikari.events.guild_events.IntegrationUpdateEvent
The parsed integ... | |
= {}
#--
def pRobotHold(self):
""" Hold position of physical robot.
Return Value:
None.
"""
if self.IsCommUp():
self.mCmd.CmdStop()
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# vHemisson Gui and Support
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -... | |
import copy
from rlcard.games.doudizhu.utils import CARD_TYPE
#from douzero.dmc.utils import act
EnvCard2RealCard = {3: '3', 4: '4', 5: '5', 6: '6', 7: '7',
8: '8', 9: '9', 10: 'T', 11: 'J', 12: 'Q',
13: 'K', 14: 'A', 17: '2', 20: 'B', 30: 'R'}
RealCard2EnvCard = {'3': 3, '4': 4, '5': 5, '6': 6, '7': 7,
'8': 8, '9... | |
t2, '''
<a href="#" onclick="show_hideStuff('detailed_data'); return false;">
<br><br><hr><br>
<h3>Detailed Data (click to see or hide)</h3></a><br>
<div id="detailed_data" style="display:none">
'''
# last xx tweets is response limited to 180
res_last200_tweets = get_last200_tweets(user_to_check.lower... | |
# Interface for loading preprocessed fMRI data and confounds table
from os.path import exists
from bids import BIDSLayout
from nipype.interfaces.io import IOBase
from nipype.utils.filemanip import copyfile
from nipype.interfaces.base import (BaseInterfaceInputSpec, SimpleInterface,
traits, TraitedSpec,
Directory, St... | |
name as appears in the specification.
name = 'drem'
#: Alias for the `name` property.
mnemonic = name
#: List of operands this instruction takes, if any.
fmt = ()
#: True if this instruction can be prefixed by WIDE.
can_be_wide = False
class dreturn(Instruction):
""""""
__slots__ = ()
#: Numerical opcode f... | |
which contains user input.
Returns
-------
pandas.core.frame.DataFrame
Dataframe containing all rows from google worksheet.
"""
return pd.DataFrame(worksheet.get_all_records())
def update_google_worksheet(worksheet, df):
"""
Update new user input from df to connected worksheet
Parameters... | |
from typing import Union, List, Callable, Optional
import torch
from torch import Tensor
from torch import nn
import math
class FeedForward(nn.Module):
"""
Class for feedforward neural network model. Takes a list of pytorch tensors holding the weight initializations and
ties these together into a trainable neural n... | |
1 for i in self.complex_matrix[self.species.index(s),:]) and
s not in sink and s not in source for s in species_list)
def _intermediate_species(self):
"""Indices of species that are not sink or souce species."""
source = self._source_species()
sink = self._sink_species()
return [s for s in range(self.n_species)... | |
# Copyright 2011 OpenStack Foundation
# 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 applicable l... | |
<gh_stars>10-100
"""Straw module
Straw enables programmatic access to .hic files.
.hic files store the contact matrices from Hi-C experiments and the
normalization and expected vectors, along with meta-data in the header.
The main function, straw, takes in the normalization, the filename or URL,
chromosome1 (and opti... | |
""" Linear solvers that are used to solve for the gradient of an OpenMDAO System.
(Not to be confused with the OpenMDAO Solver classes.)
"""
# pylint: disable=E0611, F0401
import numpy as np
from scipy.sparse.linalg import gmres, LinearOperator
from openmdao.main.mpiwrap import MPI
from openmdao.util.graph import fix... | |
import time
from typing import List, Optional, Tuple, Union
from lightly.openapi_generated.swagger_client.models.datasource_config import DatasourceConfig
from lightly.openapi_generated.swagger_client.models.datasource_purpose import DatasourcePurpose
from lightly.openapi_generated.swagger_client.models.datasource_pro... | |
# import all of our required libraries for necessary data processing and data requests
import numpy as np
import pandas as pd
from binance.client import Client
import joblib
import os
# define our function to retrieve klines data from binance API
def get_data():
'''
This function will execute API call to Bina... | |
indices are stored with a 32-bit dtype.
.. versionadded:: 0.20
dtype : string, type, list of types or None (default="numeric")
Data type of result. If None, the dtype of the input is preserved.
If "numeric", dtype is preserved unless array.dtype is object.
If dtype is a list of types, conversion on the first typ... | |
# 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... | |
known_toposort)
# add a cyclic dependency, jacket to undershorts
myjob.add_deps(undershorts.id, jacket.id)
# no exceptions raised, but result None
self.assertEqual(myjob.validate('job_1'), None)
def testJobGraphFailing(self):
s = Scheduler(self.db)
myjob = JobGraph(self.db, 'job_1')
fname = 'foo'
# We have a ... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 10 13:31:55 2017
@author: Astrid
"""
import math as m
import pandas as pd
def auto_disc_calc_grid(steps, min_grid, max_grid, detail, stretch_factor):
new_grid = list()
total_width = sum(steps)
ideal_min_width = total_width/(20+2*detail)
# detail == 1 --> stretch = 1... | |
<filename>ultracart/api/order_api.py
# coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 ... | |
<reponame>reepoi/ahj-registry
import csv
import datetime
from django.core.checks import messages
from django.forms import formset_factory
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from django.utils import timezone
from .form import UserResetPasswordForm, UserDelete... | |
volume * 1e-8 * 1e-8 * 1e-8 # in cm^3
rn = (1e0 / volume) * (codata_e2_mc2 * 1e2)
dspacing = bragg_metrictensor(cryst['a'], cryst['b'], cryst['c'], cryst['alpha'], cryst['beta'], cryst['gamma'], HKL=[hh, kk, ll])
dspacing *= 1e-8 # in cm
txt += "# RN = (e^2/(m c^2))/V) [cm^-2], d spacing [cm]\n"
txt += "%e %e \n... | |
**ClusterIdentifier** *(string) --*
The pending or in-progress change of the new identifier for the cluster.
- **PubliclyAccessible** *(boolean) --*
The pending or in-progress change of the ability to connect to the cluster from the public network.
- **EnhancedVpcRouting** *(boolean) --*
An option that specifie... | |
tag1 color was not updated
tag1 = SongTag.objects.get(pk=self.tag1.id)
self.assertNotEqual(tag1.color_hue, 256)
def test_post_song_embedded(self):
"""Test to create a song with nested artists, tags and works."""
# login as manager
self.authenticate(self.manager)
# pre assert the amount of songs
self.assertEqu... | |
# AUTOGENERATED! DO NOT EDIT! File to edit: notebooks_dev/dist.ipynb (unless otherwise specified).
__all__ = ['get_distribution_var_factor_jaccard', 'pointwise_variance',
'estimate_mean_and_variance_from_neighbors_mixture', 'sample_from_neighbors_continuous', 'PointwiseMixture',
'JaccardPointwiseGaussianMixture', 'g... | |
/ approximated_vector3_mag
approximated_vector3_imag = approximated_vector3_imag / approximated_vector3_mag
info.append("PROJECTION 3")
info.append("Will project this vector onto basis " + str(current_basis_index) + ": " + "[" + str(new_sample_real2) + ", " + str(new_sample_imag2) + "]")
info.append("Projection Va... | |
are as follows; see the
documentation for :mod:`sage.algebras.steenrod.steenrod_algebra`
for details on each basis:
- 'milnor': Milnor basis.
- 'serre-cartan' or 'adem' or 'admissible': Serre-Cartan basis.
- 'pst', 'pst_rlex', 'pst_llex', 'pst_deg', 'pst_revz':
various `P^s_t`-bases.
- 'comm', 'comm_rlex', 'com... | |
<reponame>KiDS-WL/Cat_to_Obs_K1000_P1
# ----------------------------------------------------------------
# File Name: Shear_ratio_wspin_test.py
# Author: <NAME> (<EMAIL>)
# Description: short python script to run treecorr to calculate GGL
# for the shear ratio test
# for the covariance we use the spin test
# where the... | |
"/usr/bin/%%", "/usr/sbin/%%", "/bin/%%", "/sbin/%%", "/usr/local/bin/%%",
"/usr/local/sbin/%%", "%%/Downloads/%%"
],
"configuration": [
"/etc/passwd", "/etc/shadow", "/etc/ld.so.conf", "/etc/ld.so.conf.d/%%",
"/etc/pam.d/%%", "/etc/resolv.conf", "/etc/rc%/%%", "/etc/my.cnf", "/etc/hosts",
"/etc/hostname", "/etc/... | |
else:
return visitor.visitChildren(self)
class AtomicLineExpContext(AtomicContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a ShapeExpressionParser.AtomicContext
super().__init__(parser)
self.copyFrom(ctx)
def atomic_line(self):
return self.getTypedRuleContext(ShapeExpressionParser.Atom... | |
0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1],
[1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0],
[1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1... | |
from __future__ import absolute_import
from __future__ import print_function
import sys
import abc
import copy
import logging
import re
from abc import abstractmethod
from collections import OrderedDict
from .dna_reshapers import ReshapeDnaString, ReshapeDna
from .mutators import OneHotSequenceMutator, DNAStringSequen... | |
from datetime import date
from models import gtfs, config, util, nextbus, routeconfig
import argparse
import shapely
import partridge as ptg
import numpy as np
from pathlib import Path
import requests
import json
import boto3
import gzip
import hashlib
import math
import zipfile
# Downloads and parses the GTFS specifi... | |
? AND preregister = 'Y'""",
(tokenrow, block_begins)).fetchone()
if advertisement:
raise TokenError("An existing future advertisement allows preregistration")
# available balance validation and update
balance = self._get_balance(cursor, address)
if units_avail:
if balance < units_avail:
raise TokenError("In... | |
# Geographic geometry utility functions
# I tested geo-py but precision was inferior(?).
# I'd love to user pyturf but it does not have all function I need
# and it loads heavy packages.
# So I made the functions I need.
#
import math
import json
# Geology constants
R = 6371000 # Radius of third rock from the sun, in ... | |
#!/usr/bin/python
# Copyright (c) 2011-2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module that contains unittests for validation_pool module."""
import contextlib
import copy
import functools
import iterto... | |
self.device_type == 'server' or self.phy.device_type \
== 'server'
def is_l3device(self):
"""Layer 3 devices: router, server, cloud, host
ie not switch
"""
return self.is_router() or self.is_server()
def __getitem__(self, key):
"""Get item key"""
return OverlayNode(self.anm, key, self.node_id)
@property
... | |
nev_fname + '.hdf'
if not os.path.isfile(nev_hdf_fname):
# convert .nev file to hdf file using Blackrock's n2h5 utility
subprocess.call(['n2h5', nev_fname, nev_hdf_fname])
else:
nev_hdf_fname = nev_hdf_fname[0]
try:
nev_hdf = h5py.File(nev_hdf_fname, 'r')
open_method = 1
except:
import tables
nev_hdf = ta... | |
not None}
request_kwargs = {
"url": url,
"params": params,
}
# pylint: disable-next=protected-access
with self.client._get_httpx_client() as httpx_client:
response = httpx_client.get(
**request_kwargs,
)
if self.skip_response_parsing:
return response
if response.status_code == 200:
response200 = []
_re... | |
import json
import pickle
import numpy as np
import random
# from fairseq.data import Dictionary
import sys
import torch
import argparse
import os
from model_pretrain import Plain_bert
from fairseq.models.roberta import RobertaModel
# from utils_sample import NewsIterator
# from utils_sample import cal_metric
from fair... | |
<gh_stars>0
# <Copyright 2022, Argo AI, LLC. Released under the MIT license.>
"""Implements a pinhole camera interface."""
from __future__ import annotations
from dataclasses import dataclass
from functools import cached_property
from pathlib import Path
from typing import Tuple, Union
import numpy as np
import av... | |
S, N, D = list(xyz_camXs.size())
assert(D==3)
# occRs_half = __u(utils_vox.voxelize_xyz(__p(xyz_camRs), Z2, Y2, X2))
# utils for packing/unpacking along seq dim
__p = lambda x: pack_seqdim(x, B)
__u = lambda x: unpack_seqdim(x, B)
camRs_T_camXs_ = __p(camRs_T_camXs)
xyz_camXs_ = __p(xyz_camXs)
xyz_camRs_ = u... | |
self.thrift_spec)))
return
oprot.writeStructBegin('TAlterSentryRoleRevokePrivilegeRequest')
if self.protocol_version is not None:
oprot.writeFieldBegin('protocol_version', TType.I32, 1)
oprot.writeI32(self.protocol_version)
oprot.writeFieldEnd()
if self.requestorUserName is not None:
oprot.writeFieldBegin('requ... | |
user = user + user_name
# call to get tasks list
task_list = fgapisrv_db.get_task_list(user, app_id)
db_state = fgapisrv_db.get_state()
if db_state[0] != 0:
# DBError getting TaskList
# Prepare for 402
task_state = 402
task_response = {
"message": db_state[1]
}
else:
# Prepare response
task_response = {}
... | |
<reponame>camponogaraviera/qutip<gh_stars>1000+
import os
import numpy as np
from qutip.interpolate import Cubic_Spline
_cython_path = os.path.dirname(os.path.abspath(__file__)).replace("\\", "/")
_include_string = "'"+_cython_path+"/complex_math.pxi'"
__all__ = ['Codegen']
class Codegen():
"""
Class for generating... | |
from datanator.schema_2 import transform
from datanator_query_python.config import config
import unittest
import numpy as np
class TestTransform(unittest.TestCase):
@classmethod
def setUpClass(cls):
conf = config.SchemaMigration()
cls.des_col = "transformation-test"
cls.src = transform.Transform(MongoDB=conf.SE... | |
current nickname
for long_name in long_names:
short_name = name_dict[long_name]
# If the short_name is already in nicknames_set, that means it is a non-unique nickname
# and we will record that accordingly
if short_name in nicknames_set:
non_unique_nicknames.add(short_name)
# we have not yet seen this nickname
... | |
<reponame>LoganAMorrison/Hazma<gh_stars>1-10
from typing import Generator, Optional, Union
import numpy as np
import numpy.typing as npt
from scipy.special import gamma # type:ignore
# Pion mass in GeV
MPI_GEV = 0.13957018
# Neutral Kaon mass in GeV
MK0_GEV = 0.497611
# Charged Kaon mass in GeV
MKP_GEV = 0.493677
# C... | |
AttributeError as e:
client.debug_print_exception(e)
await message.reply(
client.l(
'must_be_one_of',
client.l('color'),
[i.name for i in fortnitepy.KairosBackgroundColorPreset]
)
)
return
avatar = fortnitepy.Avatar(
asset=message.args[1],
background_colors=background_colors
)
client.set_a... | |
or .. '''
# This is for linux paths only
if dest_rel_path in ('', '/'):
return current_abs_path
# Strip / at start and end of dest
dest_rel_path = dest_rel_path.rstrip('/').lstrip('/')
if current_abs_path[-1] != '/':
current_abs_path += '/'
curr_paths = current_abs_path.rstrip('/').lstrip('/').spl... | |
= destFilename.replace("<site>", self.getSiteID())
#try:
if 1 == 1:
TextFileUtil.makeWritableCopy(source, fileType,
dest, False);
self.output("Made makeWritableCopy: " + source + ' ' + \
fileType + ' ' + dest, self._outFile)
#except:
else:
failed = failed + 1
self.output("failed makeWritableCopy: " + source +... | |
= 0
wind_resist = 0
dexterity = 0
#Set effects
#Ray set
#Conditions: Back, Arms, Legs Boost: 60 DEX
if( (back == "Back / Circuray" or back == "Back / Circunion") and (arms == 'Arms / Circaray' or arms == 'Arms / Circaunion') and (legs == 'Legs / Circuray' or legs == 'Legs / Circunion') ):
dexterit... | |
= expected_obj if hvd.rank() == 0 else {}
obj = hvd.broadcast_object(obj, root_rank=0)
self.assertDictEqual(obj, expected_obj)
def test_allgather_object(self):
hvd.init()
d = {'metric_val_1': hvd.rank()}
if hvd.rank() == 1:
d['metric_val_2'] = 42
results = hvd.allgather_object(d)
expected = [{'metric_val_... | |
import logging
import os
import re
import uuid
from io import BytesIO
from json import load
from pathlib import Path
from random import randint
from time import sleep
from typing import Any, Dict, Generator, List, TYPE_CHECKING, Union
from urllib.parse import urljoin
import httpx
import jsonschema
from httpx import HT... | |
<reponame>miticojo/core
"""Base class for common speaker tasks."""
from __future__ import annotations
import asyncio
from collections.abc import Coroutine
import contextlib
import datetime
from functools import partial
import logging
from typing import Any, Callable
import urllib.parse
import async_timeout
from pyson... | |
import pyeccodes.accessors as _
def load(h):
def wrapped(h):
table2Version = h.get_l('table2Version')
indicatorOfParameter = h.get_l('indicatorOfParameter')
if table2Version == 200 and indicatorOfParameter == 71:
return 'Total Cloud Cover'
if table2Version == 200 and indicatorOfParameter == 65:
return 'Sno... | |
# -*- coding: utf-8 -*-
""" S3 Extensions for gluon.dal.Field, reusable fields
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: 2009-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentat... | |
<filename>noisemaker/generators.py
"""Noise generation interface for Noisemaker"""
from functools import partial
import tensorflow as tf
from noisemaker.constants import (
ColorSpace,
InterpolationType,
OctaveBlending,
ValueDistribution
)
import noisemaker.effects as effects
import noisemaker.oklab as oklab
imp... | |
"fill": "orange", "order": "raise"}
],
"NIMR_serology": [
{"?N":"antigens", "select": {"name": ""}, "label": {"offset": [0, 1], "size": 24, "name_type": "abbreviated_with_passage_type"}, "report": true, "size": 18, "outline": "black", "fill": "orange", "order": "raise"},
{"?N":"antigens", "select": {"name": ""}, "l... | |
<filename>journal_venv/lib/python3.9/site-packages/cartopy/crs.py
# (C) British Crown Copyright 2011 - 2019, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software ... | |
<reponame>cheginit/pydeymet
"""Core class for the Daymet functions."""
import functools
import warnings
from datetime import datetime
from typing import Dict, Iterable, List, Optional, Tuple, TypeVar, Union
import numpy as np
import pandas as pd
import shapely.geometry as sgeom
import xarray as xr
from pydantic import... | |
baud <= 2400:
deviatn = 5100
elif baud <= 38400:
deviatn = 20000 * (old_div((baud-2400),36000))
else:
deviatn = 129000 * (old_div((baud-38400),211600))
self.setMdmDeviatn(deviatn)
def calculatePktChanBW(self, mhz=24, radiocfg=None):
''' calculates the optimal ChanBW setting for the current freq/baud
* totally... | |
# coding=utf-8
# Copyright 2019 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
param[2]
prime = param[5]
fp2 = sidh_fp2.sidh_fp2(prime)
error_computation = False
# Fixed test
tests_already_performed = 0
fixed_tests = [1, prime-1]
for test_value_1 in fixed_tests:
for test_value_1i in fixed_tests:
for test_value_2 in fixed_tests:
for test_value_2i in fixed_tests:
for test_value_3 i... | |
(72, 19, 49, 33),
(38, 57, 64, 33),
(61, 18, 44, 33),
(75, 28, 83, 33),
(46, 54, 80, 33),
(84, 31, 53, 32),
(78, 42, 83, 32),
(66, 32, 38, 32),
(57, 17, 44, 32),
(62, 19, 43, 32),
(83, 38, 48, 32),
(71, 11, 68, 31),
(56, 17, 44, 31),
(72, 18, 49, 31),
(37, 57, 64, 31),
(41, 57, 57, 31),
(72, 20, 47, 31)... | |
c.argument('hide_from_outlook_clients', arg_type=get_three_state_flag(), help='True if the group is not '
'displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; otherwise, '
'false. Default value is false. Returned only on $select.', arg_group='Group')
c.argument('is_subscribed_by_mail', ... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | |
<gh_stars>1-10
'''
Module used for feature extraction of a corpus.
'''
import time
import os
import collections
import argparse
import spacy
import numpy as np
from gensim.models import KeyedVectors
from xml.etree import cElementTree as ET
import pandas as pd
from sklearn.linear_model import LinearRegression
from skle... | |
## dea_datahandling.py
'''
Description: This file contains a set of python functions for handling
Digital Earth Australia data.
License: The code in this notebook is licensed under the Apache License,
Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0). Digital Earth
Australia data is licensed under the Creati... | |
from itertools import chain
import time
import os
import math
from tornado_sqlalchemy import as_future
from tornado.gen import multi
from PIL import Image, ImageDraw, ImageColor, ImageFont
from models import DotaProPlayer, DotaHeroes, DotaItem, DotaProTeam
from image_generation.helpers import draw_text_outl... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | |
= self.cls
p = P(BASE, 'linkB')
paths = set(p.iterdir())
expected = { P(BASE, 'linkB', q) for q in ['fileB', 'linkD'] }
self.assertEqual(paths, expected)
def test_iterdir_nodir(self):
# __iter__ on something that is not a directory
p = self.cls(BASE, 'fileA')
with self.assertRaises(OSError) as cm:
next(p.iter... | |
self.find_node_property(input_key, self.mat_property_dict)
if property_type == "Value":
# Check if Info is a Hex Color
if isinstance(property_info, str):
property_info = self.convert_color(
property_info, shader_node
)
if input_key == "Normal Map: Value":
if isinstance(property_info, list):
property_info = 1
... | |
for bom_meta in allcurrentbommeta:
bom_meta_dict[bom_meta['name']] = bom_meta
bomtablenames = this_database.get_table_names()
new_meta = []
for tablename in bomtablenames:
if tablename == 'metadata':
continue
# Check to see if metadata already exist. We need to maintain activity status and notes
if tablename... | |
get the half width from the peak deflection
return spk_height, spk_width, half_width, deflection_range
if not interp_factor:
from ..analysis.parameters import interp_factor
interp_factor = interp_factor
self.avg_wf = np.nanmean(self.spk_wf, axis=0)
self.wf_ts = np.arange(0, self.avg_wf.shape[0]) / sample_rate[s... | |
= district_data[i][5] # Year of construction
curr_mod_year = district_data[i][
6] # optional (last year of modernization)
curr_th_e_demand = district_data[i][
7] # optional: Final thermal energy demand in kWh
# For residential buildings: Space heating only!
# For non-residential buildings: Space heating AND hot w... | |
an int'
assert type(exclude) == list, 'Excluded cards must be in a list'
assert type(include) == list, 'Included cards must be in a list'
cards = copy.deepcopy(self._stack)
indexes = []
for i in range(len(cards)):
if cards[i] in exclude:
indexes.append(i)
c = 0
for i in indexes:
del cards[i-c... | |
<reponame>unitedstates/inspectors-general<filename>inspectors/peacecorps.py
#!/usr/bin/env python
import datetime
import logging
import os
import urllib
from utils import utils, inspector, admin
# https://www.peacecorps.gov/about/inspector-general/
archive = 1989
# options:
# standard since/year options for a year ... | |
<filename>venv/Lib/site-packages/tobiiresearch/implementation/EyeTracker.py<gh_stars>0
from tobiiresearch.interop import interop
from tobiiresearch.implementation.Errors import _on_error_raise_exception
from tobiiresearch.implementation.EyeImageData import EyeImageData
from tobiiresearch.implementation.ExternalSignalDa... | |
'\n')
f.close()
def print_prop_of_var_to_txt(values, system_name, directory):
"""
Print list of proportions of variance explained by each principal component to a text file.
:param values: array or list, proportions of variance in descending order
:param system_name: name of the system, used for the te... | |
from node.ext.ldap import LDAPNode
from node.ext.ldap import SUBTREE
from node.ext.ldap import testing
from node.ext.ldap.ugm import Group
from node.ext.ldap.ugm import Groups
from node.ext.ldap.ugm import RolesConfig
from node.ext.ldap.ugm import Ugm
from node.ext.ldap.ugm import User
from node.ext.ldap.ugm import Use... | |
without geo referencing
"""
import time, os
from anuga.file.netcdf import NetCDFFile
# Setup
#from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular
# Create basic mesh (20m x 3m)
width = 3
length = 20
t_end = 3
points, vertices, boundary = rectangular(length, width,
length, width)
# C... | |
Space Science
"2041-8213": ["IOP Publishing", "American Astronomical Society"], # The Astrophysical Journal
"0024-6107": ["Oxford University Press (OUP)", "Wiley-Blackwell"], # Journal of the London Mathematical Society
"2169-9313": ["Wiley-Blackwell", "American Geophysical Union (AGU)"], # Journal of Geophysical Re... | |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
... | |
123)) == (addrs.broadcast, 123, *addrs.extra)
# yapf: enable
# But not if it's true (at least on systems where getaddrinfo works
# correctly)
if v6 and not gai_without_v4mapped_is_buggy():
sock.setsockopt(tsocket.IPPROTO_IPV6, tsocket.IPV6_V6ONLY, True)
with pytest.raises(tsocket.gaierror) as excinfo:
await res... | |
from typing import Tuple
import pickle
from highway_env.vehicle.kinematics import Vehicle
from reeds_shepp_curves import reeds_shepp as rs
from reeds_shepp_curves import utils
from PythonRobotics.PathPlanning.RRTStarReedsShepp import rrt_star_reeds_shepp as rrts
import matplotlib.pyplot as plt
import math
from operat... | |
import io
import socket
import struct
import time
from typing import Dict, Iterable, List, Tuple, Union
from . import types
from .util import get_bits, load_domain_name, load_string, pack_domain_name, pack_string
__all__ = [
'REQUEST',
'RESPONSE',
'DNSError',
'Record',
'DNSMessage',
'RData',
'create_rdata',
'... | |
ops.Graph().as_default() as g:
cell_inputs = array_ops.placeholder(
dtype, shape=[seq_length, batch_size, input_size])
if direction == CUDNN_RNN_UNIDIRECTION:
# outputs is one tensor, states are num_layer tuples, each 2 tensors
(outputs, states) = _CreateCudnnCompatibleCanonicalRNN(rnn, cell_inputs)
if rnn_mode =... | |
<gh_stars>100-1000
import os
import pytest
import mbuild as mb
import mbuild.formats.gomc_conf_writer as gomc_control
from mbuild.formats.charmm_writer import Charmm
from mbuild.lattice import load_cif
from mbuild.tests.base_test import BaseTest
from mbuild.utils.io import get_fn, has_foyer
@pytest.mark.skipif(not ... | |
<filename>io_scene_halo/file_wrl/build_scene.py
# ##### BEGIN MIT LICENSE BLOCK #####
#
# 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 r... | |
return w_class, unwrap_cell(space, w_value)
@elidable
def _pure_lookup_where_with_method_cache(w_self, name, version_tag):
space = w_self.space
cache = space.fromcache(MethodCache)
SHIFT2 = r_uint.BITS - space.config.objspace.std.methodcachesizeexp
SHIFT1 = SHIFT2 - 5
version_tag_as_int = current_object_addr_as... | |
<filename>pyons/models/rfid/reader.py
from enum import Enum
import numpy as np
from collections import Iterable
import pyons
from pyons import Entity
from pyons.models.rfid import phy, protocol as gen2, journal, pyradise
class ReaderDescriptor(object):
def __init__(self):
super().__init__()
self.antennas = []
s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.