input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
pytest.mark.xfail(__test, raises=librosa.ParameterError)
yield tf, None, 22050, 22050, 1, None
yield tf, 440, 22050, None, None, np.pi
for sr in [11025, 22050]:
for length in [None, 22050]:
for duration in [None, 0.5]:
for phi in [None, np.pi]:
if length is not None or duration is not None:
yield __test, 440, ... | |
self.commanders:
p = root.insertAfter()
p.h = g.shortFileName(commander.fileName())
p.b = '@language rest\n@wrap\n'
self.create_inner_outline(commander, kind, p)
#
# Clean all dirty/changed bits, so closing this outline won't prompt for a save.
for v in c.all_nodes():
v.clearDirty()
c.setChanged(changedFlag=Fa... | |
argument
to the `~astropy.time.Time` initializer, so it can be anything that
`~astropy.time.Time` will accept (including a `~astropy.time.Time`
object)
which : {'next', 'previous', 'nearest'}
Choose which noon relative to the present ``time`` would you
like to calculate
n_grid_points : int (optional)
The numb... | |
# Released under the MIT License. See LICENSE for details.
#
"""Documentation generation functionality."""
# pylint: disable=too-many-lines
from __future__ import annotations
import os
import datetime
import inspect
import subprocess
from dataclasses import dataclass
from typing import TYPE_CHECKING, Union, cast
fro... | |
access permissions
for the file owner, the file owning group, and others. Each class may
be granted read, write, or execute permission. The sticky bit is also
supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g.
0766) are supported.
:type posix_permissions: str
:param posix_acl: Sets POSIX access... | |
"""
The Cuspidal Subspace
EXAMPLES::
sage: S = CuspForms(SL2Z,12); S
Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 for
Modular Group SL(2,Z) of weight 12 over Rational Field
sage: S.basis()
[
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6)
]
sage: S = CuspForms(Gamma0(33),2); S
... | |
import sys
'''
This python script generates a pymol script that colors a PDB file according to values given for each nucleic acid residue. The
format of the input is expected to be a simple 2-column text file, where the two numbers are separated by a space. The first
column should be integers that correspond to the ... | |
# -*- coding: utf-8 -*-
"""
The most basic (and standard) Rest Resource
we could provide back then
"""
from datetime import datetime
from flask import current_app, make_response
from flask_restful import request, Resource, reqparse
from flask_apispec import MethodResource
from jsonschema.exceptions import ValidationE... | |
discrete_instrument=discrete_instrument, discrete_treatment=discrete_treatment,
categories=categories,
n_splits=n_splits, random_state=random_state)
class _ProjectedDMLATEIVModelNuisance:
def __init__(self, model_Y_W, model_T_W, model_T_WZ):
self._model_Y_W = clone(model_Y_W, safe=False)
self._model_T_W = clone(... | |
#
# 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 writing, software
# distributed under the ... | |
"""
Created on April, 2019
@author: <NAME>
Toolkit functions used for processing training data.
Cite:
<NAME>, et al. "Cooperative Holistic Scene Understanding: Unifying 3D Object, Layout,
and Camera Pose Estimation." Advances in Neural Information Processing Systems. 2018.
"""
import numpy as np
from scipy.spatial... | |
<filename>topi/python/topi/mali/conv2d.py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Vers... | |
948, "gercX": 949,
"me zX": 950, " cXss": 951, "rXnin": 952, "ktXtu": 953, " alX": 954,
"bXlem": -955, "eur X": 956, "i alX": 957, "tasX ": 958, "U Xct": 959,
" gXts": -960, "I Xs ": 961, "algXl": 962, "3 tX ": 963, " tXrt": 964,
"UrzX ": 965, "UnCtX": 966, "UltmX": 967, "UrCtX": 968, "t Xs ": 969,
"dOksX": 970, "... | |
#BEWARE: automatically generated code
#This code was generated by /generate/__main__.py
from opengl.gl.raw.bindings import *
@accepts(t.enum)
@returns(t.void)
@binds(dll)
def active_texture(texture):
'''
select active texture unit.
gl.active_texture selects which texture unit subsequent texture state calls
will... | |
<reponame>OGalOz/cello<gh_stars>0
# -*- coding: utf-8 -*-
#BEGIN_HEADER
import os
import shutil
import logging
import re
from Bio import SeqIO
from biokbase.workspace.client import Workspace
from installed_clients.KBaseReportClient import KBaseReport
from installed_clients.DataFileUtilClient import DataFileUtil
from in... | |
<reponame>czq142857/DECOR-GAN
import numpy as np
import cv2
import os
from scipy.io import loadmat
import random
import time
import math
import binvox_rw
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
from torch.autograd import Variable
... | |
# Copyright (c) 2020-present, <NAME>
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree
#
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import random
from autoattack.other_utils im... | |
# # #
def rsp( A , params , b=None ) :
""" random sample preconditioner """
if params['improve_start_point'] and ( b is None ) :
raise ValueError( 'rsp needs b to improve starting point' )
m , n = A.shape
mm = m
times = 0
timing = {}
B = A.copy()
timing['qr_time'] , timing['condest_t... | |
# or the mouse scrollwheel was used; in all cases first_cmd = +n or -n, where n is an integer
# representing scroll speed; second_cmd = 'pages|units', where pages means scroll entire pages at a
# time and units is the normal scroll
else:
# Empty area in scrollbar was clicked
if second_cmd == 'pages':
num_total_... | |
<reponame>FloorBroekgaarden/NSBH_GW200105_and_GW200115
# from __future__ import print_function
# from __future__ import division # undo if in Python 2
import numpy as np
import matplotlib.pyplot as plt
import h5py as h5
import time
import sys
import copy
#Quick fudge to make import from ../Scripts work
import sys
sys.... | |
sentence text length. This value depends on the value of the
`string_index_type` parameter set in the original request, which is UnicodeCodePoints
by default.
:ivar int offset: The sentence text offset from the start of the document.
The value depends on the value of the `string_index_type` parameter
set in the or... | |
# use ttmean to calculate the pvalue
# first, convert to standard normal distribution values
# old method: directly calculate the theta
tt_theta=[(ttmean[i]-tabc_mean[i])/math.sqrt(tabc_adjvar[i]) for i in range(n)]
if False:
# new method 1: use logP to replace theta
tt_p_lower_small_nz=min([x for x in tt_p_lowe... | |
LCID, 1, (24, 0), (),)
def Close(self):
'Close image'
return self._oleobj_.InvokeTypes(2, LCID, 1, (24, 0), (),)
def Copy(self, ImageFrom=defaultNamedNotOptArg):
'Copy image to another image'
return self._oleobj_.InvokeTypes(20, LCID, 1, (24, 0), ((9, 0),),ImageFrom
)
def CopyToClipboard(self):
'Copy... | |
report generation...")
print("L.. Word reports can take a while if you had a lot of recipients.")
self.output_word_report = self._build_output_word_file_name()
self.write_word_report()
else:
print("[!] Could not find the template document! Make sure 'template.docx' is in the GoReport directory.")
sys.exit()
elif... | |
# from . import BrowserState
from PyQt5 import QtCore
import enum
import collections
import re
import functools
import numbers
import sys
# pip install python-Levenshtein
import Levenshtein
# Parse a string entered by the user into a mongo query dictionary.
# Raises a ValueError if the query is malformed
def parse_... | |
= util.remove_df_levels(util.DfOper.mult([dist_storage_df, self.distribution_losses,self.transmission_losses]), 'dispatch_feeder')
distribution_df.columns = [cfg.calculation_energy_unit.upper()]
charge_df = util.df_slice(distribution_df,'charge','charge_discharge')
charge_df = self.outputs.clean_df(charge_df)
charg... | |
# Copyright 2018 The TensorFlow Probability 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 applicable law or ag... | |
Transmittance at Normal Incidence"]
@shade_beamdiffuse_visible_transmittance_at_normal_incidence.setter
def shade_beamdiffuse_visible_transmittance_at_normal_incidence(
self,
value=None):
""" Corresponds to IDD field `Shade Beam-Diffuse Visible Transmittance at Normal Incidence`
"""
self[
"Shade Beam-Diffuse ... | |
level(*args, **kwargs):
pass
def levelOneFaceAsLong(*args, **kwargs):
pass
def levelOneFaceId(*args, **kwargs):
pass
def levelOneFaceIdFromIndex(*args, **kwargs):
pass
def levelOneFaceIdFromLong(*args, **kwargs):
pass
def levelOneFaceIndexFromId(*args, **kwargs):
pass
def nonBaseFace... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
#!/usr/local/bin/python
from Color import *
def HASH(s):
L = '# '
L = L + s
if len(L) < 78:
L = L + (78-len(L))*' '
else:
print('The length of the string given is no smaller than 78')
L = L + '#'
return L
printYellowRed(u'Advanced Funciton Topics\n')
print... | |
ref_set_pref_dict['ref_set_file_name']
num_objs = ref_set_pref_dict['num_objs']
except KeyError:
ref_set_file_name = None
num_objs = None
try:
num_dec_vars = ref_set_pref_dict['num_dec_vars']
except KeyError:
pass
try:
unit_conv = ref_set_pref_dict['unit_conv']
except KeyError:
unit_conv = None
try:
perc_... | |
initialize=0)
m.x622 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x623 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x624 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x625 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x626 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x627 = Var(within=Reals,... | |
- Error while renaming configuration"
log.I("error correctly detected, no configuration renamed")
log.I("renaming a configuration on a wrong domain name")
new_conf_name = "new_conf"
out, err = self.pfw.sendCmd("renameConfiguration","wrong_domain_name",new_conf_name,"Configuration", expectSuccess=False)
assert out ... | |
import typing as t
from gettext import gettext as _
import click
import click_logging
from click_option_group import optgroup, MutuallyExclusiveOptionGroup
from functools import wraps
import urllib3
import logging
from .logging import logger
from .version import __version__
FC = t.TypeVar("FC", t.Callable[..., t.Any... | |
apix, nproc)
### link / summarize final files
if os.path.islink(os.path.join(rundir, "3d%d_refined.vol" % volnum)):
os.system("rm -rf %s " % os.path.join(rundir, "3d%d_refined.vol" % volnum))
os.symlink(os.path.join("Iter_%d" % count, "Iter_%d_reconstruction.vol" % count),
os.path.join(rundir, "3d%d_refined.vol... | |
self.api_v1_search_node_get_with_http_info(**kwargs) # noqa: E501
def api_v1_search_node_get_with_http_info(self, **kwargs): # noqa: E501
"""api_v1_search_node_get # noqa: E501
Node Search # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asyn... | |
port number as a string
:returns: list of dicts containing the vhost, the matching name, and
the numerical rank
:rtype: list
"""
all_vhosts = self.parser.get_vhosts()
def _vhost_matches(vhost, port):
return self._vhost_listening_on_port_no_ssl(vhost, port)
matching_vhosts = [vhost for vhost in all_vhosts if ... | |
# Original author: <NAME>, UC Irvine, August 12, 2003.
# The original code at http://www.ics.uci.edu/~eppstein/PADS/ is public domain.
"""Functions for reading and writing graphs in the *graph6* format.
The *graph6* file format is suitable for small graphs or large dense
graphs. For large sparse graphs, use the *spars... | |
<gh_stars>0
"""pub_sub_receive.py -- receive OpenCV stream using PUB SUB."""
from parameters import ParticipantData
from parameters import Parameters
from parameters import OutsourceContract
from parameters import Helperfunctions
import json
from merkletools import MerkleTools
import sys
import videoStramSubscriber a... | |
# -*- coding: utf-8 -*-
"""
This module contains the Airtest Core APIs.
"""
import os
import time
from six.moves.urllib.parse import parse_qsl, urlparse
from airtest.core.cv import Template, loop_find, try_log_screen
from airtest.core.error import TargetNotFoundError
from airtest.core.helper import (G, delay_after_op... | |
<gh_stars>1-10
import requests
from bs4 import BeautifulSoup
def ask_anna(text="who are you"):
url = "https://www.pandorabots.com/pandora/talk?botid=e6b3d89abe37ba83"
data = {
"input": text,
"botcust2": "b170873d9e664911"}
html = requests.post(url, data).text
soup = BeautifulSoup(html, 'html.parser')
return so... | |
return "i+%04x, #+%04x, %s - %s" % (self.inode_offset, self.index_delta, itypenames[self.type], self.name)
class DirEntry:
"""
Resolved DirEntry
"""
def __init__(self, inodenum, inodeidx, type, name):
self.inode_number = inodenum
self.inode_index = inodeidx
self.type = type
self.name = name
def oneline(self... | |
code.replace("printStatus", "console.log")
code = code.replace("saveStack()", "0")
code = code.replace("gcPreserveCode()", "gc()")
code = code.replace("platformSupportsSamplingProfiler()", "true")
# Example:
# var OProxy = $262.createRealm().global.Proxy;
# =>
# var OProxy = Proxy;
code = code.replace("$262.cr... | |
#!/usr/bin/env python
import pyglet, pymunk, pymunk.pyglet_util, copy, os, sys, shutil
from math import pi, cos, sin, sqrt
from pyglet.window import key
from pyglet.gl import *
from pymunk import Vec2d, ShapeFilter
from random import seed, randint, choice
from PIL import Image
from puck import Puck
from landmark imp... | |
<gh_stars>0
import numpy as np
import pandas as pd
import pybasicbayes
import pylds.models
from pybasicbayes.util.stats import sample_mniw
from typing import Tuple
from covid_models import AbstractDynamicBias
def VanillaLDS(D_obs, D_latent, D_input=0,
mu_init=None, sigma_init=None,
A=None, B=None, sigma_states=No... | |
# -*- coding: utf-8 -*-
import os
import jwt
import pytz
from restapi.rest.definition import EndpointResource
from restapi import decorators
from restapi.exceptions import RestApiException
from restapi.services.detect import detector
from restapi.services.mail import send_mail, send_mail_is_active
from restapi.confs ... | |
import os
import re
import json
from pprint import pprint
from dateutil.parser import parse
from gen3_etl.utils.ioutils import reader
import hashlib
from datetime import date, datetime
def json_serial(obj):
"""JSON serializer for objects not serializable by default json code"""
if isinstance(obj, (datetime, date)):... | |
import json
import six
try:
import cPickle as pickle
except ImportError:
import pickle
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote
try:
reduce
except NameError:
from functools import reduce
import fnmatch
from gzip import GzipFile
try:
from cStringIO import StringIO
... | |
sha256 =
"5d8156ec8b044a36c2ac789b85bf65116be24304868fff472d033977ebcc1860",
),
"exception-mtl":
struct(
version = "0.4.0.1",
sha256 =
"ec13bcbae6cdde218a7118a2bd3058493af09a330b86e28469a278c9b2cea134",
),
"exception-transformers":
struct(
version = "0.4.0.7",
sha256 =
"925b61eb3d19148a521e79f8b4c8ac097f6e... | |
'').strip()
html = re.sub(r'<span class="v-num"', '<br><span class="v-num"', html, flags=re.IGNORECASE | re.MULTILINE)
if resource != 'ult':
return html
words = self.get_all_words_to_match(resource, chapter, first_verse, last_verse)
verses = html.split('<sup>')
for word in words:
parts = word['text'].split(' ...... | |
import json
from copy import deepcopy
from datetime import timedelta
import pytest
from django_saas_email.models import MailTemplate
from rest_framework import status
from rest_framework.test import APITestCase
from django.conf import settings
from django.contrib.sites.models import Site
from django.core import mail
... | |
(ax_orig_1 - ax_orig_0)
)
if origin == "reversed":
cor_0, cor_1 = cor_1, cor_0
ax_ax.set_xlim(sag_0, sag_1)
ax_ax.set_ylim(cor_1, cor_0)
ax_cor.set_xlim(sag_0, sag_1)
ax_cor.set_ylim(ax_0, ax_1)
ax_sag.set_xlim(cor_0, cor_1)
ax_sag.set_ylim(ax_0, ax_1)
gs = gridspec.GridSpec(
2,
2,
height_ratios=[(cor... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2018-2022 the orix developers
#
# This file is part of orix.
#
# orix is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | |
format:
```
<symbol0> <count0>
<symbol1> <count1>
...
```
"""
d = cls()
d.add_from_file(f, ignore_utf_errors)
return d
def add_from_file(self, f, ignore_utf_errors=False):
"""
Loads a pre-existing dictionary from a text file and adds its symbols
to this instance.
"""
if isinstance(f, str):
try:
if no... | |
#!/usr/bin/env python
"""
Client library to communicate with a OpenRefine server.
"""
# Copyright (c) 2011 <NAME>, Real Programmers. All rights reserved.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fo... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 14 20:04:48 2016
For 6.006 MIT Algorithm I
@author: jasonniu
"""
import time
import random
import sys
sorted_data = []
#A1
def insertion_sort(nums):
# why not O(n^3)?
global sorted_data
n = len(nums)
for i in range(n):
for j in range(i, n):
if nums[j] < nums[i]:
... | |
#!/usr/bin/env python3
from testUtils import Utils
from Cluster import Cluster
from WalletMgr import WalletMgr
from Node import Node
from Node import ReturnType
from TestHelper import TestHelper
from testUtils import Account
import re
import os
import time
import signal
import subprocess
import shutil
##############... | |
If a string is passed in,
this method attempts to create a model reference from a
string using
:func:`google.cloud.bigquery.model.ModelReference.from_string`.
retry (:class:`google.api_core.retry.Retry`):
(Optional) How to retry the RPC.
not_found_ok (bool):
Defaults to ``False``. If ``True``, ignore "not found"... | |
Ventana.
BGimg_Login = pygame.transform.scale(BGimg_Login, RESOLUCION[s_res]) # Cambia la resolucion de la imagen.
Icono = pygame.image.load('images/Icon.png') # Carga el icono del Juego.
btn_delete = Helps.Boton('images/iconos/delete.bmp') # Boton de Ojo Mostrar u Ocultar Password.
btn_show_pass = Hel... | |
& [1]
assert self.cond_4(t199, t184), "Failed postcondition: 'CommonSet.subset(<returned value>, x)'"
assert self.cond_4(t199, [1]), "Failed postcondition: 'CommonSet.subset(<returned value>, y)'"
t200 = t184 ^ [1]
t201 = t184 - [1]
t202 = t166
t202 -= [1]
t203 = t202 == self.get_ex_3()
t204 = len(t202)
t205 =... | |
I1i ) != long ) : I1i = int ( binascii . hexlify ( I1i ) , 16 )
O00oo00o000o = self . remote_public_key
if ( type ( O00oo00o000o ) != long ) : O00oo00o000o = int ( binascii . hexlify ( O00oo00o000o ) , 16 )
O0OOoo = "0001" + "lisp-crypto" + lisp_hex_string ( I1i ^ O00oo00o000o ) + "0100"
if 38 - 38: IiII . o0oOOo0O... | |
"""
Created on Fri Sep 21 16:14:21 2012
@author: eendebakpt
"""
# %% Load necessary packages
from typing import Union, List
import copy
import itertools
import os
import pickle
import platform
import re
import shutil
import sys
import time
import types
from os.path import basename, join
import numpy as np
from colo... | |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import cv2
import torch
import numpy as np
import argparse
import torchvision
from PIL import Image
from tqdm import tqdm
from pathli... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicationRequest) on 2019-01-22.
# 2019, SMART Health IT.
from . import domainresource
class MedicationRequest(domainresource.DomainResource):
"""
O
r
d
e
r
i
n
g
o
f
m
e
d
... | |
red
FG_Green = '32' # ESC [ 32 m # green
FG_Blue = '34' # ESC [ 34 m # blue
#
BG_Yellow = '43' # ESC [ 33 m # yellow
BG_Magenta = '45' # ESC [ 35 m # magenta
BG_Cyan = '46' # ESC [ 36 m # cyan
BG_White = '47' # ESC [ 37 m # white
self.assertTrue(isinstance(Color.FG_Black, Color))
self.assertTrue(isinstance(Col... | |
0.5, 0.1, 0.26096, 134.292],
[700, 1.5, 0.0001, 0.264075, 1922.0675],
[50, 1, 0.01, 0.35354, 200.424],
[500, 0.6, 0.1, 0.277225, 90.7025],
[1, 0.4, 0.001, 0.44334, 375.616],
[400, 5, 0.0001, 0.26774, 1558.12],
[10, 0.2, 0.01, 0.44462, 195.0],
[300, 3, 0.0001, 0.26762, 1884.616],
[50, 1.5, 0.1, 0.38136, 68.446],... | |
* dim, 1)
self.Square = Square()
def forward(self, x_in):
output = x_in
output = F.pad(output, [2, 2, 2, 2])
output = torch.cat([output, output, output], 1)
# print(output.shape)
output = self.conv1(output)
output = self.rb1(output)
output = self.rbc1(output)
output = self.rb2(output)
output = self.rbc2(out... | |
self.body is not None:
result['body'] = self.body.to_map()
return result
def from_map(self, m: dict = None):
m = m or dict()
if m.get('headers') is not None:
self.headers = m.get('headers')
if m.get('body') is not None:
temp_model = SendTemplateInteractiveCardResponseBody()
self.body = temp_model.from_map(m['... | |
<filename>models/snbnmf.py<gh_stars>1-10
"""
Copyright (c) 2020
Author: <NAME>
Institution: Biomedical Informatics group, ETH Zurich
License: MIT License
"""
import pickle
import numpy as np
import numpy.matlib as matlib
import pandas as pd
import tensorflow as tf
import sys
from os.path import join, exists
from os... | |
if optimize:
self.state['last_GP_update'] = self.target_model.n_evidence
def prepare_new_batch(self, batch_index):
"""Prepare values for a new batch.
Parameters
----------
batch_index : int
next batch_index to be submitted
Returns
-------
batch : dict or None
Keys should match to node names in the model. ... | |
coordinates
attackcoordinatey=y2
if direction=="right":screen.blit(cpics[frame],(x1,y1-cpics[frame].get_size()[1])) #bliting character
else: screen.blit(transform.flip(cpics[frame],x1,0),(x1,y1-cpics[frame].get_size()[1]))
if direction=="right":screen.blit(cpics[frame+21],(attackcoordinatex-25,attackcoo... | |
"""
nodeInfoDict = self.nodeInfoDict
edgeInfoDict = self.edgeInfoDict
edgeIndexList = self.edgeIndexList
numOfNodes = len([node for node in nodeInfoDict if 'argsIndex' in nodeInfoDict[node]])
numOfEdges = len([edgeIndex for edgeIndex in edgeIndexList if 'argsIndex' in edgeInfoDict[edgeIndex]])
velocityPressure = ... | |
endInd = startInd
# Initialize counter for braces (to avoid problems with nested objects)
braceCount = 0
for c in self.strModel[startInd:]:
# Increment the index
endInd += 1
# To avoid troubles with nested objects, keep track of braces
if c == '{':
braceCount += 1
elif c == '}':
braceCount -= 1
# Break... | |
<filename>vespa/interfaces/inline/vespa_inline_engine.py
# Python modules
from __future__ import division, print_function, absolute_import
import os
import io
import sys
import datetime
import traceback
# 3rd party modules
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
from matplotlib.backends.backend_p... | |
<gh_stars>0
import numpy as np
import scipy.io as spio
import gzip
import tensorflow as tf
"""Simple wrap counter: grabs chunks of indices, repermuted after every pass"""
class wrapcounter():
def __init__(self, gap, length, shuffle=True, seed=None):
self.gap = gap
self.length = length
self.order = np.arange(leng... | |
<reponame>JestyDS/awx<filename>awx/main/isolated/manager.py
import fnmatch
import json
import os
import shutil
import stat
import tempfile
import time
import logging
import yaml
from django.conf import settings
import ansible_runner
import awx
from awx.main.utils import (
get_system_task_capacity
)
logger = logging... | |
<filename>code/tools/run_viz_video_old.py<gh_stars>100-1000
from __future__ import absolute_import, division, print_function
import argparse
import importlib
import itertools
import time
from multiprocessing import Pool
import numpy as np
import os
import pdb
import pickle
import subprocess
import sys
import tensorfl... | |
not has_notnull):
# the column is new or it becomes required; initialize its values
if model._table_has_rows():
model._init_column(self.name)
# flush values before adding NOT NULL constraint
model.flush([self.name])
if self.required and not has_notnull:
model.pool.post_constraint(sql.set_not_null, model._cr, mo... | |
else:
# use the same kpoints file and build from the old
# incar
self.kpoints = Kpoints.from_file(
pos + os.sep + 'KPOINTS')
# decide on how to use incar, use same one or
# update or afresh
if self.reuse_incar == 'old':
incar_dict = Incar.from_file(
pos + os.sep + 'INCAR').as_dict()
elif self.reuse_incar == '... | |
Don't set immutability to form as that's the lowest immutability level
if cell.immutability == SubmissionSource.FORM:
cell.pop_immutability()
# copy attributes from the existing into the patch (they'll later be removed by diff)
# required for process_entry
existing = use_evidence[cell.e_key]
if not cell.has_cha... | |
method, url, body, headers):
request = ET.fromstring(body)
if request.tag != "{urn:didata.com:api:cloud:types}powerOffServer":
raise InvalidRequestError(request.tag)
body = self.fixtures.load(
'server_powerOffServer_INPROGRESS.xml')
return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK])
def _caas... | |
import csv
import json
import numpy as np
import pandas as pd
from pathlib import Path
from typing import Dict, List, Optional, Tuple
from xml.sax.saxutils import escape
__file_dict_required_keys = ['sas7bdat_file', 'export_file',]
def batch_to_csv(file_dicts: List[Dict[str, str]]) -> None:
"""
Converts a batch ... | |
<reponame>karthikbadam/facetnotes
import sys
import os
import shutil
import time
import traceback
import json
from datetime import datetime
from math import sqrt
import random
import pickle
## database and server
import pymongo
from flask import Flask
from flask import request, render_template, send_from_directory, j... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
3 Halong
class ATLDisdikSMPN3Halong(ATL):
class Meta:
proxy = True
verbose_name = "07 ATL Disdik SMPN 3 Halong"
verbose_name_plural = "07 ATL Disdik SMPN 3 Halong"
def __unicode__(self):
return self.nama_barang
class HargaATLDisdikSMPN3Halong(HargaATL):
class Meta:
proxy = True
verbose_name = "07 Harga A... | |
[("Rain", 1, SP)],
[("Rain of Nuts", 1, SP)],
[("Rejuvenate Plant", 1, SP)],
[("Remember Path", 1, SP)],
[("Resist Cold", 1, SP)],
[("Resist Lightning", 1, SP)],
[("Resist Pressure", 1, SP)],
[("Snow", 1, SP)],
[("Snow Shoes", 1, SP)],
[("Summon Elemental", 1, SP)],
[("Tangle Growth", 1, SP)],
[("Walk Throug... | |
<reponame>Swapratim/edupreneurbot
#!/usr/bin/env python
from __future__ import print_function
from future import standard_library
import requests
standard_library.install_aliases()
import urllib.request, urllib.parse, urllib.error
import json
import os
import sys
from flask import Flask
from flask import request, ren... | |
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
from random import randint
def get_sp():
client_credentials_manager = SpotifyClientCredentials()
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
return sp
def get_artist():
sp = get_sp()
year1, year2 = get_random_yea... | |
"""
pyAero_problem
"""
# =============================================================================
# Imports
# =============================================================================
import numpy
import warnings
from .ICAOAtmosphere import ICAOAtmosphere
from .FluidProperties import FluidProperties
from .uti... | |
# Unit tests for CableCamShot
import math
import mock
from mock import call
from mock import Mock
from mock import patch
import os
from os import sys, path
from pymavlink import mavutil
import struct
import unittest
from dronekit import LocationGlobalRelative, Vehicle
sys.path.append(os.path.realpath('..'))
import loc... | |
@property
def tcm_cost_participation_rate15_pct(self) -> dict:
return self.__tcm_cost_participation_rate15_pct
@tcm_cost_participation_rate15_pct.setter
def tcm_cost_participation_rate15_pct(self, value: dict):
self._property_changed('tcm_cost_participation_rate15_pct')
self.__tcm_cost_participation_rate15_pct =... | |
del x[i:j]
Use of negative indices is not supported.
"""
pass
def __getitem__(*args, **kwargs):
"""
x.__getitem__(y) <==> x[y]
"""
pass
def __getslice__(*args, **kwargs):
"""
x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
"""
pass
def __iadd__(*args, **kw... | |
weight_variable([hidden, noutputs]),
}
b = {
"conv1": bias_variable([nkernels[0]]),
"conv2": bias_variable([nkernels[1]]),
"conv3": bias_variable([nkernels[2]]),
"conv4": bias_variable([nkernels[2]]),
"conv5": bias_variable([nkernels[2]]),
"conv6": bias_variable([nkernels[2]]),
"conv7": bias_variable([... | |
len([p for p in placed if p <= lowest])
lowest_cnt = 37 - len(placed) + partial
if lowest_cnt == 0:
continue
larger = [p for p in placed if p > lowest]
if larger:
next_larger = min(larger)
can_replicate = min(next_larger - lowest - 1,
remaining_budget / lowest_cnt)
else:
can_replicate = remaining_budget / lo... | |
<reponame>httpsgithu/python-client
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make... | |
<gh_stars>0
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["ExampleServicePlaceCodes"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class ExampleServicePlaceCodes:
"""
Example Service Place Codes
Thi... | |
from collections import defaultdict
from matplotlib import rc
rc('text', usetex=True)
from matplotlib import rcParams
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = 'Helvetica'
# This runs into an issue under Mac OS X, thus the workaround.
try:
import matplotlib.pyplot as plt
except ImportError:... | |
5 -5 # GLSS --> Z3SS BT BB
8.83785486E-02 3 1000025 6 -6 # GLSS --> Z3SS TP TB
1.43218471E-03 2 1000035 21 # GLSS --> Z4SS GL
7.74438493E-04 3 1000035 2 -2 # GLSS --> Z4SS UP UB
8.59454332E-04 3 1000035 1 -1 # GLSS --> Z4SS DN DB
8.59454332E-04 3 1000035 3 -3 # GLSS --> Z4SS ST SB
7.74438493E-04 3 1000035 4... | |
# -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.