input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
% T
print 'Case #%d: %.10f' % (T, 1.0 * best / total)
if b < a:
b += 1
while b < N - 1 and getsum(a, b, total, totalsum) >= getsum(a, b + 1,
total, totalsum):
b += 1
infile.close()
return best
def func_8f7d9b18b0f14b1e8ab440a10887730d(infile):
for T in xrange(1, T + 1):
N, p, q, r, s = line(infile)
A = [((... | |
<gh_stars>10-100
# Generic imports
import os, os.path
import math
import pygmsh
import meshio
import scipy.special
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
# Custom imports
from meshes_utils import *
### ************************************************
### Class defining shape object
class... | |
#! /usr/bin/env python3
# Script to crawl the file system for changed files
#
# fs-crawler dirkpetersen / Oct 2019
#
import sys, os, argparse, subprocess, re, time, datetime, tempfile, random, threading, filecmp
class KeyboardInterruptError(Exception): pass
def main():
#log = logger('fs-crawler', args.debug)
#... | |
oriented in the tandem left configuration;
; i.e., having the "... < .... < ..." type of interaction that
_probably_ results in an _parallel_ chain configuration. parallel
configuration. This configuration results in a far less strongly
binding interaction (about 1/3) but is also often observed in the
experimental data... | |
setting."
print "<association>:<object> temporarily override default association for <object>"
print
print "EXAMPLE:"
print "operation.py create write_protect_on WP3 CAP3: VO2093 VO2094 VO2095 VO2096 VO2097 VO2098 VO2099 VO2152 VO2154 VO2195 VO2196 VO2197 VO2198 VO2199 VO2203 VO2206 VO2207 VO2208 VO2209 VO2211 ... | |
gaussian[radius - top:radius + bottom, radius -
left:radius + right]
if min(masked_gaussian.shape) > 0 and min(
masked_heatmap.shape) > 0: # TODO debug
np.maximum(masked_heatmap, masked_gaussian * k, out=masked_heatmap)
return heatmap
def get_dir(self, src_point, rot_rad):
sn, cs = np.sin(rot_rad), np.cos(rot_... | |
<reponame>malfonsoNeoris/maskrcnn_tf2
import efficientnet.keras as efn
import numpy as np
import tensorflow as tf
from classification_models.keras import Classifiers
from common import utils
from tensorflow.keras import layers as tfl
# Subclassed tf.keras API
@tf.keras.utils.register_keras_serializable()
class NormBo... | |
if (element.startswith("https://")):
element = element[8:]
if (element.startswith("www.")):
element = element[4:]
element=element[:element.find("/")]
element="http://"+element
print(("checking "+element+" :"))
if (checkwp(element)):
suc = str(checkVul(element))
if( suc=="True"):
try:
filee = open("priv8.txt"... | |
k in props])
update_props = self.resolve_refs_recursively(stack_name, update_props, resources)
if 'Timeout' in update_props:
update_props['Timeout'] = int(update_props['Timeout'])
if 'Code' in props:
code = props['Code'] or {}
if not code.get('ZipFile'):
LOG.debug('Updating code for Lambda "%s" from location: %s... | |
<filename>services/email/src/oci_cli_email/generated/email_cli.py<gh_stars>0
# coding: utf-8
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
from __future__ import print_function
import click
import oci # noqa: F401
import six # noqa: F401
import sys # noqa: F401
from oci_cli.cli_root im... | |
<reponame>QuantumHardware/qiskit-experiments
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENS... | |
<filename>legacy/Hand_load.py
import re
import copy
import Classes as cl
import itertools
import Database_gen as dg
import pickle
import gc
"""
with open("/Users/Shuza/SpiderOak Hive/Poker hands/BovadaHandHistory/BovadaHandHistory_Omaha_PL_2016070722214792111.txt",'r') as f:
All stacks and betsizes tracked in BBs (for... | |
<filename>converter/converter.py
# https://github.com/Tencent/ncnn/wiki/how-to-implement-custom-layer-step-by-step
# https://github.com/Tencent/ncnn/wiki/param-and-model-file-structure
# https://github.com/Tencent/ncnn/wiki/operation-param-weight-table
import numpy as np
from tqdm import tqdm
from functools import par... | |
on data type,
`start_time` and `end_time`. In general `1000`, `30000`, `300000`, `1800000`,
`7200000`, and `86400000` are possible values.
start_time (int, optional):
When the time window starts (in milliseconds since epoch).
type (str, optional):
Display the metric of a specified object type. Valid values are `a... | |
arguments:
stepsize -- stepsize of local model
k -- number of inner steps of local model
"""
if not (model == 'expmix' or model == 'local'):
raise NameError('Unknown model {}. Available models are \'expmix\' and \'local\'.'.format(model))
loss_array = []
loss_weights = []
for worker_counter, worker in self.... | |
<reponame>FabiChan99/Hikari-Discord-Bot
import discord.ext.commands
from Utils.data import *
stupidword = "https://cdn.discordapp.com/attachments/836905275252408341/838075043271016468/StupidWord.png"
DISCORD_INVITE = r'discord(?:app\.com|\.gg)[\/invite\/]?(?:(?!.*[Ii10OolL]).[a-zA-Z0-9]{5,7}|[a-zA-Z0-9\-]{2,32})'
... | |
# Copyright Peznauts <<EMAIL>>. 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 or ag... | |
store some metadata
self.meta['width'] = self.width
self.meta['target'] = self.obs.target.name
self.meta['night'] = self.obs.night.name
self.meta['instrument'] = self.obs.instrument.name
self.meta['extractiondefaults'] = self.obs.instrument.extractiondefaults
#if self.shift:
# raise ValueError("You need to sto... | |
the admin.
"""
objects = DataCutDatasetManager()
class Meta:
proxy = True
verbose_name = "Data Cut Dataset"
permissions = [
(
"manage_unpublished_datacut_datasets",
"Manage (create, view, edit) unpublished datacut datasets",
)
]
class DataCutDatasetUserPermission(DataSetUserPermission):
"""
Proxy model... | |
<filename>src/evolver.py
"""
evolver
=======
This module contains the methods to start and finish a complete evolutionary run.
The present version can run strongly-typed Koza-based GP using tournament
selection.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT ... | |
destructor.
"""
try :
for i in self._tempFiles:
if (isinstance(i,str)):
os.remove(i)
except :
pass
def getEXIFData(self):
"""
**SUMMARY**
This function extracts the exif data from an image file like JPEG or TIFF. The data is returned as a dict.
**RETURNS**
A dictionary of key value pairs. The value p... | |
#!/usr/bin/env python3
# -.- coding: utf-8 -.-
# kickthemout.py
"""
Copyright (C) 2017-18 <NAME> (<EMAIL>) & <NAME> (<EMAIL>)
See License at nikolaskama.me (https://nikolaskama.me/kickthemoutproject)
"""
import os, sys, logging, math, traceback, optparse, threading
from time import sleep
BLUE, RED, WHITE, YELLOW, MAG... | |
self.sampler(self.volume)
mylog.debug("Done casting rays")
self.finalize_image(camera)
self.current_image = self.apply_colormap()
zbuffer += ZBuffer(self.current_image.astype("float64"), self.sampler.azbuffer)
zbuffer.rgba = ImageArray(zbuffer.rgba)
self.zbuffer = zbuffer
self.current_image = self.zbuffer.rgba... | |
transcoding and parse url correctly
# current impl assumes basic case of grpc transcoding
url = "https://{host}/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk".format(
host=self._host,
project=request.project,
zone=request.zone,
instance=request.instance,
)
# TODO(yon-mg): handle ne... | |
= o_type(v)
r = R.from_value(o, annotation=f"{o_type}({v})")
a5_xor_r = 0xA5 ^ r
assert a5_xor_r.bin_op == operator.__xor__
left, right = a5_xor_r.sources
assert left == ValueRoller(0xA5)
assert right == r
assert tuple(a5_xor_r.roll().outcomes()) == (0xA5 ^ o,), a5_xor_r
r_xor_a5 = r ^ 0xA5
assert r_xor_a5.b... | |
Be careful
as this method is not the builtin default help_command and will be
removed if the cog is unloaded"""
# Set the title of the embed so custom messages can be added in
self.title = msg
# Good thing Cog, Command, and Group all have .qualified_name
# If no cmd, Bot help page will be sent
msg = await self... | |
import os
import stat
import textwrap
import unittest
from parameterized import parameterized
from conans.model.manifest import FileTreeManifest
from conans.model.ref import ConanFileReference
from conans.paths import CONANFILE, CONAN_MANIFEST
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from co... | |
<reponame>ConnectedSystems/pyapprox
import time
import numpy as np
import subprocess
import os
import glob
from functools import partial
from multiprocessing import Pool
from pyapprox.utilities import get_all_sample_combinations
from pyapprox.utilities import hash_array
def get_num_args(function):
"""
Return the n... | |
<gh_stars>1-10
"""Cameras for use in telescope tracking control loop.
A set of classes that inherit from the abstract base class Camera, providing a common API for
interacting with cameras. The main application for a camera relevant to this package is as a
sensor to be paired with computer vision algorithms that can e... | |
noqa: E501
if 'page_size' in params:
query_params.append(('pageSize', params['page_size'])) # noqa: E501
if 'sort' in params:
query_params.append(('sort', params['sort'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept']... | |
transform=ax[cik].transAxes,horizontalalignment='right',verticalalignment='top',fontsize=10)
else:
ax[cik].text(0,0.9,' S',transform=ax[cik].transAxes,horizontalalignment='left',verticalalignment='top',fontsize=10)
ax[cik].text(1,0.9,' N',transform=ax[cik].transAxes,horizontalalignment='right',verticalalignment='t... | |
<reponame>NETHINKS/opennms-docker-env<gh_stars>1-10
""" Container module.
This module defines the container definitions for container_generator.
"""
import os
import time
import hashlib
from collections import OrderedDict
from OpenSSL import crypto
from template_engine import TemplateEngine
from docker import DockerIm... | |
default Realm behavior.
"""
return pulumi.get(self, "realm_overrides")
def _translate_property(self, prop):
return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop
@pulumi.output_type
class KeycloakRealmSpecInstanceSelector(dict):
"""
Selector for looking up Keycloak Custom Resources.
"""
def __init__(__s... | |
#!/usr/bin/env python3
# RollingClockTicker by joe703 / https://www.youtube.com/channel/UChMi8gAr52_jZXIpr9WXYQQ
# Verbesserungen und Erweiterungen von Mario
import time
import socket
import feedparser
import requests
import RollingClock
import sys, signal
import imaplib
from fritzconnection.lib.fritzcall import Frit... | |
def checkExceptions(self, residue1, residue2):
"""
checks for exceptions for this version - using defaults
"""
exception = False
value = None
resType1 = residue1.resType
resType2 = residue2.resType
if (resType1 == "COO" and resType2 == "ARG"):
exception, value = checkCooArgException_old(residue1, residue2, ver... | |
4466 4535",
50405: "4362 4466 4536",
50406: "4362 4466 4537",
50407: "4362 4466 4538",
50408: "4362 4466 4539",
50409: "4362 4466 4540",
50410: "4362 4466 4541",
50411: "4362 4466 4542",
50412: "4362 4466 4543",
50413: "4362 4466 4544",
50414: "4362 4466 4545",
50415: "4362 4466 4546",
50416: "4362 4467",
... | |
diagonals of the matrices. There can be multiple
such patterns in the grid. For each such pattern identified,
we have to add two blue squares of same size to their neighbourhood.
Positions of these blue squares will depend on the following :
1. Positions of the green squares
2. Whether green squares are connected ... | |
self, object_type, generate_object):
container_name = self.create_temp_container(
descriptor=CONTAINER_DESCRIPTOR)
object_name = self.default_obj_name
object_headers = {'Access-Control-Expose-Headers': 'X-Foo-Header'}
object_info = generate_object(container_name, object_name,
headers=object_headers)
response = ... | |
import os
import argparse
from copy import deepcopy
DATA_DIR = '../data'
parser = argparse.ArgumentParser()
parser.add_argument("--seed", type=int, default=0)
parser.add_argument("--epochs", nargs='+', type=int, default=[10, 10, 10, 10, 10],
help='Epoch number for each task')
parser.add_argument("--batch_size", type... | |
<gh_stars>0
import pygame
from pygame.locals import *
class Piece():
def __init__(self, window, board_start, tile_size, value, team, image, origin):
self.value = value
self.window = window
self.board_start = board_start
self.tile_size = tile_size
self.team = team
self.image = image
self.origin = origin
self.... | |
#!/usr/bin/python3.9
# Copyright (c) 2021 MobileCoin Inc.
# Copyright (c) 2021 The Forest Team
import asyncio
import json
import string
import time
import math
import logging
from decimal import Decimal
from typing import Optional
from forest import utils
from forest.core import (
Message,
Response,
hide,
requires... | |
<reponame>bencebecsy/BayesWavePTA
################################################################################
#
#BayesWavePTA -- Bayesian search for burst GW signals in PTA data based on the BayesWave algorithm
#
#<NAME> (<EMAIL>) -- 2020
############################################################################... | |
:type ParamName: str
:param ValueType: 参数类型:integer
:type ValueType: str
:param NeedRestart: 修改后是否需要重启:true,false
:type NeedRestart: str
:param DefaultValue: 参数默认值
:type DefaultValue: str
:param CurrentValue: 当前运行参数值
:type CurrentValue: str
:param Tips: 参数说明
:type Tips: str
:param Min: 参数最小值
:type Min: str
... | |
def test_type_bldg_residential_with_calc(self):
"""
Verification of the type building generation of an office building.
Values are compared with TEASER3 values.
"""
from teaser.logic.archetypebuildings.bmvbs.singlefamilydwelling \
import SingleFamilyDwelling
prj.set_default()
test_residential = SingleFamilyDwe... | |
disjoint
# subgraphs.
self.add_argument('--known-point-xy', dest='known_pt_xy',
#action='append', default=[], nargs=2,
action='append',
# This is a point for Mpls-St. Paul/Minnesota.
#default=[480292.5, 4980909.8,],
default=[conf.known_node_pt_x, conf.known_node_pt_y,],
nargs=2,
help='a point on the connected ... | |
# --------------------------------------------------------------------------
# File: _anno.py
# ---------------------------------------------------------------------------
# Licensed Materials - Property of IBM
# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
# Copyright IBM Corporation 2008, 2019. All ... | |
<filename>model.py
import torch
import torch.nn as nn
from torch.nn import TransformerEncoder, TransformerEncoderLayer
import pdb
import math
from torch.nn import Linear, ReLU, CrossEntropyLoss, Sequential, Conv2d, MaxPool2d, Module, Softmax, BatchNorm2d, Dropout
import torch.nn.functional as F
class ConvNormRelu(nn.... | |
- 3*s^4 + 4*s^3 - 3*s^2 + 2*s - 1 : 1), (1 : 1 : 1),
(s^5 - 2*s^4 + 3*s^3 - 3*s^2 + 3*s - 1 : -s^5 + 3*s^4 - 5*s^3 + 4*s^2 - 4*s + 2 : 1)]
::
sage: P.<x,y,z> = ProjectiveSpace(QQ,2)
sage: H = Hom(P,P)
sage: f = H([x^2 - 21/16*z^2, y^2-2*z^2, z^2])
sage: f.periodic_points(2, False)
[(-5/4 : -1 : 1), (-5/4 : 2 :... | |
#
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impor... | |
'version_type': {'key': 'versionType', 'type': 'object'}
}
def __init__(self, path=None, recursion_level=None, version=None, version_option=None, version_type=None):
super(TfvcItemDescriptor, self).__init__()
self.path = path
self.recursion_level = recursion_level
self.version = version
self.version_option = ve... | |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
from mpl_toolkits.mplot3d import Axes3D
#import time
# Initialize webcam input
cap = cv2.VideoCapture(0)
# Initialize video input
#cap = cv2.VideoCapture("C:/Users/liangx/Documents/Dunhill Project Data/Single Sign/Stomach/FARM... | |
0.5, nan, nan])
"""
specification = as_float_array(specification)
if is_grey_munsell_colour(specification):
return specification * np.array([np.nan, 1, np.nan, np.nan])
else:
hue, value, chroma, code = specification
if hue == 0:
# 0YR is equivalent to 10R.
hue, code = 10, (code + 1) % 10
if chroma == 0:
... | |
<reponame>NeTatsu/video-diff<filename>Python/Clustering.py
"""
The most efficient would be to use OpenCV's
cv::flann::hierarchicalClustering .
But we do NOT have Python bindings to it.
See if you have the time:
http://opencvpython.blogspot.ro/2013/01/k-means-clustering-3-working-with-opencv.html
Other ideas at:
-... | |
1
B += D[a]
A -= D[a]
break
p = t
ans = min(ans, p)
ans = float(S - ans) / S
return t
def func_891713351c9841cb9268514a5296b1c2(N, D):
S = sum(D)
ans = S
A, B, C = 0, 0, S
a = 0
b = -1
while b < N - 1:
b += 1
C -= D[b]
B += D[b]
p = max(A, B, C)
while a < b:
B -= D[a]
A += D[a]
a += 1
t = max(A,... | |
# coding: utf-8
"""
Quay Frontend
This API allows you to perform many of the operations required to work with Quay repositories, users, and organizations. You can find out more at <a href=\"https://quay.io\">Quay</a>. # noqa: E501
OpenAPI spec version: v1
Contact: <EMAIL>
Generated by: https://github.com/swagge... | |
<reponame>ocastilloreyes/petgem<gh_stars>10-100
#!/usr/bin/env python3
# Author: <NAME>
# Contact: <EMAIL>
"""Define data preprocessing operations for **PETGEM**."""
# ---------------------------------------------------------------
# Load python modules
# --------------------------------------------------------------... | |
r"""@package motsfinder.ndsolve.bcs
Classes for imposing boundary conditions.
"""
from __future__ import print_function
from builtins import range
import numpy as np
from mpmath import mp
from ..utils import isiterable, lmap
from .common import _make_callable
__all__ = [
"DirichletCondition",
"NeumannCondition"... | |
"""A Python implementation of the Simulated Annealing kernel."""
from six import iteritems
import math
import time
import importlib
from rig.place_and_route.place.utils import \
add_resources, subtract_resources, overallocated
import warnings
class PythonKernel(object):
"""An implementation of the Simulated A... | |
a Poll")
return
else:
p = await ctx.send(embed=p_embed) # Sending the Embed
await p.add_reaction("<:1_bot:957922958502952981>") # Adding 1 reaction
await p.add_reaction("<:2_bot:957922954119888917>") # Adding 2 reaction
if int(reactionc) == 3:
await p.add_reaction("<:3_bot:957922953893384192>") # Checking if num... | |
# Copyright 2004-2008 <NAME>.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
This file contains indexing suite v2 code
"""
file_name = "indexing_suite/container_proxy.hpp"
code = r"""// Copyright (c) 2003 <N... | |
<gh_stars>100-1000
import unittest
import ConfigParser
from impacket.dcerpc.v5.ndr import NDRCALL
from impacket.dcerpc.v5 import transport, epm, samr
from impacket.dcerpc.v5.dtypes import NULL
from impacket.dcerpc.v5.rpcrt import RPC_C_AUTHN_LEVEL_PKT_INTEGRITY, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, \
RPC_C_AUTHN_LEVEL_NONE... | |
None:
attrs = document.attributes
else:
# Remove numbered document attributes so they don't clash with
# attribute list positional attributes.
attrs = {}
for k,v in document.attributes.items():
if not re.match(r'^\d+$', k):
attrs[k] = v
# Substitute attribute references inside dictionary values.
for k,v in di... | |
<filename>codebuild/create_project.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
copywrite = """# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of the Li... | |
<reponame>JerBouma/OpenBBTerminal
""" DCF Model """
__docformat__ = "numpy"
import logging
import os
from io import BytesIO
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union
from urllib.request import urlopen
from zipfile import ZipFile
import financedatabase as fd
import pandas as pd
import r... | |
<reponame>karthikeyan-dhandapani/pycentral
# MIT License
#
# Copyright (c) 2020 Aruba, a Hewlett Packard Enterprise company
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restricti... | |
from flow.core.generator import Generator
from collections import defaultdict
from lxml import etree
E = etree.Element
class SimpleGridGenerator(Generator):
"""Generator for nxm grid networks."""
def __init__(self, net_params, base):
super().__init__(net_params, base)
# this is a dictionary containing inner l... | |
= Var(within=Reals,bounds=(0,None),initialize=0.2801968386)
m.x3157 = Var(within=Reals,bounds=(0,None),initialize=0.733594)
m.x3158 = Var(within=Reals,bounds=(0,None),initialize=0.820376)
m.x3159 = Var(within=Reals,bounds=(0,None),initialize=0.26446572658)
m.x3160 = Var(within=Reals,bounds=(0,None),initialize=0.3645927... | |
"special" param like "updates"
# in returnPkgLists(). This allows us to always return "ok" for
# things like "yum list updates".
if len(extcmds) and \
rrap[0] and rop[0] and rup[0] and rep[0] and rap[0] and rip[0]:
return 1, [_('No matching Packages to list')]
return 0, []
def needTs(self, base, basecmd, extcmd... | |
<gh_stars>0
# dbdu.py
# Copyright (c) 2019 <NAME>
# Licence: See LICENCE (BSD licence)
"""Access a Berkeley DB database with the bsddb3 module."""
import heapq
import collections
from .bytebit import Bitarray
from .constants import (
SECONDARY,
# ACCESS_METHOD,
# HASH,
SUBFILE_DELIMITER,
SEGMENT_HEADER_LENGTH,
)... | |
numAssigned + 1, weight * deltaWeight)
del assignment[var]
else:
# Arc consistency check is enabled. This is helpful to speed up 3c.
for val in ordered_values:
deltaWeight = self.get_delta_weight(assignment, var, val)
if deltaWeight > 0:
assignment[var] = val
# create a deep copy of domains as we are going to l... | |
import os, weakref
import Tkinter, Pmw
from Scenario2.gui.Tk.clipboard import ClipboardGUI
from Scenario2.sequenceAnimator import SequenceAnimator
from Scenario2.gui.Tk.sequenceAnimator import SequenceAnimatorGUI
from Scenario2 import _clipboard, _MAATargets
from DejaVu.scenarioInterface.animationGUI import orientat... | |
# test plugin
import re
import os
import json
import types
import django
from django.contrib.auth.models import User
from logos.models import NetworkPlugins, RoomPlugins
from django.contrib.auth import authenticate
from guardian.shortcuts import assign_perm, get_perms, remove_perm
import twisted
from git import Repo
... | |
import threading, queue, time, os, pickle
# from queue import Queue
import numpy as np
import tensorflow as tf
import sarnet_td3.common.tf_util as U
from tensorflow.python.keras.backend import set_session
lock = threading.Lock()
class MultiTrainTD3(threading.Thread):
def __init__(self, input_queue, output_queue, arg... | |
press_in[press_in.size - 1] < self.atmo["psurf"]:
# extrapolation required
dz = (
np.log(self.atmo["psurf"] / press_in[press_in.size - 1])
* Rgas
* temp_in[temp_in.size - 1]
/ (grav * Mair)
)
press_in = np.append(press_in, self.atmo["psurf"])
zalt_in = np.append(zalt_in - dz, 0.0)
temp_in = np.append(temp_in,... | |
### TNM-chan ###
### v 21.220 ###
### BEGIN USER-SET VARIABLES ###
# Set your command prefix here.
pre = 'tnm!'
# If you say "colour" instead of "color," change this variable to "True", and I'll change everything accordingly.
useColour = False
# Type your Discord username in quotes, then add your user ID - make sure... | |
% len(merged_unreleased_indexes))
return dfs, facts, unreleased_prs_event
@classmethod
@sentry_span
async def mine(cls,
date_from: date,
date_to: date,
time_from: datetime,
time_to: datetime,
repositories: Set[str],
participants: PRParticipants,
labels: LabelFilter,
jira: JIRAFilter,
with_jira_map: bool,
... | |
# Copyright The PyTorch Lightning team.
#
# 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 wr... | |
<reponame>mwschall/storkive
from io import BytesIO
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.db import models, IntegrityErro... | |
m.x3716 - m.x3717 - m.x3718
- m.x3719 - m.x3720 - m.x3721 - m.x3722 - m.x3723 - m.x3724 - m.x3725 - m.x3726 - m.x3727
- m.x3728 - m.x3729 - m.x3730 - m.x3731 - m.x3732 - m.x3733 - m.x3734 - m.x3735 - m.x3736
- m.x3737 - m.x3738 - m.x3739 - m.x3740 - m.x3741 - m.x3742 - m.x3743 - m.x3744 - m.x3745
- m.x3746 - m.x374... | |
"""
Django views for interacting with Build objects
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError
from django.views.generic import DetailView, ListView, UpdateView
from django.forms import Hidde... | |
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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/li... | |
the current pith
# into the "{obj}" variable already embedded by
# that class into this code.
hint_child_expr=(
hint_child._is_valid_code.format(
indent=indent_child,
obj=pith_curr_var_name,
)),
))
# Generate locals safely merging the locals required by
# both this validator code *AND* the current code
# ty... | |
import requests
import json
from .UserProfiles import YourUserProfile, AnotherUserProfile
from .Project import YourProject, AnotherProject
from bs4 import BeautifulSoup
from .Comments import UserComment
import re
class YourUser:
def __init__(self, data, client):
self.id = data["id"]
self.username = data["username"... | |
from time import time
import glm
from itbl import Ray, Shader
from itbl.accelerators import SDF, BVHAccel
from itbl.cameras import TrackballCamera
from itbl.shapes import Box
from itbl.util import get_color, get_data
from itbl.viewer import Application, Viewer
from itbl.viewer.backend import *
from wilson import *
im... | |
unit_obj.checkNewAction('move', self.rally_pos.x, self.rally_pos.y):
unit_obj.game.combinedActions.append(unit_obj.unit.move(self.rally_pos))
unit_obj.last_target = None
return True
return False
def defend(self, unit_obj):
#clear out destructables around the base.
# for nexus in self.un... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
from ete3 import TreeNode
from bg.edge import BGEdge
from bg.genome import BGGenome
from bg.multicolor import Multicolor
from bg.tree import BGTree
__author__ = "<NAME>"
__email__ = "aganezov(at)cs.jhu.edu"
__status__ = "production"
import unittest
class BGTreeTestCase(unitt... | |
<reponame>teharrison/narrative
#
# Autogenerated by Thrift Compiler (0.9.1)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from thrift.transport import TTransport
from thrift.protocol import... | |
be used just before issuing a DELETE call, which will
# set the visibility flag to False
if kwargs.get('archive_name', False):
# This should be sufficiently unlikely to create duplicates. time()
# will use up a max of 8 characters, so we slice the name down to
# make the result fit in 64 characters
repository.nam... | |
segment
if (nextSpeaker != lastSpeaker) or ((nextSpeaker == lastSpeaker) and ((nextStartTime - lastEndTime) > 0.1)):
nextSpeechSegment = SpeechSegment()
speechSegmentList.append(nextSpeechSegment)
nextSpeechSegment.segmentStartTime = nextStartTime
nextSpeechSegment.segmentSpeaker = nextSpeaker
skipLeadingSpace = ... | |
for ID field
_sql_constraints = [] #: SQL constraints [(name, sql_def, message)]
_rec_name = None #: field to use for labeling records, default: ``name``
_order = 'id' #: default order field for searching results
_parent_name = 'parent_id' #: the many2one field used as parent field
_parent_store = False
"""set t... | |
models = df.model.values
model_families = get_model_families()
family_counts = {k: 0 for k in set(model_families.values())}
for m in models:
family = model_families[m]
family_counts[family] += 1
wgts = []
for m in models:
family = model_families[m]
wgts.append(1./family_counts[family])
xerr = wgts
yerr... | |
<reponame>ohannuks/lenstronomy<gh_stars>0
import numpy as np
import lenstronomy.Util.util as util
import lenstronomy.Util.image_util as image_util
from scipy.optimize import minimize
from lenstronomy.LensModel.Solver.epl_shear_solver import solve_lenseq_pemd
from lenstronomy.LensModel.Solver.lens_equation_solver import... | |
2}
{"params": ["Action_take", "Category", "Origin_place", "Rpos","Destiny_place"],
"Action_take": [["take"], [], [], []],
"Category": [[], [], ["category"], []],
"Origin_place": [[], [], ["place"], []],
"Rpos": [["left", "right", "center", "middle_bottom", "top"],[],[],[]],
"Destiny_place": [[], [], ["place"], []... | |
<reponame>softdevteam/eco<filename>lib/eco/treemanager.py
# Copyright (c) 2013--2014 King's College London
# Created by the Software Development Team <http://soft-dev.org/>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwa... | |
#!/usr/bin/env python
#
# Copyright (C) 2007 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Publ... | |
import asyncio
import glob
import importlib
import inspect
import logging
import os
import re
import sys
import time
import sqlalchemy
from cloudbot.event import Event
from cloudbot.util import database
logger = logging.getLogger("cloudbot")
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.s... | |
#!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
import os, plistlib, struct
from .loader import QlLoader
from qiling.exception import *
from qiling.const import *
from .macho_parser.parser import *
from .macho_parser.const import *
from .macho_parser.utils imp... | |
"""
Operational state parameters for BFD on the specified
interface.
.. attribute:: id
A unique identifier for the interface
**type**\: str
**config**\: False
.. attribute:: enabled
When this leaf is set to true then the BFD session is enabled on the specified interface \- if it is set to false, i... | |
0.0, 'step': 1,
'jobName': 'OneTaper3D', 'severe': 0, 'iterations': 0,
'phase': STANDARD_PHASE, 'equilibrium': 0})
mdb.jobs['OneTaper3D']._Message(MEMORY_ESTIMATE, {'phase': STANDARD_PHASE,
'jobName': 'OneTaper3D', 'memory': 347.897059440613})
mdb.jobs['OneTaper3D']._Message(COMPLETED, {'phase': STANDARD_PHASE,
... | |
# -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli.nice_command import NiceCommand
import tccli.error_msg as ErrorMsg
import tccli.help_template as HelpTemplate
from tccli import __version__
from tccli.utils import Utils
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.