input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
O0o00oOOOO00 . unpack_address ( packet )
if ( packet == None ) : return ( [ None , None ] )
if 84 - 84: I1IiiI . I1IiiI
return ( [ packet , O0o00oOOOO00 ] )
if 82 - 82: OoO0O00 - iIii1I11I1II1 . iIii1I11I1II1 + I1ii11iIi11i
if 45 - 45: iII111i . oO0o * iII111i
def lcaf_decode_eid ( self , packet ) :
O00oO00oOO00... | |
self.count += 1
class PLTIntermittentPlotter(AccumulatedValuePlotter):
# Class/Static variables.
def __init__(self, saveDir, name, av, avNameList, dispTypeList = None, semiLog = False):
super(PLTIntermittentPlotter, self).__init__(name, av, avNameList, dispTypeList)
self.count = 0
self.minPlotPoints = 2
self.s... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""\
"""
import select
import socket
import sys
import errno
import random
import time
import os
import logging
import guild
from guild.actor import *
debug = False
for actor_class_name in ["Selector", "TCPServer", "RawConnectionHandler","EchoServer"]:
logger = logging.ge... | |
_(u'邮箱容量'), _(u'网盘容量'),
_(u'排序权重'), _(u'QQ号码'), _(u'出生日期'), _(u'密码')]]
name = 'mailbox-list_{}'.format(time.strftime('%Y%m%d%H%M%S'))
lists = get_mailbox_list(request)
all_data_size = {}
all_data_user = {}
all_data_position = {}
all_data_depts = {}
all_data_depts2 = {}
all_data_depts_parent = {}
# 不预先把所有值取出来... | |
db.session.commit()
continue
for page in response:
url = page['url'] if 'url' in page.keys() else None
uniq_visitors = page['nb_uniq_visitors'] if 'nb_uniq_visitors' in page.keys() else None
page_summary = MatomoDailyGetPageUrlsSummary()
page_summary.date = date
page_summary.url = url
page_summary.label = page... | |
#!/usr/bin/env python
"""
ftguess.py
ftguess is a Python module to determine the type of a file based on its contents.
It can be used as a Python library or a command-line tool.
Usage: ftguess <file>
ftguess is part of the python-oletools package:
http://www.decalage.info/python/oletools
"""
#=== LICENSE ==========... | |
<filename>multidomain_visual_ssl/main.py
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from pathlib import Path
import argparse
import json
import math
import os
import ... | |
<gh_stars>0
# Copyright 2009 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 applicable ... | |
<gh_stars>0
"""
Here the implementation of the OLD peeler.
It was used for tridesclous<=1.2.2
This is implementation is kept for comparison reason.
In some situtaion this peeler engine was making some mistake.
It was a bit faster.
Please do not use it anymore
"""
import time
import numpy as np
from .peeler_engine_... | |
<reponame>Smear-Lab/Olfactory_Search
#Misc
import os, time, argparse
import h5py, json
import glob, fnmatch,pdb
from tqdm import tqdm
import multiprocessing
#Base
import numpy as np
import pandas as pd
import scipy.stats as st
from sklearn.model_selection import StratifiedKFold
#Plotting
import matplotlib
matplotlib.us... | |
np.sort(self.Z,axis=None).reshape([self.M,1])
self.Z = self.Z.reshape([self.Z.shape[0],1])
# Run the selected test and get likelihoods for all genes
def run_test(self,lik_name,models_number,genes_index,branching = False):
genes_results = {}
genes_state = {}
self.Y = self.Y_copy
self.models_number = models_n... | |
(isinstance(v, six.string_types) and len(v.strip()) == 0):
raise ValueError('Parameter {} cannot be None, whitespace or empty string'.format(k))
header_params = {
"accept": "application/json",
"content-type": "application/json",
"if-match": kwargs.get("if_match", missing),
"opc-request-id": kwargs.get("opc_reque... | |
<reponame>dagmartin/ldpush<gh_stars>1-10
#!/usr/bin/python
#
# Copyright 2014 Google 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
#
# Un... | |
not in self.config.latex_elements):
# use Sonny style if any language specified (except English)
self.elements['fncychap'] = ('\\usepackage[Sonny]{fncychap}\n'
'\\ChNameVar{\\Large\\normalfont'
'\\sffamily}\n\\ChTitleVar{\\Large'
'\\normalfont\\sffamily}')
self.babel = self.builder.babel
if self.config.language... | |
class NurbsCurve(Curve,IDisposable,ISerializable,IEpsilonComparable[NurbsCurve]):
"""
Represents a Non Uniform Rational B-Splines (NURBS) curve.
NurbsCurve(other: NurbsCurve)
NurbsCurve(degree: int,pointCount: int)
NurbsCurve(dimension: int,rational: bool,order: int,pointCount: int)
"""
def Con... | |
import asyncio
import datetime
import unittest
import unittest.mock
from unittest.mock import Mock
from typing import Optional, List
import shc.base
from shc import timer, base, datatypes
from ._helper import ClockMock, async_test, ExampleSubscribable, AsyncMock, ExampleWritable, ExampleReadable
class LogarithmicSle... | |
make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_snapshot_snapshots(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str type: Only list snapshots matching this type.
:param str schedule: Only list snapshots created by this schedule.
:return: None
If t... | |
# license: Copyright (C) 2018 NVIDIA Corporation. All rights reserved.
# Licensed under the CC BY-NC-SA 4.0 license
# (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
# this code simulate the approximate motion required
# all time unit are picoseconds (1 picosec = 1e-12 sec)
import sys
sys.path.insert(0... | |
<gh_stars>10-100
"""
Example for classification on Cifar10 [1]
.. code-block:: python
[1] <NAME>.
Learning Multiple Layers of Features from Tiny Images.
2009.
**Note: the LMDBs can also be found in the data repository, see README.**
Use ``caffe/data/cifar10/get_cifar10.sh`` to download Cifar10 and
``caffe/examp... | |
<reponame>KOLANICH-libs/websockets
"""
:mod:`websockets.client` defines the WebSocket client APIs.
"""
import asyncio
import collections.abc
import functools
import logging
import warnings
from types import TracebackType
from typing import Any, Generator, List, Optional, Sequence, Tuple, Type, cast
from .exceptions ... | |
self.speed_calc_cycles = speed_calc_cycles
self.keep_new_result_in_memory = keep_new_result_in_memory
# final result as list, other types can be achieved by subclassing
self.final_result = []
# NOTE: it only works using multiprocessing.Queue()
# the Queue class from the module queue does NOT work
self.mana... | |
<filename>Backgammon.py
import numpy as np
import matplotlib.pyplot as plt
# Using this guy's BG board implementation, to learn
# https://github.com/weekend37/Backgammon/blob/master/Backgammon.py
# Then going to build my own computer AI , or alter game slightly
def init_board():
# initializes the game board
#-numb... | |
"""
Tests for collaboration.
This includes tests for shares, and uses the API provided by genesets. Ultimately it might be good
to extract each of the API components into their respective reusable modules.
"""
from django.contrib.auth.models import User
from django.test import TestCase
from fixtureless import Factory... | |
or AS#3.)
indexAndAsNumber: all|a list of indexes with as# -> [[1, 100], [3, 300], ...]
Example:
protocolObj.configBgpAsPathSegmentListNumber(routerid='192.168.127.12', 3, [[0,28], [3,298],
[4, 828]])
Requirements:
getDeviceGroupByRouterId()
getMultivalues()
configMultivalues()
"""
deviceGroupObj = self.get... | |
'''
pass
def draw_preset(self, _context):
'''
'''
pass
def driver_add(self):
'''
'''
pass
def driver_remove(self):
'''
'''
pass
def get(self):
'''
'''
pass
def is_extended(self):
'''
'''
pass
def is_property_hidden(self):
'''
'''
pass
def is_property_overridable_library(self... | |
# coding: utf-8
import numpy as np
import random
import tensorflow as tf
import logging
import imageio
import read_data
# from data_generator import DataGenerator
from origin_mil_pick import MIL
# from evaluation.eval_reach import evaluate_vision_reach
# from evaluation.eval_push import evaluate_push
from tensorflow.p... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Spectrum energy bin grouping.
There are three classes:
* SpectrumEnergyGroup - one group
* SpectrumEnergyGroups - one grouping, i.e. collection of groups
* SpectrumEnergyGroupMaker - algorithms to compute groupings.
Algorithms to compute groupings ar... | |
<reponame>Takishima/mindquantum<filename>mindquantum/simulator/simulator.py
# -*- coding: utf-8 -*-
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License ... | |
# Sample Code For Assignment #3
# Printing Formatted Data in Python
# Copyright (C) 2021 <NAME>
# MIT Open Source Initiative Approved License
# hw_assignment_3.py
# CIS-135 Python
# Resources:
# https://www.w3schools.com/python/ref_string_format.asp
# https://www.w3schools.com/python/python_string_formattin... | |
import os, sys, pickle
import requests
import random
import time
import operator
import math
import progressbar
import numpy as np
import pandas as pd
import multiprocessing as mp
import difflib
import matplotlib.pyplot as plt
import inspect
from decimal import Decimal
from rdkit import Chem, DataStructs, RDConfig
from... | |
# --
# Copyright (c) 2008-2021 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
# --
"""The XHTML renderer
This renderer only depends on the ``nagare.renderers.xml`` module.
Having... | |
<filename>horizomer/benchmark/reformat_input.py<gh_stars>1-10
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2015--, The Horizomer Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LIC... | |
#
# Copyright 2019 The FATE Authors. 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 law ... | |
and $0^{\circ}$ (p-value < 0.025)."
sw.append_new_tag(ps_1_1, "OriginalTestsPassedAndNormalAngleSummary", tex_tag_file_name)
ps_1_2 = "To test whether trial-to-trial excitability fluctuations also modulate the remaining " + str(num_tests_not_passed) + " non-stationary Stage 2 clusters, "
sw.append... | |
<filename>pincer/commands.py
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
import logging
import re
from asyncio import iscoroutinefunction, gather
from copy import deepcopy
from inspect import Signature, isasyncgenfunction
from ty... | |
.5*( np.cumsum(u, axis = 1) + np.cumsum(v, axis = 0) )
# Caculate stramelines function
def _streamlines(u, v):
return .5*( np.cumsum(u, axis = 0) - np.cumsum(v, axis = 1) )
# Calculate vorticity approximating hte veloctiy gradient by numerical diffenciation
def _vorticity(u, v):
return np.gradient(u)[1] - np.gradie... | |
flops: %.3f G, params: %.3f M' % (flops / 1000 / 1000 / 1000, params / 1000 / 1000))
@classmethod
def demo_mscale(cls):
from thop import profile
'''
320 : flops: 15.5 G, params: 0.2 M
160 : flops: 3.9 G, params: 0.2 M
80 : flops: 1.0 G, params: 0.2 M
40 : flops: 0.2 G, params: 0.2 M
20 : flops: 0.1 G, params:... | |
utc_fake)
self.convert_between_tz_and_utc(Pacific, utc_fake)
# The next is really dancing near the edge. It works because
# Pacific and Eastern are far enough apart that their "problem
# hours" don't overlap.
self.convert_between_tz_and_utc(Eastern, Pacific)
self.convert_between_tz_and_utc(Pacific, Eastern)... | |
= {'type': key, 'parsed_data': value}
handle[len(handle):] = [handleitem]
handle_json = simplejson.dumps(handle)
self._debugmsg('modifyHandle', "JSON: " + str(handle_json))
response, _ = self.http.request(uri, method='PUT', headers=hdrs,
body=handle_json)
output = self._checkresponsecode("modifyHandle", respons... | |
import matplotlib.pyplot as plt
import numpy as np
from numpy import cross, eye
from scipy.linalg import expm, norm
import pandas as pd
from scipy.spatial.transform import Rotation as R
from pyts.decomposition import SingularSpectrumAnalysis
def modeshape_sync_lstsq(mode_shape_vec):
"""
Creates a straight line fit ... | |
cmake-optional">[</span>')
elif self.output_format == "latex":
self._output(r"\sphinxoptional{")
else:
self._output("[")
def depart_desc_cmake_optional(self, node):
"""Depart function for :cls:`desc_cmake_optional`."""
del self._param_seperator_stack[-1]
if self.output_format == "html":
self._output('<... | |
# -----------------------------------------------------------
# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.
# Nvidia Source Code License-NC
# Code written by <NAME>.
# -----------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from ... | |
- 18: iII111i * I11i - Ii1I
if 31 - 31: Oo0Ooo - O0 % OoOoOO00 % oO0o
if 45 - 45: I1ii11iIi11i + II111iiii * i11iIiiIii
if 13 - 13: OoooooooOO * oO0o - Ii1I / OOooOOo + I11i + IiII
O0OO0O = IIi11I1 . find ( "password=" )
if ( O0OO0O == - 1 ) : return ( False )
if 39 - 39: iIii1I11I1II1 - OoooooooOO
if 81 - 81: I... | |
(341, 'L', 'K'), (342, 'F', 'A'), (343, 'S', 'E'), (344, 'K', 'L'), (345, 'A', 'H'), (346, 'E', 'M'), (347, 'L', 'S'), (348, 'H', 'T'), (349, 'M', 'L'), (350, 'S', 'N'), (351, 'T', 'L'), (352, 'L', 'I'), (353, 'N', 'M'), (354, 'L', 'I'), (355, 'I', 'S'), (356, 'M', 'V'), (357, 'I', 'L'), (358, 'S', 'T')]
"""
output... | |
<gh_stars>0
from models import Entry
from models import User
from models import Project
from models import Vendor
from models import Objective
from models import EvaluationCriteria
from models import DEFAULT_PROJECT_NAME
from models import project_db_key
from functools import wraps
import json
import time
import datet... | |
<reponame>timgates42/bpython
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import contextlib
import errno
import greenlet
import logging
import os
import re
import signal
import subprocess
import sys
import tempfile
import threading
import time
import unicodedata
from six.moves import range
from pyg... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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 agr... | |
<gh_stars>0
#! /usr/bin/env python3
import random
import time
class Remote:
_remote_type_alias_map = {
'fut089': 'rgbcct'
}
_remote_type_parameters_map = {
'rgbw': {
'retries': 10,
'delay': 0.1,
'channels': [9, 40, 71],
'syncword': [0x258B, 0x147A],
'zones': [1, 2, 3, 4],
'features': [
'c... | |
# tt4 = 'O2_ORR_DW16_data_PDX_Ch1'
# 'N2_20cls_300_100_10_DW28_898'
self.EC_run_slice = self.EC_run_slice.loc[
self.EC_run_slice.basename.str.contains(tt4)
]
self.EC_run_slice = self.EC_run_slice.loc[
self.EC_run_slice.PAR_file.isin(ttpfs)
]
# EC_run_slice = EC_run_slice.iloc[-10:-7]
if "ORR" in self.... | |
from flask import Flask, render_template, request, session, redirect, url_for, flash, jsonify, g, json
from flask_babel import Babel
from flask_uploads import UploadSet, IMAGES, configure_uploads
from flaskext.mysql import MySQL
from werkzeug import generate_password_hash, check_password_hash
from datetime import datet... | |
side='right') - 1
monthtime = startyear - self._yearday_splits[startmonth_idx]
# fix up the leapyears with a different yearday split table
leapmask = (year % 4) == 0
startmonth_idx_leap = self._yearday_splits_leap.searchsorted(startyear[leapmask], side='right') - 1
monthtime[leapmask] = startyear[leapmask] ... | |
<gh_stars>1-10
# -*- coding:utf-8 -*-
"""
* Copyright@2016 Jingtum Inc. or its affiliates.
*
* 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-... | |
"D", "exdir_E")])
#----------------------------------------------------------------------
def update_lose_external(sbox):
"update to lose an external module"
external_url_for = externals_test_setup(sbox)
wc_dir = sbox.wc_dir
other_wc_dir = sbox.add_wc_path('other')
repo_url = sbox.repo_url
# Checkout two wor... | |
from __future__ import absolute_import
from compas_fab.backends.ros.messages.geometry_msgs import Point
from compas_fab.backends.ros.messages.geometry_msgs import Pose
from compas_fab.backends.ros.messages.geometry_msgs import PoseStamped
from compas_fab.backends.ros.messages.geometry_msgs import Quaternion
from compa... | |
<reponame>michaeldeistler/sbibm-1
"""
Module containing data structures for representing datasets.
"""
from __future__ import division, print_function
from builtins import object, range
from future.utils import with_metaclass
from past.utils import old_div
__author__ = "wittawat"
from abc import ABCMeta, abstractme... | |
<filename>vfo/internal_plotting_functions.py
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import matplotlib.pyplot as plt
import vfo.internal_database_functions as idbf
ele_style = {'color':'black', 'linewidth':1, 'linestyle':'-'} # elements
ele_l... | |
i_key = self._instance_key(instance)
now = time.time()
return now - self.cache_times[i_key][entity][LAST] > self.cache_times[i_key][entity][INTERVAL]
def _get_server_instance(self, instance):
i_key = self._instance_key(instance)
service_check_tags = [
'vcenter_server:{0}'.format(instance.get('name')),
'vcenter... | |
<reponame>BrunoKM/station-b-libraries
# -------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# --------------------------------... | |
lower is not None:
lower_names = [param_name + '__lower'
for param_name in self._get_tokeniser_names()]
params_dict = self._add_to_params_dict(params_dict, lower_names, lower)
if C is not None:
params_dict = self._add_to_params_dict(params_dict, ['svm__C'], C)
if random_state is not None:
params_dict = self._add... | |
0, 0, 0, 0],
[1264, 41.970665, 0, 9999, -9999, 1.0, 100, 1, 82.035361, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1265, 2.779034, 0, 9999, -9999, 1.0, 100, 1, 6.654727, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1266, 49.700969, 0, 9999, -9999, 1.0, 100, 1, 119.710849, 0.0, 0, 0, 0, 0, 0, ... | |
``set`` of key usage flags, as :py:obj:`~constants.KeyFlags`.
This keyword is ignored for non-self-certifications.
:type usage: ``set``
:keyword ciphers: A list of preferred symmetric ciphers, as :py:obj:`~constants.SymmetricKeyAlgorithm`.
This keyword is ignored for non-self-certifications.
:type ciphers: ``list`... | |
<filename>mistertrade/exchanges/apis/bittrex.py
import time
import math
import requests
import datetime
import logging
import hmac
import hashlib
try:
from urllib.parse import urlparse, urlencode
except ImportError:
from urllib import urlencode
from urlparse import urlparse
import json
from decimal impo... | |
<reponame>smallmedia/iod-ckan
import json
from nose import tools as nosetools
import ckan.plugins.toolkit as toolkit
try:
import ckan.tests.factories as factories
except ImportError: # for ckan <= 2.3
import ckan.new_tests.factories as factories
try:
import ckan.tests.helpers as helpers
except ImportError: # for c... | |
<filename>resume/views.py
import logging
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import resolve, reverse_lazy
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.translation import ugettext_lazy as _
from django.views.... | |
weightsdir=config["paths"]["weights_dir"],
overwrite=True,
spcdb_dir=spcdb_dir,
)
# --------------------------------------------------------------
# GCHP vs GCC column AOD plots: Seasonal
# --------------------------------------------------------------
for t in range(bmk_n_months):
print("\nCreating plots for ... | |
is not None:
self.at_union_ids = m.get('atUnionIds')
if m.get('receiverMobiles') is not None:
self.receiver_mobiles = m.get('receiverMobiles')
if m.get('receiverDingtalkIds') is not None:
self.receiver_dingtalk_ids = m.get('receiverDingtalkIds')
if m.get('receiverUnionIds') is not None:
self.receiver_union_ids =... | |
#!/usr/bin/env/python
# -*- coding: utf-8 -*-
"""
This script defines some useful functions to use in data analysis and visualization
@ <NAME> (<EMAIL>)
"""
def dl_ia_utils_change_directory(path):
"""
path ='path/to/app/'
"""
import os
new_path = os.path.dirname(os.path.dirname(__file__))
new_path = os.chdir... | |
stg - STG_COMPRESSED)
for d in range(bla_dim):
M_bla_new[new_index + d * new_len] = M_bla[index, d]
r_bla_new[new_index] = r_bla[index]
print("BLA tree compressed with coeff:", k_comp)
return M_bla_new, r_bla_new, new_len
@numba.njit
def BLA_index(i, stg):
"""
Return the indices in BVA table for this iteration... | |
"""
Multilayer Perceptron
"""
__authors__ = "<NAME>"
__copyright__ = "Copyright 2012-2013, Universite de Montreal"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import logging
import math
import operator
import sys
import warnings
import numpy as np
from theano.compat imp... | |
pass
if len(tweet_text) > 116:
try:
tweet_text = 'A {d} {n} will be {p} until {e}.'.format(
d=self.description, n=self.name,
p=place_string, e=self.expire_time)
except AttributeError:
tweet_text = (
"A {d} {n} appeared {p}! It'll expire between {e1} & {e2}."
).format(d=self.description, n=self.name, p=place_s... | |
deepspeed must be called on every step regardless of the value of gradient_accumulation_steps
if self.deepspeed:
self.deepspeed.step()
if (step + 1) % self.args.gradient_accumulation_steps == 0 or (
# last step in epoch but step is always smaller than gradient_accumulation_steps
steps_in_epoch <= self.args.gradie... | |
the player a chance of getting a powerup or score
if self.hp <= 0:
self.kill()
player.score += 2
# A 5% chance of the player getting HP powerup
if random.random() > 0.95:
hpPowerup = hpPow(self.rect.centerx, self.rect.bottom)
all_sprites.add(hpPowerup)
hpPowerups.add(hpPowerup)
# A 15% chance of the player ... | |
<reponame>uguryagmur/RealTimeObjectDetection<gh_stars>0
"""Utility functions for Object Detection Networks"""
from __future__ import division
import cv2
import torch
import numpy as np
from PIL import Image, ImageDraw
def xyxy2xywh(box: torch.Tensor) -> torch.Tensor:
"""
Returns the xywh format of the input boundi... | |
when an entity is created.
indexed (bool): Indicates if the value should be indexed.
repeated (bool): Indicates if this property is repeated, i.e. contains
multiple values.
required (bool): Indicates if this property is required on the given
model type.
default (~datetime.datetime): The default value for this pro... | |
int),
('FULL ELECTROSTATIC EVALUATION FREQUENCY', 'fullElectFrequency', 1,
int),
('RANDOM NUMBER SEED', 'seed', 1, int),
# Langevin dynamics
('LANGEVIN DYNAMICS ACTIVE', 'langevin', -1, True),
('LANGEVIN TEMPERATURE', 'langevinTemp', 1, float),
('LANGEVIN DAMPING COEFFICIENT IS', 'langevinDamping', 1, float),
(... | |
"""
Monkey patching for pandas
"""
import copy
import os
import pathlib
import sklearn.pipeline
from mlinspect.to_sql.py_to_sql_mapping import TableInfo, OpTree, sql_obj_prefix
from mlinspect.to_sql.py_to_sql_mapping import OpTree, ColumnTransformerInfo, ColumnTransformerLevel
from mlinspect.backends._pandas_backend i... | |
# <NAME> (<EMAIL>)
from __future__ import absolute_import, division, print_function
from builtins import range
import numpy as np
import pandas as pd
import scipy.stats as ss
from joblib import Memory
from mlpaper.constants import METHOD, METRIC
from mlpaper.mlpaper import PAIRWISE_DEFAULT, loss_summary_table
MOMEN... | |
from ai_ct_scans import data_loading
import torch
from ai_ct_scans import models
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
from cv2 import blur
from ai_ct_scans import phase_correlation_image_processing
from ai_ct_scans.data_writing import ndarray_to_memmap
plt.ion()
if torch.cuda.is_av... | |
0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1],
[1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, ... | |
in group.keys(): # Not looking for attr keys here (Potentially 'none' stored in attr, but that's not helpful here)
# tfit_group = group.get('tfit_info')
# assert isinstance(tfit_group, h5py.Group)
# fits = list()
# for k in ['v0_0', 'vp', 'v0_1', 'vm']:
# fit_group = tfit_group.get(k, None)
# if fit_group is not None:
... | |
<reponame>JeshuaT/PsyNeuLink<gh_stars>10-100
# Princeton University licenses this file to You 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 ... | |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os
import copy
import numpy as np
from scipy import linalg
from .fiff.constants import FIFF
from .fiff.tag import find_tag
from .fiff.tree import dir_tree_find
from .fiff.proj import read_proj
from .fiff.channels import _read_bad_channe... | |
<filename>day7/day7.py
input = """
xsddbi (61)
nqtowev (11)
xwohr (82)
flejt (36)
idwpug (54)
uoxzkp (51)
choeijs (54)
gmsjkn (65)
txszqu (687) -> mvjqmad, lwqlyjq, jlgnsu
zhlfdac (15)
htouwcr (74)
vlbsr (56)
titbn (9)
bvrpb (86)
wuwjp (54)
umnqkb (160) -> nbrvl, bcmbao, vfimqtl
uwnml (29)
cdvhmy (42)
xghhu (306) -> mo... | |
import copy
import time
import re
from datetime import timedelta
from gi.repository import Gio, Gtk
from zope.interface import Interface
from mxdc import Object, Signal, IBeamline, Property
from mxdc import Registry
from mxdc.conf import load_cache, save_cache
from mxdc.engines.automation import Automator
from mxdc.e... | |
from .mcmcposteriorsamplernorm import fit
from scipy.stats import norm
import pandas as pd
import numpy as np
import pickle as pk
from sklearn.cluster import KMeans
from ..shared_functions import *
class mcmcsamplernorm:
"""
Class for the mcmc sampler of the deconvolution gaussian model
"""
def __init__(self, K=1... | |
1
self.curSubTableIndex = subtableIndex
handler = self.classHandlers.get( (lookup.LookupType, subtable.Format), None)
if handler:
handler(subtable, self)
classNameLists = self.classesByNameList.keys()
classNameLists.sort()
for nameList in classNameLists:
classRecList = self.classesByNameList[... | |
<gh_stars>0
import os
import glob
import re
import sys # access system routines, including writing console output to file
import math
import scipy
import numpy as np
import matplotlib.pyplot as plt
import Common
import Plotting
# Make plots of the results obtained for the design of the DBR grating for the CORNERSTON... | |
<filename>mapping_v2.py
from utils.dict_utils import *
import logging
log = logging.getLogger(__name__)
class V2Mapping:
"""
See documentation/VDUMapping.md
Mapping is strictly {DataLocationPath : LocationToPlaceDataPath}
Which should almost always be {TOSCAPath : SOL6Path}
"""
KEY_TOSCA = "dict_tosca"
KEY_S... | |
(1 + w * 1j * t_values[20]))
+ (R_values[21] / (1 + w * 1j * t_values[21]))
+ (R_values[22] / (1 + w * 1j * t_values[22]))
+ (R_values[23] / (1 + w * 1j * t_values[23]))
+ (R_values[24] / (1 + w * 1j * t_values[24]))
+ (R_values[25] / (1 + w * 1j * t_values[25]))
+ (R_values[26] / (1 + w * 1j * t_values[26]))
+ ... | |
supported, but check or reset analyze/power_spectrum/type' %(spec_type))
exit()
else:
log_info('Input error: no type, please set analyze/power_spectrum/type')
exit()
if ( 'traj_vel_file' in spectrum_dic.keys() ):
traj_vel_file = spectrum_dic['traj_vel_file']
if ( os.path.exists(os.path.abspath(traj_vel_file)) )... | |
# ------------------------------------------------------------------------------
# BSD 2-Clause License
#
# Copyright (c) 2019, <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:
#
... | |
#! /usr/bin/env python
"""
Full-frame PCA algorithm for ADI, ADI+RDI and ADI+mSDI (IFS data) cubes.
"""
from __future__ import division, print_function
__author__ = '<NAME>'
__all__ = ['pca']
import numpy as np
from multiprocessing import cpu_count
from .svd import svd_wrapper
from ..preproc.derotation import _find... | |
<filename>ridt/equation/eddy_diffusion.py
import warnings
import numpy
from typing import List
from typing import Tuple
from typing import Union
from itertools import product
from tqdm import tqdm
from numpy import ndarray
from numpy import array
from numpy import zeros
from numpy import exp
from numpy import log... | |
high requires "
"full CPU reservation"
)
self.logger.info("Reserving CPU for VM {0}".format(vm_obj.name))
tasks.append(
ConfigVM(vm_obj).cpu_reservation(host_cpu_mhz, reser=1)
)
if tasks:
GetWait().wait_for_tasks(
tasks, task_name="Configure memory/CPU reservation"
)
def _get_latency_task(self, vm_cfg):
""... | |
<filename>fabricator/fabricator.py
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from .__version__ import __version__
import functools
import json
import re
from builtins import *
import requests
import six
from future.utils import raise_from
from requests.auth import AuthBase... | |
schema name.
database: a :obj:`streamsets.testframework.environment.Database` object.
"""
if isinstance(database, OracleDatabase):
database.engine.execute('CREATE USER {user} IDENTIFIED BY {pwd}'.format(user=schema_name, pwd=schema_name))
database.engine.execute('GRANT UNLIMITED TABLESPACE TO {user}'.format(user=... | |
import os
import sqlite3
import traceback
from sqlite3 import Error
from F_Experiments_Helper.run_instance import RunInstance
from a_Common.constants import *
DB_FILE = r"__disertation_experiments\karypy_runs.db"
# metadata columns
ID_COLUMN_NAME = "id"
START_TIME_COLUMN_NAME = "start_time"
END_TIME_COLUMN_NAME = "en... | |
- 2*m.b10*m.b96 - 2*m.b10*m.b97 - 2*
m.b10*m.b98 - 2*m.b10*m.b100 - 2*m.b10*m.b103 - 2*m.b10*m.b104 - 2*m.b10*m.b106 - 2*m.b10*
m.b108 - 2*m.b10*m.b111 - 2*m.b10*m.b112 - 2*m.b10*m.b114 + 2*m.b10*m.b115 - 2*m.b10*m.b117 -
2*m.b10*m.b118 - 2*m.b10*m.b121 - 2*m.b10*m.b125 + 2*m.b10*m.b127 + 2*m.b10*m.b129 + 2*m.b10*
... | |
"""
Asynchronous Advantage Actor Critic, A3C + RNN in continuous action space (https://arxiv.org/abs/1602.01783)
with Generalized Advantage Estimation, GAE (https://arxiv.org/abs/1506.02438)
Actor and Critic share similarities with the DDPG architecture (https://arxiv.org/abs/1509.02971)
Special thanks to the followin... | |
<reponame>akliouev/LXD-Cloud
#!/usr/bin/python
from __future__ import with_statement
import inspect, os, shutil
import subprocess
import datetime
import time
from time import sleep
import socket
import string
import sys
import logging
import logging.handlers
from tendo import singleton
import argparse
import paramiko
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.