input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
from pathlib import Path
from itertools import zip_longest
import difflib
from Framework import Utility_Wrapper
from Framework import Plugin_Log
from Framework import Print
from Framework.File_Manager import XML_File
from Framework.File_Manager.Cat_Reader import Get_Hash_String
from Framework.File_Manager.XML_Diff im... | |
bias_correction1 = 1 - beta1 ** state['step']
bias_correction2 = 1 - beta2 ** state['step']
step_size = group['lr'] * math.sqrt(bias_correction2) / bias_correction1
binary_weight_before_update = torch.sign(p.data)
condition_consolidation = (torch.mul(binary_weight_before_update, exp_avg) > 0.0 ) # exp_avg has th... | |
line:
if line.startswith("#"):
out_line = ""
elif line == "\n": # tweet ends
out_line = "\n-DOCSTART-\n\n"
else:
line_list = line.split("\t")
out_line = line_list[1] + "\t"
if line_list[3] == "-\n": # no wiki name
out_line += "O\n"
else:
out_line += line_list[2][:2] + line_list[3].split("|")[0].replace(" ", ... | |
max(Decimal('0.00'), start)
end = min(transcript.length, end)
task = transcript.transcribetask_set.create(
is_review=is_review,
media=None,
fragment=fragment,
start=fragment.start,
end=fragment.end,
)
try:
task.lock()
except locks.LockException:
task.delete()
raise
if not is_review:
next = fragment.re... | |
#The main idea here that we try to approximate the light curve by Fourier series with different periods
#and choose that one, for which the sum of square deviations dots from the approximation is the smallest.
#Then programm build a light curve and phase curve. All dots that are stands out from the approximation
#... | |
<filename>keystone/notifications.py
# Copyright 2013 IBM Corp.
#
# 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... | |
ne tXr": 1993, "223 X": -1994, "rolcX": 1995, "Xrune": 1996, " zXri": 1997,
"herkX": 1998, "Xstah": 1999, "UsXr": -2000, "UnsX": 2001, "iki tXrl": -2002,
" sXslu": 2003, " Xmme": 2004, " cXru": 2005, " Xfl": 2006, "OlcX": 2007,
"mXsia": 2008, "mXsi": -2009, "Xrub": -2010, "hCX": -2011, " Xvey": 2012,
" lXn": -2013,... | |
'''
Implements the Domain Specific Pipeline (DSP)
Runs an MCTS modified to implement Eterna player strategies
Second process of the SAP
'''
import sys
import numpy as np
from eterna_score import get_pairmap_from_secstruct
import RNA
from subprocess import Popen, PIPE, STDOUT
import re
from difflib import SequenceMatch... | |
returns the item information """
params = {
"f" : "json",
"token" : self._token
}
uURL = self._url + "/iteminfo"
return self._do_get(url=uURL, param_dict=params)
#----------------------------------------------------------------------
def addPermission(self, principal, isAllowed=True):
"""
Assigns a new permis... | |
op1, op2) = specSub
OPTIONS.debug(2, ".. instr substitution to mne: ", mne, " op1: ", op1, " op2: ", op2)
# make up an AssyRec as well
assyrec = AssembleRecord(orgpos=self.orgpos, line=line, lineno=lineno, \
instrParts=(label, mne, op1, op2, rest))
# makes only sense WITH an instruction
if len(instr) > 0:
pro... | |
self.type = gdb.lookup_type(f"arrow::{name}")
self.val = cast_to_concrete(val, self.type)
@property
def fields(self):
return FieldVector(self.val['children_'])
def _format_type(self):
r = type_reprs.get(self.name, self.name)
return f"arrow::{r}"
def _for_evaluation(self):
return for_evaluation(self.val, sel... | |
{}
query_params = []
if 'states' in params:
query_params.append(('states', params['states'])) # noqa: E501
collection_formats['states'] = 'multi' # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select... | |
import logging
import cPickle
from functools import partial
from plow import client
from plow.client import DependType
from plow.gui.manifest import QtCore, QtGui
from plow.gui import util
LOGGER = logging.getLogger(__name__)
########################
# FilterManager
#
class FilterManager(QtGui.QDialog):
"""... | |
"""
This file was generated automatically by xsd-to-vol. Do not edit.
"""
from datetime import datetime
import pytz
from voluptuous import All, In, Length, Required, Schema, Url
def DateTime(dt):
dt = pytz.utc.localize(dt)
return f"{dt.strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3]}{dt.strftime('%z')}"
"""TariffMetaData... | |
shape: {}'.format(batch['data'].shape))
img = batch['data']
if img.shape[0] <= self.cf.batch_size:
if self.mode == 'val':
# call training method to monitor losses
results_dict = self.net.train_forward(batch, is_validation=True)
# discard returned ground-truth boxes (also training info boxes).
results_dict['bo... | |
<gh_stars>1-10
import urllib.request,sys,time
from bs4 import BeautifulSoup
import requests
from datetime import date
print("A PRDUCT MADE BY <NAME>");
print("MIT LICENSE 2020. COPYRIGHT <NAME>")
while True:
# print("\nPLEASE ENTER A SEARCH TERM(PRESS ENTER WHEN DONE).\n (TO EXIT, JUST PRESS ENTER) \n ->>")
# C... | |
# -*- coding: UTF-8 -*-
"""Learner for StyleGANs.
Typical usage example:
First configure your desired GAN on the command-line:
go to root directory...
$ python config.py stylegan
$ python data_config.py FFHQ path/to/datasets/ffhq
Then write a custom script (or use train.py):
from gan_lab import get_current_c... | |
<filename>pytransact/test/test_commit.py
# Copyright 2019 Open End AB
#
# 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 app... | |
# Copyright 2015 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 law or agreed to i... | |
= True
Locations.formDetails[25][2] = True
Locations.formDetails[26][2] = True
Locations.formDetails[27][2] = True
Locations.formDetails[28][2] = True
Locations.formDetails[29][2] = True
self.action.checkForm(Locations.formDetails,
(),
()
)
sel.type("gis_location_lat", "51")
sel.type("gis_location_lon", "1")... | |
if taxes_ref is None:
taxes_ref = {}
if not code_digits:
code_digits = self.code_digits
AccountTaxObj = self.env['account.tax']
# Generate taxes from templates.
generated_tax_res = self.with_context(active_test=False).tax_template_ids._generate_tax(company)
taxes_ref.update(generated_tax_res['tax_template_to_ta... | |
<gh_stars>10-100
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
object, the associated
policies are sent to agent. Agent will use this information to find
out the list of policies to be applied and their sequence during flow
evaluation. User can attach application tag to allowed objects (Project,
VN, VM or VMI).</p>
<h3 id="jd0e297">Policy-management Configuration Object</h3>
... | |
\mat{J} \ddvec{q}
where
.. math::
\dmat{J} = \mat{H} \dvec{q}
and :math:`\mat{H} \in \mathbb{R}^{6\times n \times n}` is the
Hessian tensor.
The elements of the Hessian are
.. math::
\mat{H}_{i,j,k} = \frac{d^2 u_i}{d q_j d q_k}
where :math:`u = \{t_x, t_y, t_z, r_x, r_y, r_z\}` are the elements
of the spati... | |
return redirect('/run/download_' + run_id + '/')
elif "run_atacseq_advanced" in request.POST:
command = []
if "run_name" in request.POST:
run_name = request.POST['run_name']
command.extend(['-name', '%s' % run_name])
else:
run_name = None
if "config_file" in request.FILES:
config_file = request.FILES['conf... | |
rect.left+ rect.width//2 - self.rect.width//2
self.rect.bottom = rect.bottom
self.coolDown = 0
self.damage = 4
self.doom = 0
def move(self, delay, sprites):
self.checkHitBack()
# deal move
if not delay % 2:
self.rect.left += self.speed
if (getPos(self,0.75,0)[0] >= self.scope[1] and self.speed > ... | |
import os
from functools import cmp_to_key
import numpy
from . import cInterface
from .extraData import ExtraDataUnpacker
class UMFileException(Exception):
pass
class File:
"""A class for a UM file that gives a view of the file including
sets of PP records combined into variables."""
def __init__(
self, pa... | |
<reponame>paquet-a/netptune_concon
#
# Copyright (c) 2019, Neptune Labs Sp. z o.o.
#
# 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 re... | |
<filename>code/RB_tree.py
import Color
import node
class RBTree(object):
RBNode = node.RBNode
def __init__(self, new_node=RBNode):
"""setters"""
self._nil = new_node(data=None) # Листья нули и всегда черны
self._root = self.nil # В начале корень нулевой
self._new_node = new_node # вызов, создающий узел
"""... | |
the
the betweenness centrality in parallel at if the number of nodes in
the graph is less than this value it will run in a single thread. The
default value is 50
:returns: A dictionary mapping each node index to its betweenness centrality.
:rtype: dict
"""
raise TypeError("Invalid input type %s for graph" % typ... | |
logger.debug("%r._before_start()", self)
self.before_start()
def _process_started(self, protocol):
"""
Called by :meth:`.ProcessProtocol.connectionMade` when a process has
started running.
"""
logger.debug("%r._process_started(%r)", self, protocol)
logpool.log(self.uuid, "internal", "Started %r" % protocol,
p... | |
TypeError:
print('Код после ошибки')
# Вывод: Код после ошибки - была обработана первая ошибка. Следующая строка в блоке Try print(my_var) не выполняется.
# Если мы поменяем местами принты, будет выведен NameError has happend! потому что вторая строка в коде не срабатывает.
# После того, как произошла ошибка, будет вы... | |
from os import kill
import pygame
import random
from collections import deque
import sys
import grequests
from sprites import (MasterSprite, Ship2, Ship3, Alien, Missile, BombPowerup, DistPowerup,
ShieldPowerup, DoublemissilePowerup, Explosion, Siney, Spikey, Fasty,
Roundy, Crawly)
from database import Database
from... | |
#!/usr/bin/env python
#coding: utf-8
from collections import Counter
from util import Document
from util import Query
import re
class Parser:
def __init__(self, stopWordsPath="sw.txt"):
self.stopWords = self.readStopWords(stopWordsPath)
self.cfcCollectionAttrs = [
"PN", # paper number
"RN", # doc id in the coll... | |
import os
import sys
import time
import math
import torch.nn.functional as F
from datetime import datetime
import random
import logging
from collections import OrderedDict
import numpy as np
import cv2
import torch
from torchvision.utils import make_grid
from shutil import get_terminal_size
import yaml
try:
from yaml... | |
# Lint as: python3
# Copyright 2021 The TensorFlow 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 requ... | |
= [0]
for x in t:
c.append(c[-1] + x)
a = b = 0
best = 0
while b <= N:
if a == b or c[b] - c[a] <= total / 3:
b += 1
if b > N:
break
else:
a += 1
best = max(best, total - max((c[a], c[b] - c[a], total - c[b])))(
'Case #%d: %.10f' % (testCase, float(best) / float(total)))
return a
def func_c851643bc0a541... | |
Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 1.05357,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime D... | |
urllib.request.urlopen('https://ipapi.co/postal'): # Reads the page source of the url, grabs the postal code the user resides in based upon their IP Address.
ipPostalOutput = ipPostal.decode('utf-8') # Decodes the postal code to avoid unwanted prefixes.
for ipLatLong in urllib.request.urlopen('https://ipinfo.io/l... | |
selected row. This function should be triggered only in a row click event as the this (self)
object is used.
:link Datatable website: https://datatables.net/reference/api/row()
"""
if isPyData:
jsData = json.dumps(jsData)
if jsDataKey is not None:
jsData = "%s.%s" % (jsData, jsDataKey)
updateFnc = self.... | |
pulumi.get(self, "cpu_architecture")
@cpu_architecture.setter
def cpu_architecture(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "cpu_architecture", value)
@property
@pulumi.getter(name="operatingSystemFamily")
def operating_system_family(self) -> Optional[pulumi.Input[str]]:
"""
If the `require... | |
# MIT License
#
# Copyright (c) 2020-2022, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merg... | |
chance that this method might result in a 404 Not Found for
messages that were sent recently (such as when using the realtime
websocket API (:py:class:`pyryver.ryver_ws.RyverWS`) to respond to
messages), as those messages have not been fully added to Ryver's
database yet.
You can use :py:func:`pyryver.util.retry... | |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# In[65]:
from sklearn.feature_extraction.text import CountVectorizer,TfidfVectorizer
from sklearn.naive_bayes import BernoulliNB, MultinomialNB
from sklearn import metrics
from sklearn.metrics import roc_auc_score, accuracy_score
import requests
from bs4 import Beau... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This generates data for the Flight Network Heat Map described here:
https://docs.google.com/document/d/1ajv6hJ_lz9JNpzsNjoKLUhPt7pfv2bmh63J_EhycoYA/edit
The goal is to create a heatmap for where an infectious disease could spread to
given our knowledge of the air traff... | |
4),('zi', 3),('chuan', 2),('fen', 1),('fang', 1),
('lin', 2),('ying', 3),('mei', 3),('ren', 2),('zai', 4),('bai', 2),('di', 4),
('miao', 4),('wu', 3),('ci', 3),('qu', 3),('shen', 2),('yang', 2),('yang', 2),
('yu', 3),('yu', 2),('wen', 4),('da', 2),('ji', 4),('you', 2),('yi', 3),
('gan', 3),('shi', 2),('fu', 3),('sh... | |
not is_not_loaded(self.frame_set_hash)
@staticmethod
def build_frame_set_hash(top_dir, language_id, lemma_hash={}):
""" Read all the frame files from disk and return a hash of :class:`frame_set` instances """
frame_set_hash = {}
sys.stderr.write("reading the frames files ....")
def list_frames(basedir):
fram... | |
# %%
import enum
import functools
import itertools
import re
import subprocess
import uuid
from pathlib import Path
from typing import Callable, List, NewType, Tuple, Union
import bokeh.plotting as bplotting
import cmocean
import geopandas
import numpy as np
import pandas as pd
from bokeh.colors import RGB
from bokeh.... | |
import re
from flask import Blueprint, request, jsonify
from .models import User, Note, Video
from . import db
from firebase import Firebase
from flask_cors import cross_origin
from werkzeug.utils import secure_filename
from pytube import YouTube
import os
import shutil
import math
import datetime
import ssl
from googl... | |
Example')
plt.plot(time_reflect, time_series_reflect, 'g--', LineWidth=2, label=textwrap.fill('Symmetric signal', 10))
plt.plot(time_reflect[:51], time_series_anti_reflect[:51], '--', c='purple', LineWidth=2,
label=textwrap.fill('Anti-symmetric signal', 10))
plt.plot(max_dash_time, max_dash, 'k-')
plt.plot(min_dash_ti... | |
<gh_stars>0
#!/usr/bin/env python3
#
# 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 applica... | |
tree["meshes"].append({
"name": name,
"primitives": [{
"attributes": {"POSITION": len(tree["accessors"])},
"mode": 1, # mode 1 is GL_LINES
"material": len(tree["materials"])}]})
# if units are defined, store them as an extra:
# https://github.com/KhronosGroup/glTF/tree/master/extensions
if path.units is not No... | |
Thus, it is not used for VNF chaining
cp_list.pop(0)
# gets all virtual links in VNFFGD
vnffgd_vls = topology_template['groups']['VNFFG1']['properties']['dependent_virtual_link']
# getting the previous network_name for correct VNF chaining
previous_net_name = ''
if vnffgd_vls:
previous_vl = vnffgd_vls[-1] # ge... | |
a Settings object is passed, detect the settings that differ
# from defaults, collect them into a dict, and apply them using `source`.
# This comes up in `wandb.init(settings=wandb.Settings(...))` and
# seems like the behavior that the user would expect when calling init that way.
defaults = Settings()
settings_di... | |
To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.source_stats(source, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str source: (required)
:return: SystemMetricsOut
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_retur... | |
i += 1
print("<br>pValues: "+str(r.pValues)+"<br>")
print("degreesOfFreedom: "+str(r.degreesOfFreedom)+"<br>")
print("statistics: "+str(new_statistic)+"<br>")
""")
return code
def normalizer(self, table_name, input_col,output_col, p):
# input_columns_str = ",".join(input_columns)
code = self.session_asserti... | |
"name", name)
pulumi.set(__self__, "values", values)
if regex is not None:
pulumi.set(__self__, "regex", regex)
@property
@pulumi.getter
def name(self) -> str:
return pulumi.get(self, "name")
@property
@pulumi.getter
def values(self) -> Sequence[str]:
return pulumi.get(self, "values")
@property
@pulumi.... | |
tupV = ExternalAnnotation(name=name, value=sV["String"], dataType="string", featureType=ky, provReferenceId=referenceNumber, provSourceName=reference)
pcD.setdefault(pcKy, {}).setdefault(ky, set()).update([tupV])
elif "Number" in infD["Value"]:
units = infD["Value"]["Unit"] if "Unit" in infD["Value"] else ""
for nV... | |
<filename>synapse/state/v2.py
# Copyright 2018 New Vector 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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
from copy import deepcopy
import os
from typing import Callable, Optional
from urllib.request import Request
import pystac
import pystac.stac_object
import pystac.validation
from pystac import STAC_IO
from pystac_client.conformance import ConformanceClasses
from pystac_client.exceptions import ConformanceError
from p... | |
<gh_stars>10-100
#! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
import datetime
import difflib
import json
import logging
import Queue as Q
import random
import re
import socket
import sys
import threading
import time
import traceback
import isodate
import pytz
import requests
import modules.irc as irc
import sal... | |
from typing import List, Dict
BOOLEAN = 0
NATURAL = 1
INDENT = " " * 4
types = {BOOLEAN, NATURAL}
ID: int = 0
class Symbol:
def __init__(self, line: int = None, name: str = None, type: int = None):
self.line = line
self.name = name
self.symbol_type = type
self.label = next_label()
def declare(self):
if sel... | |
<reponame>kanz76/PaddleHelix
# Copyright (c) 2021 PaddlePaddle Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: <NAME>, <NAME>
# *****************************************************************************/
## @package telemetryRNN
from __future__ import absolute_import, division, print_... | |
in dimension estimate"
## print " ... current dim = %.3f, old dim = %.3f, error = %.3f"%(dim,old_dim,err)
## not_done = False
## continue
## if in_zone:
## zone_err = abs(dim-ref_dim)/ref_dim
## if in_zone and zone_err > tol_up:
## not_done = False # end neighbourhood growth
## if logd[hiix]-logd[loix] > log_ma... | |
<gh_stars>0
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.db import models, IntegrityError
from django.db.models.signals import post_save
from django.utils import timezone
from django.utils.translation import ugettext as _
# Create your models here.
... | |
return source_code
def str_visible_len(s):
"""
:param str s:
:return: len without escape chars
:rtype: int
"""
import re
# via: https://github.com/chalk/ansi-regex/blob/master/index.js
s = re.sub("[\x1b\x9b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]", "", s)
return len(s)
def add_indent_l... | |
class MaxBoxGen():
def findMaxRect(data):
"""http://stackoverflow.com/a/30418912/5008845"""
nrows, ncols = data.shape
w = np.zeros(dtype=int, shape=data.shape)
h = np.zeros(dtype=int, shape=data.shape)
skip = 1
area_max = (0, [])
for r in range(nrows):
for c in range(ncols):
if data[r][c] == skip:
contin... | |
# coding: utf-8
"""
Scubawhere API Documentation
This is the documentation for scubawhere's RMS API. This API is only to be used by authorized parties with valid auth tokens. [Learn about scubawhere](http://www.scubawhere.com) to become an authorized consumer of our API
OpenAPI spec version: 1.0.0
Contact: <EMA... | |
-11.666598888071467,
'特种兵': -12.359746068631413,
'沮丧': -11.666598888071467,
'赌输': -11.666598888071467,
'移交': -10.567986599403358,
'水产': -10.567986599403358,
'勇': -12.359746068631413,
'祖国': -9.5871573463916331,
'女双': -11.666598888071467,
'民乐团': -12.359746068631413,
'导游': -7.7953978771635777,
'自由行': -10.280304526951578,
... | |
<filename>tests/ut/python/ops/test_nn_ops_check.py<gh_stars>1-10
# Copyright 2020 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 at
#
# http://www.apache.org/licens... | |
the created resource.
"""
return pulumi.get(self, "self_link")
@self_link.setter
def self_link(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "self_link", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
A list of instance tags to which ... | |
<gh_stars>100-1000
# Copyright 2015 Ufora 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 t... | |
import os,sys,string
import re
import types
import glob
if sys.version[:3]<='2.1':
from distutils import util
util_get_platform = util.get_platform
util.get_platform = lambda : util_get_platform().replace(' ','_')
def cyg2win32(path):
if sys.platform=='cygwin' and path.startswith('/cygdrive'):
path = path[10] +... | |
<gh_stars>10-100
"""Automated various tests for the blender nif scripts."""
# ***** BEGIN LICENSE BLOCK *****
#
# BSD License
#
# Copyright (c) 2005-2011, NIF File Format Library and Tools
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pro... | |
"""Sets up a a basic test DB for external (non-test suite) testing.
Adds Users, BTSs, Numbers, Subscribers, UsageEvents and SystemEvents.
-- all this should then be visible in a local dashboard. Make sure you've first
run fabric's init_dev to properly setup the db and its migrations. Then you can
login with the test u... | |
#!/usr/bin/env python2
# Copyright (c) 2016 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException... | |
EIyp, GKt, GA, kxs, kys, x_C, y_C, theta_p, x_S, y_S, theta_s) # Note theta_p/s in rad
lM.append(M)
lK.append(K)
vx_G.append(x_G); vy_G.append(y_G)
vx_S.append(x_S); vy_S.append(y_S)
vx_C.append(x_C); vy_C.append(y_C)
# --- Writing BeamDyn blade file
span=hwc['r_[m]'].values
s_bar=span/span[-1]
print('Writi... | |
<gh_stars>1-10
# NLP written by GAMS Convert at 04/21/18 13:53:12
#
# Equation counts
# Total E G L N X C B
# 1384 979 0 405 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 1246 1246 0 0 0 0 0 0
# FX 0 0 0 0 0 0 0 0
#
# Nonzero counts
# Total const NL DLL
# 32255 ... | |
<filename>build-html.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import os
import zipfile
import os.path
import json
import StringIO
import re
from pprint import pprint
import shutil
expected_vulnbox_store_json_fields = [
'id', 'game', 'name', 'version',
'created', 'author', 'created', 'issues'... | |
<reponame>rajkubp020/helloword
#
#
# lmpsdata.py
#
# For reading, writing and manipulating lammps data files
# For calculation of certain properities using lammps data files
# For creating VMD input text files using lammps data files
# All x,y,z calculations assume the information includes image flags
class... | |
<filename>blaze/compute/tests/test_sql_compute.py<gh_stars>0
from __future__ import absolute_import, division, print_function
import pytest
sa = pytest.importorskip('sqlalchemy')
import itertools
import sqlite3
from distutils.version import LooseVersion
import datashape
from odo import into, discover
import numpy ... | |
decomp.similarity_compress(
E, max_bond, method=method, renorm=renorm)
# absorb them into the tensors to compress this bond
bond, = bix
ta.gate_(Cr, bond)
tb.gate_(Cl.T, bond)
if absorb != 'both':
tensor_canonize_bond(ta, tb, absorb=absorb)
def _compress_between_local_fit(
self,
tid1,
tid2,
max_bond,
cu... | |
<reponame>SanPen/GridCal<filename>src/GridCal/Gui/Main/MainWindow.py
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'MainWindow.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes mad... | |
from django.test import TestCase
from django.urls import reverse
from mercury.models import EventCodeAccess, GFConfig
from ag_data.models import AGEvent, AGVenue, AGSensor, AGSensorType
from mercury.grafanaAPI.grafana_api import Grafana
import os
import datetime
# grafana host with basic auth
HOST = "http://admin:adm... | |
0.000 -2
os-c3-os-c3 1 0.970 180.000 1
c3-ss-ss-c3 1 3.150 0.000 -2 c226,p2 GA AUE=0.4785 RMSE=0.5249 TorType=2
c3-ss-ss-c3 1 0.890 0.000 3 c226,p2 GA AUE=0.4785 RMSE=0.5249
o -c -c3-hc 1 0.830 0.000 -1 CH3COO,CH3COOH GA AUE=0.0144 RMSE=0.0193 TorType=2
o -c -c3-hc 1 0.040 180.000 3
ho-oh-c3-c3 1 0.000 0.000 3 m19 SS A... | |
should be C-contiguous. False otherwise.
@rtype: Mat
@returns: A copy that is contiguous (c or f) and has begin 0.
"""
if self.use_opencl:
result = self._map('', c_contiguous=c_contiguous)
else:
result = Mat(self.computer,
self.NP.copy(order='C' if c_contiguous else 'F'))
return result
def empty_copy(self):
... | |
Repo
# and SharedRepo
r = get_repo(r_id)
if not r:
continue
r.repo_id = r.id
r.repo_name = r.name
r.repo_desc = r.desc
cmmts = get_commits(r_id, 0, 1)
last_commit = cmmts[0] if cmmts else None
r.last_modified = last_commit.ctime if last_commit else 0
r._dict['share_type'] = 'group'
r.user = seafile_api.get_... | |
"bUXu": -595, " paX": -596,
"taiX": -597, "gzaX": -598, "draX": -599,
"mX": -600, "lIXil": -601, " IXl": -602,
"IXaz": -603, " biX": -604, "Xro": -605,
"Xland ": -606, "aXun": -607, "aXuc": -608,
"aXle": -609, "guX": -610, "Xai": -611,
"Xui": -612, "leXen ": 613, " naXa": -614,
"bliXd": 615, "Xmati": -616, " IXn... | |
inputdata["AirHandlingSystem"][ahu_name]["AirHeatExchangerPowerConsumption"] = 0
for unit_id, unit_configure in enumerate(inputdata["AirHandlingSystem"][ahu_name]["AirHandlingUnit"]):
if unit_configure["AirHeatExchangerPowerConsumption"] != None:
inputdata["AirHandlingSystem"][ahu_name]["AirHeatExchangerPowerConsump... | |
#!/usr/bin/env python3
#
# Automated tests for running proxy simulations.
# See `--help` for more information.
#
#/*
# * Licensed to the EPYSYS SCIENCE (EpiSci) under one or more
# * contributor license agreements.
# * The EPYSYS SCIENCE (EpiSci) licenses this file to You under
# * the Episys Science (EpiSci) Public L... | |
''')
# XX /r load with index and no offset.
ldWithIndex = TailRecipe(
'ldWithIndex', LoadComplex, base_size=2,
ins=(GPR, GPR),
outs=(GPR),
instp=IsEqual(LoadComplex.offset, 0),
clobbers_flags=False,
compute_size="size_plus_maybe_offset_for_in_reg_0",
emit='''
if !flags.notrap() {
sink.trap(TrapCode::HeapOutOf... | |
<gh_stars>0
#!/usr/bin/env python3
"""Test config parsing"""
import logging
import re
import shutil
import tempfile
import os
import unittest
from faucet import config_parser as cp
LOGNAME = '/dev/null'
class TestConfig(unittest.TestCase): # pytype: disable=module-attr
"""Test config parsing raises correct excep... | |
= ExternalCircuit(top, solverE, total_rho, collector_voltage, cathode_area * 1e4, plate, debug=False)
plate.voltage = circuit
# plate.voltage = collector_voltage
if install_grid:
if grid_scraper == "regular":
fastscraper_flag = 0
collectlpdata_flag = 1
elif grid_scraper == "fast":
fastscraper_flag = 1
collect... | |
<gh_stars>10-100
#!/usr/bin/python
# Copyright 2017 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... | |
import cgi
import logging
import os
import sys
import tempfile
import threading
from http import HTTPStatus
from http.server import __version__ as http_version, HTTPServer, SimpleHTTPRequestHandler # noqa
# Use from..import for importlib as it needs to bootstrap some stuff before "util" etc works, which import doesn't ... | |
<reponame>steven-rr/AE8843<gh_stars>0
import random
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
from scipy import integrate
from scipy import linalg as LA
import cvxpy as cp
# generate seed for random generator
random.seed(239)
class RLdMPC:
# State indices
x... | |
<reponame>Wappsto/python-wappsto-iot
import datetime
import itertools
import json
import socket
import threading
import time
import traceback
import uuid
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
from pydantic import BaseModel
from p... | |
<filename>CHEBYSHEV/TVB_Method/cheb_class.py
import numpy as np
import itertools
from numpy.polynomial import chebyshev as cheb
"""
Module for defining the class of Chebyshev polynomials, as well as various related
classes and methods, including:
Classes:
-------
Polynomial: Superclass for MultiPower and MultiCh... | |
<reponame>fredstro/sage
r"""
Listing Sage packages
This module can be used to see which Sage packages are installed
and which packages are available for installation.
For more information about creating Sage packages, see
the "Packaging Third-Party Code" section of the
Sage Developer's Guide.
Actually installing the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.