input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
#!/usr/bin/env python
from unittest import main
from typing import Type
from cli_command_parser import Command, Context
from cli_command_parser.core import get_params
from cli_command_parser.exceptions import (
UsageError,
ParameterDefinitionError,
CommandDefinitionError,
ParamsMissing,
ParamConflict,
)
from cli... | |
from pandac.PandaModules import *
from direct.showbase.DirectObject import DirectObject
import math
import copy
class TexMemWatcher(DirectObject):
"""
This class creates a separate graphics window that displays an
approximation of the current texture memory, showing the textures
that are resident and/or active, an... | |
# main entry point to start training of a single model for target-dependent sentiment analysis in news
# author: <NAME> <<EMAIL>>
# This file is based on https://github.com/songyouwei/ABSA-PyTorch/blob/master/train.py
# original author: songyouwei <<EMAIL>>
import argparse
import math
import os
import random
import s... | |
<gh_stars>1-10
import torch
from torch.autograd import Function
from collections import namedtuple
from pynvrtc.compiler import Program
from cupy.cuda import function
import numpy as np
from cuda.utils import *
from cuda.bigram_rrnn import *
from cuda.bigram_rrnn_semiring import *
from cuda.unigram_rrnn import *
from c... | |
= {}
body_params = None
if 'entity_neighbors_filter' in local_var_params:
body_params = local_var_params['entity_neighbors_filter']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type... | |
= wx.StaticBoxSizer(self.inputMaxDigitsStaticBox, wx.HORIZONTAL)
scollPanelSizer.Add(self.inputMaxDigitsPanel, 0, wx.EXPAND | wx.ALL, 2)
self.labelInputMaxDigits = wx.StaticText(self.scollPanel, -1, "18、实数总位数(max_digits)", size=(STATIC_TEXT_WIDTH, -1), style=wx.ALIGN_CENTRE_HORIZONTAL)
self.inputMaxDigits = wx.Text... | |
Number of times to sample the frame
:param int random_seed:
Seed for the random number generator
:param float ci:
Confidence interval to calculate (mean +/- ci/2.0)
:param Callable func:
Function to calculate the ci around (default: np.mean)
:param int axis:
Which axis to sample over
:returns:
The upper and l... | |
self.stanpAccountLabel.setObjectName("stanpAccountLabel")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.stanpAccountLabel)
self.sendMailLabel = QtWidgets.QLabel(self.formLayoutWidget_5)
self.sendMailLabel.setStyleSheet("color: rgb(255, 255, 255);\n"
"font: 75 12pt \"MS Shell Dlg 2\";")
self.sen... | |
<reponame>almarklein/pywasm<filename>zoof/zf_codegen.py
"""
Code generator for the experimental WIP Zoof lang. It takes the AST produced
by the parser and converts it to WASM.
Tokenization: source code -> tokens
parsing: tokens -> ast-tree
modularize: ast-tree -> Module context with multiple function contexts that ha... | |
return Credentials(user['AccessKeyId'], user['SecretAccessKey'])
def get_deployment_user_credentials(self, deployment_name):
user = self.context.get(test_constant.ATTR_USERS, {}).get(self.get_deployment_user_name(deployment_name))
if not user:
self.create_deployment_user(deployment_name)
user = self.context[test_... | |
sIsYUV = sColorFamily == vs.YUV
sIsGRAY = sColorFamily == vs.GRAY
sIsYCOCG = sColorFamily == vs.YCOCG
if sColorFamily == vs.COMPAT:
raise ValueError(funcName + ': color family *COMPAT* is not supported!')
if not (sIsYUV or sIsYCOCG):
raise ValueError(funcName + ': only YUV or YCoCg color family is allowed!')
#... | |
"""Class for cross-validation over distributions of hyperparameters
-- <NAME> and <NAME>
"""
import logging
from tune_sklearn.utils import check_is_pipeline
from tune_sklearn.tune_basesearch import TuneBaseSearchCV
from tune_sklearn._trainable import _Trainable
from tune_sklearn._trainable import _PipelineTrainable
fr... | |
- bool, optional
If True, will print out more diagnostic messages
dtype - string, optional
Data type for reading variables. Default is 32 bit float.
kelvin - bool (default True)
Whether to load data in Kelvin. (uses eV otherwise)
Examples
--------
>>> a = cross_sect(['h-h-data2.txt','h-h2-data.txt'], fdir="/da... | |
+
(tweet_gap.gap_22 * user_surfacing_tweet_vectors.gap_22) +
(tweet_gap.gap_23 * user_surfacing_tweet_vectors.gap_23) +
(tweet_gap.gap_24 * user_surfacing_tweet_vectors.gap_24) +
(tweet_gap.gap_25 * user_surfacing_tweet_vectors.gap_25) +
(tweet_gap.gap_26 * user_surfacing_tweet_vectors.gap_26) +
(tweet_gap.gap_27... | |
if 'lnn' in params:
path_params['Lnn'] = params['lnn'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Conten... | |
#!/usr/bin/env python3import
import glob
import os
import tempfile
from collections import OrderedDict, defaultdict
from typing import (
Any,
Callable,
Dict,
Iterable,
Iterator,
List,
Set,
Tuple,
Union,
cast,
)
import torch
from captum._utils.av import AV
from captum._utils.common import _get_module_from_na... | |
<filename>reactorcore/services/cache.py
from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
from redis.exceptions import RedisError
from time import time
import collections
import pickle
import logging
import re
from tornado import gen
from tornado import concurrent
from reactorcore.dao.re... | |
hue values from HSV NumPy array as a 1-dimensional array. If output as an int array, the original float
values are multiplied by 360 for their degree equivalents for simplicity. For more information, see
https://en.wikipedia.org/wiki/HSL_and_HSV
Args:
hsv: HSV image as a NumPy array.
output_type: Type of array to ... | |
from __future__ import print_function
import httplib2
import os
import json
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
import pandas as pd
from prospecting.env import (PROJECTNAME,
CREDSDIR,
CLIENT_SECRET_FILE,
DATADIR,
NO... | |
"""Bounding boxes transformation functions."""
from __future__ import division
import copy
import numpy as np
import random
from utils.bbox import bbox_iou
__all__ = ['random_crop_with_constraints', 'crop', 'flip', 'resize', 'translate']
def random_crop_with_constraints(bboxs, size, min_scale=0.3, max_scale=1,
ma... | |
from functools import reduce
import numpy as np
from sparse import SparseTensor
def reduce_prod(seq): return reduce(lambda item_1, item_2: item_1 * item_2, seq)
class Polynomial:
def __init__(self, coeff, indices, merge=True):
"""\\sum_{i=0}^{N-1} coeff[i] \\Pi_{j=0}^{NV-1} x_j^{indices[i, j]}"""
self.degree = n... | |
end = team_sizes[team]
child_perf_vars = perf_vars[start:end]
coeffs = flatten_weights[start:end]
yield SumFactor(team_perf_var, child_perf_vars, coeffs)
def build_team_diff_layer():
for team, team_diff_var in enumerate(team_diff_vars):
yield SumFactor(team_diff_var,
team_perf_vars[team:team + 2], [+1, -1])
def... | |
<reponame>eugenechantk/cs152-harnessing-ai-algorithm
import heapq
import numpy as np
import time
def flatten(board):
# if it's nested lists, flatten them. I do this with list comprehension taking each tile at a time from each sublist
if type(board[1])==list:
board = [item for sublist in board for item in sublist]
... | |
method_map, resource)
def add_sink(self, sink, prefix=r'/'):
"""Registers a sink method for the API.
If no route matches a request, but the path in the requested URI
matches a sink prefix, Falcon will pass control to the
associated sink, regardless of the HTTP method requested.
Using sinks, you can drain and d... | |
<reponame>pulumi/pulumi-alicloud
# 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, Sequenc... | |
of the epoch, reset all metrics.
"""
super().reset()
if self.stream:
self.data.reset()
self.epochDone = False
def share(self):
"""
Share the data.
"""
shared = super().share()
if hasattr(self, 'data'):
shared['data'] = self.data.share()
return shared
def label_candidates(self):
"""
Provide consistent ... | |
m.x35 - m.x36 + 2.7848926778388*m.b559 <= 3.88350496650691)
m.c1448 = Constraint(expr= m.x37 - m.x38 + 2.45503721618572*m.b549 <= 3.55364950485383)
m.c1449 = Constraint(expr= m.x38 - m.x39 + 2.45503721618572*m.b550 <= 3.55364950485383)
m.c1450 = Constraint(expr= m.x39 - m.x40 + 2.45503721618572*m.b551 <= 3.553649504... | |
from models import DCGAN_64_Discriminator, DCGAN_64_Generator, StandardCNN_Discriminator, StandardCNN_Generator, InceptionV3
from torch.utils.data import Dataset as dst
from glob import glob
import torch
import torch.nn as nn
from torch.cuda import FloatTensor as Tensor
from torch import clamp
from torch.autograd impor... | |
#!/usr/bin/env python3
from contextlib import closing
import argparse
import multiprocessing
import os
import os.path
import re
import socket
import subprocess
import sys
import urllib.parse
import urllib3
import bs4
import dulwich.index
import dulwich.objects
import dulwich.pack
import requests
import socks
def pri... | |
= metadata_service_pb2.NameRequest(name=model_name)
response = self.metadata_store_stub.getModelByName(request)
return _unwrap_model_response(response)
def register_model(self, model_name, project_id, model_desc=None) -> ModelMeta:
"""
register a model in metadata store
:param model_name: Name of registered mod... | |
#!/usr/local/bin/python
"""
BSD 2-Clause License:
Copyright (c) 2013, iXSystems Inc.
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 no... | |
STORE_ATTR _original_interaction_target_changed
244_0 COME_FROM 216 '216'
244_1 COME_FROM 210 '210'
244_2 COME_FROM 198 '198'
244_3 COME_FROM 172 '172'
L.1270 244 LOAD_FAST 'moved_social_group'
246_248 POP_JUMP_IF_TRUE 300 'to 300'
250 LOAD_FAST 'derailed_reason'
252 LOAD_GLOBAL MOVING_DERAILS
254 COMPARE_OP ... | |
from array import array
from ctypes import c_uint8, c_float
from .api import api
from .const import *
from .utils import *
from .library import library
from .device import Device
from .oscilloscopechannels import OscilloscopeChannels
from .exceptions import *
class Oscilloscope(Device):
""""""
def __init__(self, h... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# progressbar - Text progress bar library for Python.
# Copyright (c) 2005 <NAME>
#
# This library 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 Foundation; either
# ve... | |
"trust_with_sets": [
{1, 2, 3}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3},
{1, 2, 3}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3}
]
}
]
}
),
(
[
{
"col_names": ["a", "b"],
"stored_with": {1, 2, 3},
"plaintext_sets": [{1, 2, 3}, set()],
"trust_with_sets": [{1, 2, 3}, set()]
}
],
{
"node_order": [Create, Deciles, ... | |
r"""
Factory
This file contains the constructor classes and functions for `p`-adic rings and fields.
AUTHORS:
- <NAME>
TESTS::
sage: R = ZpLC(2)
doctest:...: FutureWarning: This class/method/function is marked as experimental. It, its functionality or its interface might change without a formal deprecation.
See... | |
# ------------------------------------------------------------
# PATCH NOTES
# ------------------------------------------------------------
# The changes in this version are as follows:
# * New grid
# * Don't use trap
# ! If digging on potential trap, nobody must be around this trap
# ! When moving, avoid having 2 robo... | |
LocalGeometryFinder, initializes the list of coordination geometries
:param permutations_safe_override: If set to True, all permutations are tested (very time-consuming for large
coordination numbers!)
:param plane_ordering_override: If set to False, the ordering of the points in the plane is disabled
"""
self.all... | |
(jbev1 - jbev2) >=0
# ineq2 = (jbev1 - jbev3) >=0
# ineq3 = (jbev2 - jbev3) >=0
# #multiplications that are needed several times (this is for
# #optimization purposes)
# multXXY = ineq1*ineq2
# multYXX = ineq2*ineq3
# #get indices for the test cases (c1 for case 1, etc.)
# #(111) -> np.where[1*1*1=1 >0]
#... | |
<gh_stars>1-10
"""
Test distributed simulation.
"""
import cPickle
import glob
import hashlib
import logging
from math import pi
from multiprocessing import AuthenticationError, current_process
from multiprocessing.managers import RemoteError
import os
import shutil
import socket
import sys
import traceback
import uni... | |
<filename>cdp/network.py
# DO NOT EDIT THIS FILE!
#
# This file is generated from the CDP specification. If you need to make
# changes, edit the generator and regenerate all of the modules.
#
# CDP domain: Network
from __future__ import annotations
from cdp.util import event_class, T_JSON_DICT
from dataclasses import ... | |
##########################################################################
#
# Copyright (c) 2020, Cinesite VFX Ltd. 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... | |
mode
newordering = []
newsortcol = None
to_track = (self.prevgroup != "")
for oo in self.ordering:
# oo is from interval [-inf;-1] [1;inf]
# it must be converted to column index, sign remebered and then applied afterwards
sign = oo > 0
oo = oo - 1 if sign else - 1 - oo
rr = GroupTrack.translateorder(to_track, ... | |
<gh_stars>10-100
# Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: Apache License 2.0
'''
Created on Sep 4, 2015
@author: <NAME> (<EMAIL>)
This has examples of creating VS
'''
import argparse
from copy import deepcopy
import json
import math
import requests
from requests.auth import HTTPBasicAuth
from string i... | |
snorkel snorkeled snorkeling snorkels snort snorted snorting
snorts snot snots snotted snotting snout snouted snouting snouts
snowball snowballed snowballing snowballs snowdrift snowdrifts snowed
snowfall snowfalls snowflake snowflakes snowier snowiest snowing
snowplow snowplowed snowplowing snowplows snows snowstorm s... | |
<filename>src/cnstlltn/_cli.py
import ansimarkup
import attrdict
import braceexpand
import click
import fnmatch
import graphviz
import json
import os
import pathlib
import re
import runpy
import shutil
import subprocess
import sys
import tempfile
import threading
import toposort
from . import diffformatter
from .model... | |
self._get_sensorgroup_actions_critical_list()
actions_critical_choices_tuple_list = []
if not actions_critical_choices_list:
ac = SENSORS_AC_NOACTIONSCONFIGURABLE
dv = self._get_display_value(
self.ACTIONS_DISPLAY_CHOICES, ac)
actions_critical_choices_tuple_list.append((ac, dv))
else:
actions_critical_choices_... | |
<gh_stars>0
import sys
import time
MAX_INT = 2 ** 31 - 1
def create_weights_matrix(matrix):
# The original matrix contains 0 for an empty cell and 1 for a walled one. We change them to positive numbers 1
# and 1000 respectively. This allows to calculate shortest paths based on the sum of the weights preferring the... | |
<reponame>stijnstijn/j2lsnek
import datetime
import pathlib
import socket
import json
import time
from helpers.handler import port_handler
from helpers.jj2 import jj2server
from helpers.functions import all_mirrors, query, fetch_all, fetch_one
from helpers.exceptions import ServerUnknownException
class servernet_han... | |
( 5pm PST, 6pm MST,
# 8pm EST ) since the "last" file before then will be an irregular amount
# of time prior: 00:00 UTC - 22:45 UTC = -1 hour 15 minutes
if thisDatetime.hour == 0 and thisDatetime.minute == 0:
lastDatetime = lastDatetime - timedelta(hours = 1)
lastDatetime = (thisDatetime - timedelta(minutes ... | |
<filename>django_comments_xtd/tests/models.py
from datetime import datetime
from django.db import models
from django.db.models import permalink
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.test import TestCase as DjangoTestCase
from django_comment... | |
# coding: utf-8
"""
Copyright 2017 Square, 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 agreed to in w... | |
"""
contents = [(0, 5)]
@schema
class JitterInPlace(dj.Computed):
definition = """
-> MEI
-> ImageConfig
-> JitterConfig
---
jitter_activations: longblob # activation resulting from jitter
"""
def make(self, key):
readout_key = key['readout_key']
neuron_id = key['neuron_id']
print('Jitter analysis: Worki... | |
import os
import re
import time
import json
import pytest
from swsscommon import swsscommon
from dvslib.dvs_common import wait_for_result
class TestRouteBase(object):
def setup_db(self, dvs):
self.pdb = dvs.get_app_db()
self.adb = dvs.get_asic_db()
self.cdb = dvs.get_config_db()
self.sdb = dvs.get_state_db()
d... | |
#!/usr/bin/env python3
"""
Node: Fab tree management.
The Node package provides a tree of FabNode's that roughly corresponds to a FreeCAD tree
as shown in the FreeCAD model view.
There are two public classes defined:
* FabBox:
This is a generic bounding box class similar to the FreeCAD BoundBox class
is used to enc... | |
= 95
elif newPreNum <= 9:
newWidth = 115
elif newPreNum <= 12:
newWidth = 130
else:
newWidth = 155
cmds.channelBox(self.channelBoxID, edit=True, pre=newPreNum, fieldWidth=newWidth)
cmds.deleteUI('setPrecisionNumber')
def hyperbolicSet(self, *args):
hyperbolicCheck = cmds.menuItem('hyperCheckBox', query=True,... | |
[
[217.3, 264.2, 249.4, 296.9, 208.4, 232.0, 288.0, 299.4],
[258.0, 218.9, 205.5, 279.4, 293.8, 260.4, 228.3, 224.0],
[210.6, 217.2, 241.7, 201.7, 215.0, 255.9, 241.0, 240.8],
[256.2, 305.1, 293.5, 253.9, 271.0, 248.8, 206.2, 305.7],
[275.0, 301.1, 284.7, 227.8, 252.3, 231.2, 214.9, 243.8],
],
[
[307.1, 206.8, ... | |
np.mean(beta):
azim = -60
unit = 'Nm'
scale = 1
if np.min(torque) < -9.9e3 or np.max(torque) > 9.9e3:
scale = 1e-3
unit = 'kNm'
if title:
_plot_surface(ax, i1, beta, scale*np.asarray(torque),
(u'I1/A', u'Beta/°', title),
azim=azim)
else:
_plot_surface(ax, i1, beta, scale*np.asarray(torque),
(u'I1/A', u'Bet... | |
"""Controller requesting state from datapath."""
# System imports
from enum import Enum
# Local source tree imports
from pyof.foundation.base import GenericMessage, GenericStruct, IntEnum
from pyof.foundation.basic_types import (
BinaryData, FixedTypeList, Pad, UBInt8, UBInt16, UBInt32, UBInt64)
from pyof.v0x05.comm... | |
"112314": ("Neck Component", [7307, 7308]),
},
"NecroticLipidicPlaque": {
"122395": ("Necrotic-Lipidic Plaque", [3491, 3495, 3497]),
},
"NeedleGauge": {
"111465": ("Needle Gauge", [6095]),
},
"NeedleInTarget": {
"111438": ("Needle in target", []),
},
"NeedleLength": {
"111467": ("Needle Length", [6095]),
}... | |
"""App for calculating the cumulative probability of *r* successes in *n* trials.
Determine the number of trials needed to reach a certain probability threshold
or find the probability at a specified number of trials.
[Streamlit](https://share.streamlit.io/hqn006/streamlit-probability/main/cumulative.py)
[GitHub](htt... | |
"""
<NAME>
Midwater Assessment and Conservation Engineering
NOAA Alaska Fisheries Science Center
<EMAIL>
"""
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from QIVPolygonItem import QIVPolygonItem
from QIVMarkerText import QIVMarkerText
class QIVPolygon(QGraphicsItemGroup):
"""
QIVPolygon implememts open and... | |
import copy
import contextlib
from functools import partialmethod
from contextlib import contextmanager,redirect_stderr,redirect_stdout
from os import devnull
import tqdm
from tqdm.auto import tqdm as tqdm_
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils import check_X_y
from mne.decoding ... | |
#Calc threshold
thr=Num.sqrt(2)*scipy.special.erfinv((1.0-nabove/len(tstmp)))
#Calulate statistics and apply threshold
ts_mean,ts_sig,ts_med=Num.mean(tstmp),Num.std(tstmp),Num.median(tstmp)
ot=Num.where(Num.abs(tstmp-ts_med) < thr*ts_sig)[0]
ot_len=len(ot)
ot_diff=len(tstmp)-ot_len
if Num.round(ts_sig, decimal... | |
in cutsites:
cand_pam = local_seq[local_cutsite + 3 : local_cutsite + 3 + len(pam)]
if lib.match(pam, cand_pam):
num_grnas += 1
return 'PREDICT REPAIR FOR %s gRNAs' % (num_grnas)
@app.callback(
Output('B_submit_button', 'style'),
[Input('B_estimated_runtime', 'children')],
[State('B_submit_button', 'st... | |
{
'name': snapshot_name,
'volume': volume.to_dict()
}
if snapmirror_label:
if print_output:
print("Setting snapmirror label as:"+snapmirror_label)
snapshotDict['snapmirror_label'] = snapmirror_label
# Create snapshot
snapshot = NetAppSnapshot.from_dict(snapshotDict)
snapshot.post(poll=True, poll_timeout=120... | |
import pandas as pd
import numpy as np
import logging
import os
import geojson
import math
import itertools
import geopandas as gpd
from geopy.geocoders import Nominatim
from shapely.geometry import Point, Polygon, MultiPolygon, shape
import shapely.ops
from pyproj import Proj
from bs4 import BeautifulSoup
import ... | |
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint]
)
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
client = mod.ApigatewayClient(c... | |
indcs
else:
return None, None
def get_indices_for_n_batches(self, number_of_batches, batch_size=None):
"""Predetermine the buffer indices for sampling a number of batches.
The buffer indices are returned and can be given to get_batch() to get those specific
experience
Args:
number_of_batches: int, required, n... | |
* m.b114) +
5.56331545204103)**2 + (-m.x715 / (0.0001 + 0.9999 * m.b114) +
1.14993711831163)**2 + (-m.x716 / (0.0001 + 0.9999 * m.b114) +
4.5715891663462)**2 - 1) * (0.0001 + 0.9999 * m.b114) + 0.00842593616666874
* m.b114 <= 0.00842593616666874)
m.e197 = Constraint(expr= ((-m.x717 / (0.0001 + 0.9999 * m.b115) +
3... | |
= easyprof.parse_args(args)
easyp = easyprof.AppArmorEasyProfile(None, self.options)
orig_templates = easyp.get_templates()
args = self.full_args
args.append('--list-templates')
args.append('--include-templates-dir=%s' %
os.path.join(self.test_include_dir, 'templates'))
(self.options, self.args) = easyprof.par... | |
<filename>venv/Lib/site-packages/ObjectListView/OLVPrinter.py<gh_stars>1-10
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: OLVPrinter.py
# Author: <NAME>
# Created: 17 July 2008
# Copyright: (c) 2008 by <NAME>, 2008
# License: wxWindow... | |
#!/usr/bin/python3
"""
Copyright (c) 2015 <NAME> - BVS
"""
import datetime
import light
import usartcomm
SWITCH_STATE_OFF = 0
SWITCH_STATE_ON = 1
SWITCH_STATE_CHANGE = 2
class LightMaster():
"""
Take care off all communication with the slave lights
"""
def __init__(self, id=102):
self.id = id
self.serial... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 21 17:15:22 2020
@author: james.z.hare
"""
import sys, os
sys.path.append(os.path.realpath('..'))
import socket
from _thread import *
import dill as pickle
import src
from src.StateTypes.TeamState import TeamStateClass
from src.Games.TeamCaptureFlagGame import TeamCaptu... | |
"""
Copyright (c) 2019 The Cereja Project
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribu... | |
already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, ... | |
<reponame>sjzhai/Calendar-CIS422
'''
<NAME>, <NAME>, <NAME>, <NAME>
CIS 422
Simple Calendar Application
4/23/18
'''
#It would probably be a good idea to comment out the line of code at the bottom in the exception handler that prints the error details before submitting the assignment. It's pretty much necessary for debu... | |
import glob
import torch
from os import path as osp
import torch.utils.data as data
import utils.utils_video as utils_video
class VideoRecurrentTestDataset(data.Dataset):
"""Video test dataset for recurrent architectures, which takes LR video
frames as input and output corresponding HR video frames. Modified from
... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Tracking particles across the globe with GLobCurrent data and FES data for M2+S2+K1+O1 tidal field
@author: <NAME>
"""
from parcels import Field, FieldSet, ParticleSet, JITParticle, Variable, AdvectionRK4, ErrorCode
from netCDF4 import Dataset
import numpy as np
import math
... | |
<reponame>schubergphilis/cloudstack<gh_stars>1-10
# 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 you under the Apache Licen... | |
<gh_stars>1-10
from gurobipy import GRB, Model, quicksum, tuplelist
from itertools import combinations
# subtour Function gets min(cycle) in TupleList input "edges"
# Original from https://www.gurobi.com/documentation/9.0/examples/tsp_py.html
def subtour(edges):
global houses_per_period
n = houses_per_period
unvisi... | |
required")
params = {
"type": cfr_part,
"fromDate": from_date,
"toDate": to_date,
"page": page,
}
return self._request("GetParts", params)
def get_all_manufacturers(
self, manufacturer_type: str = None, page: int = 1
) -> List[Dict[str, Any]]:
"""Return a list of vPIC manufacturers of the given manufacture... | |
= False
self.sub_task.suspend_time = 0
self.sub_task.suspend_remain_time = 0
self.updateTask()
if self.process is None:
return
try:
if is_debug():
p = psutil.Process(pid=self.process.pid)
p.resume()
return
pos_process = self.get_pos_process()
if pos_process:
pos_process.resume()
except:
pass
@propert... | |
"""
YTArray class.
"""
from __future__ import print_function
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this so... | |
considered slices. In each slice, the currently tracked MOTS is found
after which we move on to the next slice. The MOTS found in the
previous slice is then prepared as reference shape and initial guess
for the current slice.
The number of slices we advance in each step is `initial_stride` until
a MOTS is not fou... | |
self.security_groups,
instance_type=self.instance_type,
tags={"instance": propagated_tags},
placement=random.choice(self.availability_zones),
launch_config=self.launch_config,
)
for instance in reservation.instances:
instance.autoscaling_group = self
self.instance_states.append(
InstanceState(
instance,
prot... | |
# 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... | |
self.session.add(repo)
self.session.commit()
headers = {"Authorization": "token <KEY>"}
output = self.app.post(
"/api/0/test/pull-request/1/merge", headers=headers
)
self.assertEqual(output.status_code, 404)
data = json.loads(output.get_data(as_text=True))
self.assertDictEqual(
data,
{
"error": "Pull-Reque... | |
<reponame>t-sagara/jageocoder
from functools import lru_cache
import logging
import re
from typing import List, Optional, Union
from sqlalchemy import Column, ForeignKey, Integer, Float, String, Text
from sqlalchemy import or_
from sqlalchemy.orm import deferred
from sqlalchemy.orm import backref, relationship
from j... | |
beef
7932: [], # Chicken breast, fat-free, mesquite flavor, sliced
7933: [], # Chicken breast, oven-roasted, fat-free, sliced
7934: ["Kielbasa"], # Kielbasa, Polish, turkey and beef, smoked
7935: [], # Chicken breast, roll, oven-roasted
7936: [], # Bologna, pork and turkey, lite
7937: [], # Bologna, pork, turkey ... | |
"""network:
epanet file: Net3.inp
scenario:
scenario file: Net3.tsg
merlion: false
detection: [1, 2, 3]
scenarios:
-
scenario file: Net3.tsg
merlion: false
detection: [1, 2, 3]
-
scenario file: Net3.tsg
merlion: true
detection: []
nodes: []
impact:
metric: MC
flushing:
flush nodes:
feasible nodes: ALL
i... | |
"""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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... | |
nx.array(fPQ)
Psmooth = fPQ[:,1:4]
Psmooth = nx.array(Psmooth)*to_meters
print 'loaded cached Psmooth from file',results.filename
if Qsmooth is None and not do_smooth_quats:
Qsmooth = QuatSeq( [ cgtypes.quat( q_wxyz ) for q_wxyz in fPQ[:,4:] ])
print 'loaded cached Qsmooth from file',results.filename
print 'Psmo... | |
#!/usr/bin/python
# Copyright 2016 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 appl... | |
House', 'Lumberjack House'),
('Hyrule Castle Secret Entrance Drop', 'Hyrule Castle Secret Entrance'),
('Hyrule Castle Secret Entrance Stairs', 'Hyrule Castle Secret Entrance'),
('Hyrule Castle Secret Entrance Exit', 'Light World'),
('Bonk Fairy (Light)', 'Bonk Fairy (Light)'),
('Lake Hylia Fairy', 'Lake Hylia Heal... | |
<gh_stars>0
import functools
import math
import sys
class Point(object):
def __init__(self, x=None, y=None):
if x is not None:
self.x = float(x)
else:
self.x = None
if y is not None:
self.y = float(y)
else:
self.y = None
def __str__(self):
return '(' + str(self.x) + ', ' + str(self.y) + ')'
def __bool__... | |
The interaction modules contain
:param args: command line arguments, with which to identify the type of interaction module
:return: the label identifying the interaction module (can be an enum)
"""
if not hasattr(args, 'pooling_type') or args.pooling_type is None or not args.pooling_type or \
args.pooling_type.low... | |
= 1
HSM = 2
EXTERNAL = 3
ciphertext = _messages.BytesField(1)
ciphertextCrc32c = _messages.IntegerField(2)
name = _messages.StringField(3)
protectionLevel = _messages.EnumField('ProtectionLevelValueValuesEnum', 4)
verifiedAdditionalAuthenticatedDataCrc32c = _messages.BooleanField(5)
verifiedPlaintextCrc32c = _... | |
<reponame>willbr/uxn
# https://wiki.xxiivv.com/site/varvara.html
# https://wiki.xxiivv.com/site/uxntal.html
# https://wiki.xxiivv.com/site/uxntal_cheatsheet.html
# https://wiki.xxiivv.com/site/uxntal_reference.html
# https://wiki.xxiivv.com/site/uxntal_stacking.html
# https://wiki.xxiivv.com/site/uxntal_macros.html
f... | |
<reponame>sighill/shade_app
# -*- coding: utf-8 -*-
# voca.py
# Python 3.4.3
# Django 1.9
# Script rassemblant des fonctions python3 pour modifier les fichiers
# des dossiers ###_raw
#####################################################################
# README !
# Les fonctions suivantes sont là pour être ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.