input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
Peppermint Pattie
19092: [], # Candies, TWIZZLERS NIBS CHERRY BITS
19093: [], # Candies, SYMPHONY Milk Chocolate Bar
19094: [], # Desserts, flan, caramel custard, prepared-from-recipe
19095: ["Vanilla ice cream"], # Ice creams, vanilla
19096: [], # Ice creams, vanilla, light, soft-serve
19097: [], # Sherbet, oran... | |
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json'])
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json'])
# Authenticat... | |
maya.OpenMaya as OpenMaya
fpsDict = {}
_bases = {"game": (15.0, 'kGames'), # 5
"film": (24.0, 'kFilm'), # 6
"pal": (25.0, 'kPALFrame'), # 7
"ntsc": (30.0, 'kNTSCFrame'), # 8
"show": (48.0, 'kShowScan'), # 9
"palf": (50.0, 'kPALField'), # 10
"ntscf": (60.0, 'kNTSCField'), # 11
"2fps": (2.0, 'k2FPS'), # 12
"3f... | |
python list to D list
print " te"+str(teCounter)+".pathRight = [\"b.subject\"];"
print " te"+str(teCounter)+".checkedString = \"" + comparedCompoundType + "\";"
print " te"+str(teCounter-1)+".children ~= te"+str(teCounter)+";"
print " "
teCounter+=1
if isinstance(premiseB, tuple) and not isPlaceholder(premise... | |
import copy
import time
from PIL import Image
spot_width = 100
spot_height = 100
spots_left_coords = []
spots_top_coords = []
black_pieces_on_black_tiles = []
white_pieces_on_black_tiles = []
black_pieces_on_white_tiles = []
white_pieces_on_white_tiles = []
black_tile_tmp = None
zero2seven = [0, 1, 2, 3... | |
#
# Spec2Vec
#
# Copyright 2019 Netherlands eScience Center
#
# 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 la... | |
# ### Stochlite Pybullet Environment
# Last Update by <NAME> (May, 2021)
import numpy as np
import gym
from gym import spaces
import envs.environments.stoch_env.trajectory_generator as trajectory_generator
import math
import random
from collections import deque
import pybullet
import envs.environments.stoch_env.bullet... | |
<reponame>dcartman/pygame-menu<filename>test/test_widget_textinput.py
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
TEST WIDGET - TEXTINPUT
Test TextInput and ColorInput widgets.
"""
__all__ = ['TextInputWidgetTest']
from test._utils import MenuUtils, surface, PygameEventUtils, TEST_THEME, PYGAME_V2, \
B... | |
arg):
try: value = float(arg)
except: value = None
if self.__get_windowLength() != value:
self._needsUpdate = True
self.obj.setWindowLength(value)
windowLength = property(__get_windowLength, __set_windowLength)
# package: QualityControl
class base_outage(object):
def __init__(self, obj):
self.obj = obj
self.... | |
= frappe.db.get_list('Quotation', filters={'party_name': name}, fields=['name'])
#opportunity_name = frappe.db.get_list('Opportunity', filters={'party_name': name}, fields=['name'])
#sales_order_name = frappe.db.get_list('Sales Order', filters={'customer': name}, fields=['name'])
#delivery_note_name = frappe.db.get_... | |
else:
# Left edge but neither of the two left corners
#print("Left edge")
lo = Point(2)
lo.vals[0] = rect.lo.vals[0]
lo.vals[1] = other.hi.vals[1]+1
to_add.append(Rect(lo,rect.hi))
hi = Point(2)
hi.vals[0] = rect.hi.vals[0]
hi.vals[1] = other.lo.vals[1]-1
to_add.append(Rect(rect.lo,hi))
# Check to see if we ... | |
self.registerNatlinkPyd(silent=1)
return result # None if something went wrong 1 if all OK
def removeNatlinkPyd(self):
"""remove the natlink.pyd file (Dragon should be switched off)
in order to redo the copyNatlinkPydPythonVersion again
"""
if not self.isElevated: raise ElevationError("needed for removing y... | |
from z3 import *
from consts import METRICS_MAXIMIZE, METRICS_MINIMIZE
FeatureIndexMap = {}
FeatureVariable = []
FeatureIndexMap['eShop'] = 0
eShop = Bool('eShop')
FeatureVariable.append(eShop)
FeatureIndexMap['eShop'] = 1
eShop = Bool('eShop')
FeatureVariable.append(eShop)
FeatureIndexMap['store_front'] ... | |
'''
Takes some from twoobject_to_oneobject.py, but that thing was getting too long.
Jerk prediction models.
'''
import explicit_future_prediction_base as fp_base
import tensorflow as tf
from curiosity.models.model_building_blocks import ConvNetwithBypasses
import numpy as np
import cPickle
def deconv_loop(input_node,... | |
= cwt.encode(
{
"iss": "coaps://as.example",
"sub": "dajiaji",
"cti": "123",
"cnf": {
"jwk": {
"kty": "OKP",
"use": "sig",
"crv": "Ed25519",
"kid": "01",
"x": "<KEY>",
"alg": "EdDSA",
},
},
},
private_key,
)
# presenter:
msg = b"could-you-sign-this-message?" # Provided by recipient.
pop_key_private... | |
This is usually retrieved from a previous list call.
:param str opc_request_id: (optional)
The client request ID for tracing.
:param obj retry_strategy: (optional)
A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the ... | |
# coding: utf-8
import math
import cairo
import numpy
from shapely.geometry import Point, LineString, Polygon, box
from mapython import projection
from mapython import utils
class Map(object):
'''
Creates drawable map object which can be rendered.
:param fobj: a filename or writable file object
:param bbox: ite... | |
1.1.1.1'
publickeyfile = get_ssh_pub_key()
if publickeyfile is not None:
publickeyfile = open(publickeyfile).read().rstrip()
if not keys:
keys = [publickeyfile]
else:
keys.append(publickeyfile)
keys = '\n'.join(keys)
host_name = "%s.%s" % (name, domain) if domain is not None else name
initialization = types.I... | |
Read chunks already present in a PNG image
reader = png.Reader(filename=image_path)
chunks = list(reader.chunks())
# Insert custom framerate chunk
chunks.insert(1, (FPS_CHUNK_CODE, struct.pack("f", framerate)))
# Write it into the image
with open(image_path, 'wb') as image_file:
png.write_chunks(image_file, chu... | |
editor.StyleSetForeground() for style 4\n'
'called editor.StyleSetItalic() for style 4\n'
'called editor.StyleSetForeground() for style 5\n'
'called editor.StyleSetItalic() for style 5\n'
'called editor.StyleSetForeground() for style 6\n'
'called editor.StyleSetBold() for style 6\n'
'called editor.StyleSetForegro... | |
<reponame>ceridwen/combinators
'''Parser combinators for Python 2, based on the grammar in the Python
documentation. Call the parse method of single_input, file_input, and
eval_input.'''
import argparse
import pprint
import token
import tokenize
import types
import continuation_gll_combinators as combinators
class ... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ### ###... | |
import logging
logger = logging.getLogger(__name__)
from models import Session, Card, CardDetail, Stack
from models import CARD_KIND_WEAPON, CARD_KIND_POTION, CARD_KIND_MONSTER, CARD_KIND_SCRAP, CARD_KIND_TREASURE
import random
HEALTH_CAPACITY = 20
REQUIRED_TURNS_BEFORE_SKIPPING = 5
ROOM_CAPACITY = 5
TREASURE_CAP... | |
<gh_stars>1-10
"""
To set up the OpenShift driver you need
* a workin OpenShift instance
* a user in the OpenShift instance (a separate machine to machine account is
recommended)
1. Start by adding the url, username, password and subdomain in the creds
file. names are "OSO_XXX_URL", where XXX is the name of your ins... | |
(556, True),
(557, False),
(558, False),
(559, False),
(560, True),
(561, False),
(562, False),
(563, False),
(564, True),
(565, False),
(566, False),
(567, False),
(568, True),
(569, False),
(570, False),
(571, False),
(572, True),
(573, False),
(574, False),
(575, False),
(576, True),
(577, False... | |
"""Learn ideal points with the text-based ideal point model (TBIP).
Let y_{dv} denote the counts of word v in document d. Let x_d refer to the
ideal point of the author of document d. Then we model:
theta, beta ~ Gamma(alpha, alpha)
x, eta ~ N(0, 1)
y_{dv} ~ Pois(sum_k theta_dk beta_kv exp(x_d * eta_kv).
We perform... | |
result_out = economics.json() if importance is None else self.__importance("economics", economics.json(),
importance)
return result_out
def guidance(self, page=None, pagesize=None, date_asof=None, date_from=None, date_to=None,
company_tickers=None, importance=None, date_sort=None, updated_params=None, country=None... | |
hist.target_number = ca.target_number
hist.target_completed = ca.target_completed
hist.updated_date = datetime.now()
hist.save()
ca.time_interval = ProjectTimeInterval.objects.get(id=int(check[1]))
ca.interval_updated = True
if longitude != '':
ca.location = Point(
round(float(longitude), 6),
round(float(ca.l... | |
" "
rval = f"\n {space*current_indent}/* INVOKE generated for {kernel_name} */\n"
if kernel_type == kernels.perpart_kernel_wrapper:
rval = rval + self.gen_invoke_perpart(kernel_name, current_indent, indent, kernel_type)
else:
raise NotImplementedError("gen_invoke not yet implemented")
rval = rval + f"{space*curre... | |
<gh_stars>1-10
## ASYMMETRON ###
import itertools
import numpy as np
import warnings
from scipy.stats import binom_test
try:
from pybedtools import BedTool
except:
print("Pybedtools not imported")
try:
import visualizations
except:
print("visualizations not imported")
def pairs_generator(pathL1, pathL2, NamesL1,... | |
<filename>demo_quantize_methods.py<gh_stars>0
import timeit
from collections import Counter
from typing import Callable, Tuple, Optional, Union, List, Type
from PIL import Image
import cv2
import numpy as np
import scipy.cluster
from sklearn.cluster import KMeans, MeanShift, MiniBatchKMeans
import sklearn.utils
# imp... | |
"""
Original source: https://github.com/dmyersturnbull/tyrannosaurus
Copyright 2020–2021 <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 https://www.apache.org/licenses/LICENSE-2.0
Command-li... | |
<gh_stars>1-10
###
# Copyright (c) 2002-2005 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of cond... | |
IP Network" + Fore.LIGHTBLUE_EX + " >>>"+Fore.WHITE+" ", oktet_1_ipaddress,
oktet_2_ipaddress, oktet_3_ipaddress, ip_network + blok_subnet)
print(Fore.LIGHTGREEN_EX + " IP Pertama" + Fore.LIGHTBLUE_EX + " >>>"+Fore.WHITE+" ", oktet_1_ipaddress,
oktet_2_ipaddress, oktet_3_ipaddress, ip_network + blok_subnet + 1)
... | |
<reponame>SorooshMani-NOAA/pyschism
from abc import ABC
from collections import defaultdict
from functools import lru_cache
import hashlib
import logging
from itertools import permutations
import os
import pathlib
import tempfile
from typing import Union, Sequence, Hashable, List, Dict
import geopandas as gpd
from mat... | |
import collections
import functools
import os
import pickle
from typing import (Callable, Dict, Hashable, List, NamedTuple, Optional,
Sequence, Union)
import numpy as np
from stable_baselines.common.base_class import BaseRLModel
from stable_baselines.common.policies import BasePolicy
from stable_baselines.common.vec_... | |
coming to your house"""
member = member or ctx.author
await ctx.trigger_typing()
parameters = {
"avatar" : str(member.avatar_url_as(format="png", size=1024))
}
session = self.acquire_session()
async with session.get(f'https://some-random-api.ml/canvas/lolice', params=parameters) as resp:
imageData... | |
import logging
import time
from datetime import datetime as dt
import pytz
from colorfield.fields import ColorField
from django.contrib.auth.models import Group
from django.contrib.gis.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from django.urls import reverse
from django.u... | |
<reponame>idax4325/veropt
import torch
import gpytorch
import botorch
import math
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import os
from typing import List, Tuple
class ExactGPModel(gpytorch.models.ExactGP):
def __init__(self, train_x, train_y, likelihood, n_params):
super(Exact... | |
<reponame>andrewgolman/Linguistic-Self-Attention-for-SRL
import tensorflow as tf
import nn_utils
import tensorflow.keras.layers as L
from base_fns import FunctionDispatcher
from tensorflow_addons.text.crf import crf_decode, crf_log_likelihood, viterbi_decode
from opennmt.utils.misc import shape_list
from opennmt.layers... | |
# -*- coding: utf-8 -*-
__module_name__ = "EasyXdcc"
__module_version__ = "1.3"
__module_description__ = "Xdcc Queues"
__module_author__ = "<NAME> <<EMAIL>>"
__module_contributor__ = "Ultrabenosaurus <https://github.com/Ultrabenosaurus/EasyXdcc>"
import xchat, os, time, pprint, platform
class t_bot:
def __init__(self... | |
403
_strings['wind'] = 404
_strings['dew point'] = 405
_strings['humidity'] = 406
_strings['defaults'] = 409
_strings['accessing weather service'] = 410
_strings['getting weather for:'] = 411
_strings['unable to get weather data'] = 412
_strings['manual'] = 413
_strings['no review for this album'] = 414
_strings['downl... | |
clic en este botón para descargar el archivo de configuración genererado con el botón 'Generar Configuración' (una vez este haya notificado su ejecución). Se descargará un archivo .JSON que se alojarán en la carpeta <i>cno_solar/configurations/<span style='color:blue'>system_config.json</span></i>. El ícono y la descri... | |
<reponame>a-palchikov/z3c.rml
##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany ... | |
self.assertEqual(expected_formats_result, formats_result)
class TestCheckAssetUriItemsExpectedInWebpage(TestCase):
def test_check_asset_uri_items_expected_in_webpage_returns_success(self):
uri_items_in_html = [
"asset_uri_1.jpg",
"asset_uri_2.jpg",
"/j/xyz/a/lokiujyht?format=html&lang=en",
"/j/xyz/a/lokiujyht?... | |
from __future__ import annotations
import pandas as pd
import numpy as np
from typing import List, Dict, Union, TYPE_CHECKING
from whyqd.base import BaseSchemaAction
if TYPE_CHECKING:
from ..models import ColumnModel, ModifierModel, FieldModel, CategoryModel, CategoryActionModel
class Action(BaseSchemaAction):
""... | |
import hashlib
import io
import os
import shutil
import tempfile
import time
from pathlib import Path
from runez.system import _R, abort, Anchored, decode, flattened, resolved_path, short, SYMBOLIC_TMP, SYS_INFO, UNSET
def basename(path, extension_marker=os.extsep, follow=False):
"""Base name of given `path`, ignor... | |
<reponame>AustralianDisabilityLimited/MultiversePlatform<gh_stars>10-100
#
# The Multiverse Platform is made available under the MIT License.
#
# Copyright (c) 2012 The Multiverse Foundation
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation... | |
# -*- coding: utf-8 -*-
# AUTHOR: <NAME>
# DATE: 19-9-19
import logging
import os
import torch.optim as optim
import torch.distributed as dist
from itertools import product
from .dee_helper import logger, DEEExample, DEEExampleLoader, DEEFeatureConverter, \
convert_dee_features_to_dataset, prepare_doc_batch_dict, me... | |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Provides a non-parametric two-stage least squares instrumental variable estimator."""
import numpy as np
from copy import deepcopy
from sklearn import clone
from sklearn.linear_model import LinearRegression
from ...utilit... | |
<gh_stars>10-100
import math
import torch
import treetensor.torch as ttorch
from .base import choose_mark
# noinspection DuplicatedCode,PyUnresolvedReferences
class TestTorchFuncsMath:
@choose_mark()
def test_abs(self):
t1 = ttorch.abs(ttorch.tensor([12, 0, -3]))
assert isinstance(t1, torch.Tensor)
assert (t1 ... | |
self.runRestore(configItem, type, endpoint, app, name, user, restoreAsUser, adminLevel, objExists)
found = True
foundAtAnyScope = True
#We never found the config we wanted to restore
if found == False:
logger.info("i=\"%s\" user=%s, name=%s not found at scope=global in typeFile=%s" % (self.stanzaName, user, name, ... | |
assoc.is_established
msg = (
r"No exact matching context found for 'Unified Procedure Step "
r"- Push SOP Class', checking accepted contexts for other UPS "
r"SOP classes"
)
ds = Dataset()
ds.TransactionUID = '1.2.3.4'
with caplog.at_level(logging.DEBUG, logger='pynetdicom'):
responses = assoc.send_c_find(ds,... | |
<gh_stars>0
import gym
from enum import Enum, IntEnum
import numpy as np
import os
from datetime import datetime
import time
import copy
from typing import List
from utilities import tensor_from
import torch
import random
import sys
import math
if sys.platform == 'win32':
import imageio
import pyglet... | |
"""Client to access DICOM Part10 files through a layer of abstraction."""
import collections
import io
import logging
import math
import os
import re
import sqlite3
import sys
import time
import traceback
from collections import OrderedDict
from enum import Enum
from pathlib import Path
from typing import (
Any,
Dict... | |
import addrmodes
# TODO: Verificar se nao existem enderecamentos maiores que 1 byte
def rel_addr(value):
if value & 0b10000000:
value &= 0b1111111
value -= 128
return value
def advancePC(cpu, size):
cpu.registers['PC'] += size
def setN(cpu, value):
if value & (1 << 7) == 1 << 7:
cpu.setStatus(cpu.statusFl... | |
# Refer to the following link for PyQt documentation:
# http://pyqt.sourceforge.net/Docs/PyQt4/classes.html
# Written for AMIS-30543 driver.
'''
At an RPM of 60 and an input of 200 steps in mode 1/1, takes motor 1 second to complete task
At an RPM of 120 and an input of 200 steps in mode 1/2, takes motor 1 second to c... | |
1
"""
left_corner = ((self[1][0], self[0][0]), 'L')
for s in self.separatrix_diagram(side=True):
if left_corner in s:
return len(s)//2 - 1
def attached_in_degree(self):
r"""
Returns the degree of the singularity at the right of the interval.
OUTPUT:
-- a positive integer
EXAMPLES::
sage: p1 = iet.Perm... | |
"source": "Twitter Web App",
"videos": 0,
"photos": 0,
"gifs": 0,
"fetch_date": datetime.strptime("2000-01-01 23:59:59", DATE_TIME_FORMAT)
}),
Status.parse(api=None, json={
"id": 1,
"user_id": 1,
"created_at": datetime.strptime("2000-01-01 00:00:00", DATE_TIME_FORMAT).strftime(
TWITTER_DATE_TIME_FORMAT),
"te... | |
<filename>src/kanapy/cli.py
# -*- coding: utf-8 -*-
import os, sys
import shutil, json
import click
from kanapy.util import ROOT_DIR, MAIN_DIR
from kanapy.input_output import particleStatGenerator, particleCreator, RVEcreator, \
write_position_weights, write_output_stat, plot_output_stats, \
extract_volume_sharedGB... | |
THREAD STOPPED ")
return
def process_cmd(line):
"""
Process CAPI commands and send through socket if necessary
Parameters
----------
line : str
CAPI command followed by parameters with "," as delimiter
Returns
-------
none
Examples
--------
process_cmd(ca_get_version)
process_cmd(sniffer_control_filter... | |
""" Standalone webinterface for Openstack Swift. """
# -*- coding: utf-8 -*-
import os, random
import time
import urlparse
import hmac, ast
import traceback
from hashlib import sha1
from keystoneauth1.identity import v3
from keystoneauth1 import session
from swiftclient import client
from django.shortcuts import rende... | |
<gh_stars>100-1000
import struct
import os
from .base import FirmwareObject, RawObject, BaseObject, AutoRawObject
from .uefi import FirmwareVolume
from .utils import print_error, dump_data, sguid, green, blue
PFS_GUIDS = {
"FIRMWARE_VOLUMES": "7ec6c2b0-3fe3-42a0-a316-22dd0517c1e8",
"INTEL_ME": "7439ed9e-70d3-4b65-... | |
exclude: any
A value to exclude from the filtered pks to save to the temporary key
args: list
Any other argument to be passed by a subclass will be passed as addition
args to the script.
"""
self.model.database.call_script(
# be sure to use the script dict at the class level
# to avoid registering it many time... | |
<filename>Welcomer 6.20/modules/core.py<gh_stars>10-100
import asyncio
import copy
import csv
import io
import math
from math import inf
import os
import sys
import time
import traceback
import logging
from importlib import reload
from datetime import datetime
import logging
import aiohttp
import discord
import reques... | |
<reponame>frochet/torps
### Classes implementing "network modification" interface, i.e. modify_network_state() ###
from stem import Flag
from stem.exit_policy import ExitPolicy
import pathsim
class Enum(tuple): __getattr__ = tuple.index
### Class inserting adversary relays ###
class AdversaryInsertion(object):
de... | |
# File: vxstream_connector.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
# Phantom imports
import phantom.app as phantom
from phantom.base_connector import BaseConnector
from phantom.action_result import ActionResult
try:
from phantom.vault import Vault
except:
import phanto... | |
* oO0o % O0 % OoO0O00
if 70 - 70: o0oOOo0O0Ooo + O0 % I1IiiI
oo0o = struct . unpack ( "B" , packet [ 7 : 8 ] ) [ 0 ]
if ( oo0o == 0 ) :
dprint ( "IPv6 packet arrived with hop-limit 0, packet discarded" )
return ( None )
elif ( oo0o == 1 ) :
dprint ( "IPv6 packet {}, packet discarded" . format ( bold ( "ttl expir... | |
# <NAME>
# This module provides classical simulations of basic quantum algorithms (once you write them).
# In numpy, I think that the default complex dtype varies from platform to platform. If you want to explicitly use the default type in your code, use one.dtype (where one is defined just below).
import random
imp... | |
i+1 < len(node.jointnames):
code += ', '
else:
code += ';\n'
code += 'int numsolutions = 0;\n'
code += 'for(int i%s = 0; i%s < numroots; i%s += %d)\n{\n'%(firstname,firstname,firstname,len(node.jointnames))
fcode = 'IkReal '
for i in range(len(node.exportvar)):
fcode += '%s = zeror[i%s+%d]'%(node.exportvar[i],f... | |
Variable(source))
labels = to_gpu(args.cuda, Variable(torch.zeros(source.size(0)).fill_(whichclass-1)))
# Train
code = autoencoder(0, source, lengths, noise=False, encode_only=True).detach()
scores = classifier(code[:,nhidden_irr:]) if rel else classifier(code[:,:nhidden_irr])
classify_loss = F.binary_cross_entr... | |
#!/usr/bin/python
# -*- coding: utf-8
import unittest
import os
import tempfile
from TestBase import *
from gp.client import *
TestGraphName = 'test' + str(os.getpid())
TestFilePrefix = '/tmp/gptest-' + str(os.getpid())
class ServerTest (ClientTestBase, unittest.TestCase):
"""Test server functions via client lib."... | |
element with a list
if isinstance(estimates, np.ndarray) and len(estimates.shape)==1:
# XXX ??? so we are going away from inplace modifications?
estimates = list(estimates)
rangev = None
for i in xrange(len(estimates)):
v = estimates[i]
if np.isscalar(v):
if Nlabels == 1:
# ensure the right dimensionality
est... | |
name)
self.m_event_dispatcher.fire_event(_event)
def notify_namespace(self):
"""
Notify that a namespace update query should be done.
"""
_event = CEventNamespace()
self.m_event_dispatcher.fire_event(_event)
def get_state(self):
return self.m_state_manager.get_state()
def verify_broken(self):
if sel... | |
`keyvalue`. Only the first such occurrence is
removed."""
packet_coord = list(self[keyname]).index(keyvalue)
loopnames = self.GetLoopNames(keyname)
for dataname in loopnames:
self.block[dataname][0] = list(self.block[dataname][0])
del self.block[dataname][0][packet_coord]
self.block[dataname][1] = list(self.bloc... | |
import copy
import gc
import numpy
from numpy.linalg import LinAlgError
import joblib
import pandas
import psutil
import pygmo
from scipy.optimize import minimize
from scipy.optimize import differential_evolution
import time
from typing import Dict, List, Tuple
import warnings
from .constants import Cons... | |
np.array_equal(observed, np.fliplr(np.flipud(image)))
def test_randomness__two_flips(self):
# 50% horizontal flip, 50% vertical flip
aug = iaa.Sequential([
iaa.Fliplr(0.5),
iaa.Flipud(0.5)
])
frac_same = self._test_randomness__two_flips__compute_fraction_same(
aug, 200)
assert np.isclose(frac_same, 0.25, rto... | |
<filename>main.py
import os
from typing import Optional, Tuple, List, Type
import numpy as np
from cv2 import cvtColor, COLOR_BGR2GRAY, imshow, waitKey, imread, ORB_create, ORB, KeyPoint, drawMarker, MARKER_CROSS, \
COLOR_GRAY2BGR, BFMatcher, NORM_HAMMING, DMatch, drawMatches, \
Rodrigues, resize, INTER_AREA, solvePn... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2018, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | |
Soft Blue": 0xACE1F0,
"Atoll": 0x2B797A,
"Atoll Sand": 0xFFCF9E,
"Atom Blue": 0x8F9CAC,
"Atomic": 0x3D4B52,
"Atomic Lime": 0xB9FF03,
"Atomic Pink": 0xFB7EFD,
"Atomic Tangerine": 0xFF9966,
"Atrium White": 0xF1EEE4,
"Attar of Rose": 0x994240,
"Attica": 0xA1BCA9,
"Attitude": 0xA48884,
"Attitude Gray": 0x7C7D75... | |
import os
import time
import numpy as np
import scipy as sci
import scipy.misc
import pykep as pk
from hodographicShaping_SI import hodographicShaping
from integration import integrate
from shapingFunctions import shapeFunctions
from shapingFunctions import shapeFunctionsFree
from patchedTrajectoryUtils import *
from ... | |
<filename>04_ML_approach_part2.py
###############################################################################
# #
# machine learning approach part 2 #
# neural networks #
# June 23 2020 #
###############################################################################
### Loading libraries ################... | |
<reponame>minakhoshbazm/CodART<gh_stars>0
# Generated from Java9.g4 by ANTLR 4.8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2x")
buf.write("\u04a4\b\1\4\2\t\2\4\3\t\... | |
<gh_stars>1-10
#------------------------------------------------------------------------------
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2013 <NAME> <<EMAIL>>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and c... | |
<reponame>MichaelDylan77/PrintTags
# -*- coding: utf-8 -*-
from datetime import datetime
from .colors import Colors
from typing import List, Tuple, TextIO, Optional, Callable, Any
def _get_datetime() -> str:
return datetime.now().strftime('%d-%b-%Y %I:%M:%S%p')
def _print_with_color(args: Tuple[Any, ...], color... | |
import re
import pandas as pd
import numpy as np
import time
import constants
import pickle
# Cleansing
def cleanse(text):
"""
Clean up the text a little by removing punctuation, extra spaces, new lines, etc.
This should be run after split_to_sentences(), tokenize_by_sentence() because I think it removes all the
... | |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | |
<filename>examples/models/image_classification/PyPandaVgg_SelectiveNet.py
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to ... | |
2.2.10.",
"GitHubIssues": [],
},
"2": {
"Description": [
"Description line 1 of release 2.2.2",
"Description line 2 of release 2.2.2",
],
"Title": "Release 2.2.2.",
"GitHubIssues": [],
},
"9": {
"Description": [
"Description line 1 of release 2.2.9",
"Description line 2 of release 2.2.9",
],
"Title": "R... | |
##------------------------------------------------------------------------.
# Retrieve colormap and colorbar args
cmap_params, cbar_kwargs = _process_cmap_cbar_kwargs(xr_contour,
masked_arr.data,
**locals(),
_is_facetgrid=kwargs.pop("_is_facetgrid", False))
##---------------------------------------------------... | |
"""Integer optimization of livestock and water services."""
import os
import sys
import shutil
from osgeo import gdal
import re
import pandas
import numpy as np
import pygeoprocessing.geoprocessing
import marginal_value as mv
def integer_optim_Peru(objective_list, suf):
"""Calculate optimal intervention portfolio ... | |
"""show_vxlan.py
NXOS parser for the following show commands:
* show nve peers
* show nve interface <nve> detail
* show nve ethernet-segment
* show nve vni
* show nve vni summary
* show nve multisite dci-links
* show nve multisite fabric-links
* show l2route fl all
* show l2route evpn ethernet-segment all
* ... | |
#!/usr/bin/python3
"""
Module for querying weather forecast data from OpenWeatherMap and storage in database
"""
import json
import requests
import datetime
# Set up logging
import logging
import logging_plus
logger = logging_plus.getLogger(__name__)
logger.addHandler(logging.NullHandler())
# Defaults
# Current / hou... | |
object.
Fields:
filter: The standard list filter.
name: The name of the operation collection.
pageSize: The standard list page size.
pageToken: The standard list page token.
"""
filter = _messages.StringField(1)
name = _messages.StringField(2, required=True)
pageSize = _messages.IntegerField(3, variant=_mess... | |
<filename>src/reducer/bohm_test.py
import itertools
import hypothesis
import hypothesis.strategies as s
import pytest
from pomagma.reducer import bohm
from pomagma.reducer.bohm import (CB, CI, KI, B, C, I, K, S, Y, app, false,
is_linear, is_normal, join, polish_simplify,
print_tiny, sexpr_simplify, true,
try_decid... | |
<reponame>sergey-lebedev/concor<filename>bots/greedy_bot.py
from algorithms import *
import copy
DEBUG = False
inf = float("infinity")
def branch_generator(game_state, adjacency_list, owner, alpha, beta, is_final):
pruning = False
# branch init
branch = {}
branch['nodes'] = []
# data gathering from game state
pl... | |
self._GetService( service_key )
return service.GetName()
def GetService( self, service_key ):
with self._lock:
return self._GetService( service_key )
def GetServiceType( self, service_key ):
with self._lock:
return self._GetService( service_key ).GetServiceType()
def GetServiceKeyFro... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | |
<filename>katcp/test/test_kattypes.py
# test_kattypes.py
# -*- coding: utf8 -*-
# vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4
# Copyright 2009 SKA South Africa (http://ska.ac.za/)
# BSD license - see COPYING for details
"""Tests for the kattypes module.
"""
import unittest2 as unittest
import mock
from katcp import ... | |
<reponame>VladimirZubavlenko/ikaf42-app
import logging
from django.core.mail import send_mail
from django.db.models import Max
from django.http import HttpResponse
from minio.error import (ResponseError)
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from rest_framework.respon... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.