input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
anymore. The state of the instance could be persisted on the host
and allocate storage space this way. A "softer" way of `suspend`
is :func:`pause`. The counter action for `suspend` is :func:`resume`.
:param nova.context.RequestContext context:
The context for the suspend.
:param nova.objects.instance.Instance in... | |
import io
from pathlib import Path
from textwrap import dedent
import numpy as np
import openpyxl
import pandas as pd
import pytest
from pytest import fixture, raises
try:
from openpyxl.worksheet.worksheet import Worksheet
except ImportError:
# openpyxl < 2.6
from openpyxl.worksheet import Worksheet
from openpyxl i... | |
dict((k, v.open()) for (k, v) in inputs.items())
variable, operator = self._get_var_and_op()
ds = objects.integrate.integrate(
objects=da_objects, variable=variable, operator=operator, **kwargs
)
ds.to_netcdf(self.output().fn)
class ComputePerObjectAtHeight(luigi.Task):
"""
For each object defined by `mask_m... | |
#TODO: TMP
# import sys
# sys.path.append('../')
# from dataops.colors import ycbcr_to_rgb, yuv_to_rgb
import os #, glob
import random
import numpy as np
import cv2
import torch
from torch.utils.data.dataset import Dataset
import dataops.common as util
from dataops.augmentations import Scale, NoisePatches, RandomNois... | |
rotation_velocity (float): Rotation velocity of the rotor
pitch_deg (float): pitch angle in degrees
excel_file_name (str):
excel_sheet_structural_blade (str):
excel_sheet_aero_blade (str):
excel_sheet_airfoil_coord (str):
excel_sheet_parameters (str):
excel_sheet_structural_tower (str):
m_distribution (str):
n... | |
]
if MYSQL:
query = f"""
SELECT COUNT(*) cnt
FROM midi_files
{where}
LIMIT {Select_Limit}
"""
if SQLITE:
if FULLTEXT:
query = f"""
SELECT COUNT(*) cnt
FROM midi_files_fts
{where}
LIMIT {Select_Limit}
"""
else:
query = f"""
SELECT COUNT(*) cnt
FROM midi_files
{where}
LIMIT {Select_Limit}
"""
que... | |
<filename>Publication/DONE_SuppFig12.py
,import os
import sys
import pandas as pd
from Bio import SeqIO
import matplotlib.pyplot as plt
import matplotlib as mpl
import scipy.stats as st
import random as rnd
import numpy as np
#
#
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
... | |
<gh_stars>0
import collections
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
import dask
import dask.dataframe as dd
from dask.dataframe.utils import assert_eq, assert_dask_graph, assert_max_deps, PANDAS_VERSION
AGG_FUNCS = ['sum', 'mean', 'min', 'max', 'count', 'size', 'std... | |
if the schema is not valid
"""
def __init__(self, descriptor, project=None):
self.descriptor = descriptor
self.schema_model = TableSchema(descriptor, strict=True)
self.fields = [SchemaField(f.descriptor) for f in self.schema_model.fields]
self.foreign_keys = [SchemaForeignKey(fk) for fk in
self.schema_model.for... | |
= self.features_34(features_33)
features_35 = self.features_35(features_34)
features_36 = self.features_36(features_35)
layers = []
layers.append(features_0)
layers.append(features_1)
layers.append(features_2)
layers.append(features_3)
layers.append(features_4)
layers.append(features_5)
layers.append(feature... | |
bo.append(np.nan)
# print('lack one')
#Total Test:Positive Ratio
bo.append(int(bo[3])/int(bo[13]))
#New Positive
try:
bo.append((int(bo[3])-int(bo1[3]))/(int(bo[13])-int(bo1[13])))
except:
bo.append(np.nan)
# print('lack one')
#Case Fatality Rate%
try:
if bo[5]=='':
bo.append(0)
else:
bo.append(int... | |
number of labels
if(labels_on):
if( not set_label_strings):
label_strings = ['%d' % i for i in range(ncolors)]
else:
if(len(label_strings) != ncolors):
print("Error: draw_color_palette: invalid number of labels for boxes")
return
#---Calculate X and Y positions of text and box in the view port.
width = 1./ncol... | |
"""Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2019 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | |
**Request Syntax**
::
response = client.list_groups(
MaxResults='string',
NextToken='string'
)
**Response Syntax**
::
{
'Groups': [
{
'Arn': 'string',
'CreationTimestamp': 'string',
'Id': 'string',
'LastUpdatedTimestamp': 'string',
'LatestVersion': 'string',
'LatestVersionArn': 'string',
'Name': 'str... | |
data
@self.console_option("filter", "f", type=str, help="Filter indexes")
@self.console_argument(
"color", type=Color, help=_("Color to color the given stroke")
)
@self.console_command(
"stroke",
help=_("stroke <svg color>"),
input_type=(
None,
"elements",
),
output_type="elements",
)
def element_stroke(... | |
<filename>NLI/models.py
import numpy as np
import time
import torch
import torch.nn as nn
from torch.nn import init
class SememeSumLstm(nn.Module):
def __init__(self, sememe_dim, mem_dim):
super(SememeSumLstm, self).__init__()
self.in_dim = sememe_dim
self.mem_dim = mem_dim
self.ioux = nn.Linear(self.in_dim, 3 *... | |
<filename>utils/PSIS/py/psis.py
"""Pareto smoothed importance sampling (PSIS)
This module implements Pareto smoothed importance sampling (PSIS) and PSIS
leave-one-out cross-validation for Python (Numpy).
Included functions
------------------
psisloo
Pareto smoothed importance sampling leave-one-out log predictive de... | |
<gh_stars>0
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2020-2021 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
# File: bitMapping.py
# Author: <NAME>
# Cr... | |
encodings[level][
:, :, int(start / (level // 8)) : int(start / (level // 8)) + 250,
],
distenc if iii == 0 else torch.flip(distenc, [2, 3]),
)
return pred
preds = []
starts = [0]
ns = {}
if targets and iii == 0:
ts = []
if annotation is not None and iii == 0:
annos = []
for j, level in enumerate([256, 1... | |
order.
nquads.sort()
# 5) Return the hash that results from passing the sorted, joined
# nquads through the hash algorithm.
info['hash'] = self.hash_nquads(nquads)
return info['hash']
# helper for modifying component during Hash First Degree Quads
def modify_first_degree_component(self, id_, component, key):
... | |
<filename>explainy/explanations/counterfactual_explanation.py<gh_stars>1-10
"""
Counterfactual Explanation
--------------------------
Counterfactual explanations tell us how the values of an instance have to change to
significantly change its prediction. A counterfactual explanation of a prediction
describes the smal... | |
and time weights are used.
work_dir: str (default: ~/work)
Root directory to save all other files (mainly ``*.nc`` files).
write_plots: bool (default: True)
If ``False``, do not write any plot.
"""
import importlib
import logging
import os
from copy import deepcopy
from inspect import getfullargspec
from pprint imp... | |
4527",
52665: "4366 4463 4528",
52666: "4366 4463 4529",
52667: "4366 4463 4530",
52668: "4366 4463 4531",
52669: "4366 4463 4532",
52670: "4366 4463 4533",
52671: "4366 4463 4534",
52672: "4366 4463 4535",
52673: "4366 4463 4536",
52674: "4366 4463 4537",
52675: "4366 4463 4538",
52676: "4366 4463 4539",
... | |
target we're heading north
# tan(bet) = tan(sig) * cos(alp)
ssig1 = sbet1; csig1 = calp1 * cbet1
ssig2 = sbet2; csig2 = calp2 * cbet2
# sig12 = sig2 - sig1
sig12 = math.atan2(max(csig1 * ssig2 - ssig1 * csig2, 0.0),
csig1 * csig2 + ssig1 * ssig2)
s12x, m12x, dummy, M12, M21 = self.Lengths(
self._n, sig12, ss... | |
# -*- coding: utf-8 -*-
r"""
Hyperbolic Points
This module implements points in hyperbolic space of arbitrary dimension.
It also contains the implementations for specific models of
hyperbolic geometry.
This module also implements ideal points in hyperbolic space of arbitrary
dimension. It also contains the implementa... | |
snapshot files and folders
self.check_restricted_access(tool.snapshots)
self.check_restricted_access(snapshot)
for obj in snapshot.objectValues():
self.check_restricted_access(obj)
if hasattr(aq_base(obj), 'objectValues'):
for child in obj.objectValues():
self.check_restricted_access(child)
def test_applyConte... | |
s):
self.cpu = c
self.sub = s
def is_64_bit(self):
return (self.cpu & CPU_ARCH_ABI64) != 0
cpu_infos = [
["arm64", CPU_TYPE_ARM64, 2],
["x86_64", CPU_TYPE_X86_64, 3],
["x86_64", CPU_TYPE_X86_64, CPU_TYPE_ANY],
]
def __str__(self):
for info in self.cpu_infos:
if self.cpu == info[1] an... | |
)
self._Execute( 'CREATE TABLE services ( service_id INTEGER PRIMARY KEY, service_key BLOB_BYTES, service_type INTEGER, name TEXT, port INTEGER, dictionary_string TEXT );' )
self._Execute( 'CREATE TABLE accounts ( account_id INTEGER PRIMARY KEY, service_id INTEGER, account_key BLOB_BYTES, hashed_access_key BLOB... | |
<filename>DonkiDirector/DataServer.py<gh_stars>0
# -*- coding: utf-8 -*-
import sys
import threading
import multiprocessing
import time
import traceback
import zmq
import numpy
from hdfwriter import HDFWriter
from metadatahandler import MetaDataHandler
HDFWTHREADS = 1
MAX_HDFWTHREADS = 3
HDF5FILESIZE = 15
_dbg = T... | |
+ 2]]] + 1
if sum(tmpCode) != 0:
tmpCode = [i / sum(tmpCode) for i in tmpCode]
code = code + tmpCode
encodings.append(code)
return encodings
def DDE(seq):
AA = 'ACDEFGHIKLMNPQRSTVWY'
myCodons = {
'A': 4,
'C': 2,
'D': 2,
'E': 2,
'F': 2,
'G': 4,
'H': 2,
'I': 3,
'K': 2,
'L': 6,
'... | |
<filename>CreditTool_2.py<gh_stars>0
"""
Name: CreditTool_2.py
Author: <NAME>
Created: April 25, 2019
Revised: April 25, 2019
Version: Created using Python 2.7.10, Arc version 10.4.1
Requires: ArcGIS version 10.1 or later, Basic (ArcView) license or better
Spatial Analyst extension
The provided Map_Units feature clas... | |
3, 1/2, 1/3],
feature_maps=None,
categories_arr=None,
img_size=None):
self.aspect_ratios = aspect_ratios
self.feature_maps = feature_maps
self.categories_arr = categories_arr
self.num_categories = len(self.categories_arr)
self.img_size = img_size
self.num_priors = compute_num_priors(aspect_ratios)
self.categ... | |
will
only replay all the events, meta data and market data sources will
need to be reloaded as well. An example input file would look like
TRADE|{"timestamp": "2016-12-01 10:00:00", "ccy": "USD", "commission": 2.5, "instrument": "CLZ16", "price": 53.46, "quantity": 100, "multiplier": 1}
TRADE|{"timestamp": "2016-1... | |
/ 2.0,
65909: 1.0 / 2.0,
65910: 1.0 / 2.0,
65911: 2.0 / 3.0,
65912: 3.0 / 4.0,
69243: 1.0 / 2.0,
69244: 1.0 / 4.0,
69245: 1.0 / 3.0,
69246: 2.0 / 3.0,
69714: 1.0,
69715: 2.0,
69716: 3.0,
69717: 4.0,
69718: 5.0,
69719: 6.0,
69720: 7.0,
69721: 8.0,
69722: 9.0,
69723: 10.0,
69724: 20.0,
69725: 30.0,
69726: 40.0,
69727: 50... | |
import collections
import copy
import enum
import functools
import json
import re
import asdl
import attr
from seq2struct import ast_util
from seq2struct.utils import registry
class HoleType(enum.Enum):
ReplaceSelf = 1
AddChild = 2
class MissingValue:
pass
@attr.s
class SeqField:
type_name = attr.ib()
fiel... | |
s = raw_input(prompt)
s = s.lower()
if s == 'quit':
return
elif s == 'f' or s in possible_positions:
if s != 'f':
cond = 1 #condition that this place is not already occupied.
for k in range(len(teachers)):
teacher = teachers[k]
if teacher.schedule[i][j] == s:
print "But one of our teachers (%s) is a... | |
stderr=subprocess.PIPE,
cwd=write_path,
universal_newlines=True,
)
self.watch(mproc)
os.remove(write_path + "/pfg_write_lef.tcl")
# Watch a running process, polling for output and updating the GUI message
# window as output arrives. Return only when the process has exited.
# Note that this process cannot hand... | |
<reponame>tyunist/Kaggle_PKU_Baidu<filename>tools/finetune_RT_NMR_iou.py
"""
Finding camera parameters R, T
Image per batch --> this is not likely to work!!!
"""
import mmcv
from mmcv import imwrite, imread
from skimage import color
import shutil
import glob
import os
import torch
import torch.nn as nn
import numpy as ... | |
<filename>reasoning_layers/mac_layer.py
import tensorflow as tf
from tensorflow.contrib.layers import fully_connected
from my.tensorflow.nn import linear_logits, get_logits, softsel
from tensorflow.python.ops import tensor_array_ops, control_flow_ops
from my.tensorflow.rnn import bidirectional_dynamic_rnn
from my.tenso... | |
s = format_time("size 10, focals " + str(round(1/mediumSet[0][1])) + ", set " + str(len(mediumSet)) + ", maxcard 3, bel", time_function_cannot_be_pickled(nb_iterations, MassFunction.get_max, m.bel, 3, realSet, verbose=False), nb_iterations, timeout)
print(s)
f.write(s + "\n")
s = format_time("size 10, focals " + str... | |
0 , 384 , (3, 0, None, None) , 0 , )),
(( 'RequiredAttendees' , 'RequiredAttendees' , ), 3588, (3588, (), [ (8, 1, None, None) , ], 1 , 4 , 4 , 0 , 388 , (3, 0, None, None) , 0 , )),
(( 'Resources' , 'Resources' , ), 3586, (3586, (), [ (16392, 10, None, None) , ], 1 , 2 , 4 , 0 , 392 , (3, 0, None, None) , 0 , )),
(... | |
<gh_stars>1-10
#!/usr/bin/python
# ----------------------------------------------------------------------------
# Copyright 2018 Intel
# 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:/... | |
'in_downtime': {},
'service_scheduled_downtime_depth': {},
'service_acknowledged': {},
'hostregex': {},
'host_address': {},
'service_active_checks_enabled': {},
'serviceregex': {},
'service_display_name': {},
'check_command': {},
'hoststate': {},
'svcstate': {},
'svchardstate': {},
'opthostgroup': {},
'opt... | |
where this policy or set is
attached
.. attribute:: binding
bindings list
**type**\: list of :py:class:`Binding <ydk.models.cisco_ios_xr.Cisco_IOS_XR_policy_repository_oper.RoutingPolicy.Sets.Prefix.Sets_.Set.Attached.Binding>`
"""
_prefix = 'policy-repository-oper'
_revision = '2015-11-09'
def __i... | |
chain. {}'.format(e))
except ValidationError as e:
self.logger.debug('ValidationError error when importing chain. Error: {}'.format(e))
except ValueError as e:
self.logger.debug('ValueError error when importing chain. Error: {}'.format(e))
except Exception as e:
self.logger.error('tried to import a chain and got ... | |
with other 200+ tests or
any performance degradation for single/multi-process
parsing.
"""
template = """
<group name="service">
service {{ ignore }}
<group name="epipe.{{ service_id }}">
epipe {{ service_id }} customer {{ customer_id }} create
<group name="regular_sdp.{{r_spoke_sdp_id}}**">
spoke-sdp {{ r_s... | |
Any,
NA,
DefaultDialog),
7267: (DL_TIER + 1,
OBSOLETE,
(SupervisorQuest, ToontownGlobals.CashbotMintIntC, 6),
Any,
ToonHQ,
Any,
NA,
DefaultDialog),
7268: (DL_TIER + 1,
Start,
(CogLevelQuest,
ToontownGlobals.CashbotMintIntB,
20,
11),
Any,
ToonHQ,
Any,
NA,
DefaultDialog),
7269: (DL_TIER + 1,
Start,... | |
<reponame>ksk5429/ksk5429.github.io
# -*- coding: utf-8 -*-
"""
Created on Thu May 28 11:59:27 2015
@author: eric
"""
import sqlite3
import json
import sys
import datetime
class ConnectDB:
db_details = {
'name':'nanodb',
'prefix':'nano_',
'type':'SQLite'
}
debug = True
'''
Print Messages
'''
def debug(... | |
#end for
#end if
return self
#end def set_optional
def get(self,key,value=None): # follow dict interface, no plural
if key in self:
value = self[key]
#end if
return value
#end def get
def get_optional(self,key,value=None):
if key in self:
value = self[key]
#end if
return value
#end def get_optional
d... | |
Practicing
# abbreviate parameter names if possible (e.g. rgb = thisPracticing.rgb)
if thisPracticing != None:
for paramName in thisPracticing.keys():
exec(paramName + '= thisPracticing.' + paramName)
# ------Prepare to start Routine "PractInstr"-------
t = 0
PractInstrClock.reset() # clock
frameN = -1
conti... | |
import random, time, datetime
import curses
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class InvalidMoveException(Exception):
def __init__(self, value):
self.value = value
def __s... | |
from statsmodels.compat.python import iterkeys
from statsmodels.regression.linear_model import GLS
import numpy as np
from statsmodels.base.model import LikelihoodModelResults
from scipy import sparse
# http://www.irisa.fr/aladin/wg-statlin/WORKSHOPS/RENNES02/SLIDES/Foschi.pdf
__all__ = ['SUR', 'Sem2SLS']
#probably... | |
<filename>connector/src/yang/connector/gnmi.py
import traceback
import os
import logging
from collections import OrderedDict, Iterable
import base64
import json
from threading import Thread, Event
from time import sleep
from datetime import datetime
from six import string_types
from xml.etree.ElementPath import xpath_t... | |
<filename>graph/lib.py
"""
Common library for Graph Component.
"""
import logging
from typing import List, Dict, Set
from dbas.database import DBDiscussionSession
from dbas.database.discussion_model import Argument, TextVersion, Premise, Issue, User, ClickedStatement, Statement, \
SeenStatement, StatementToIssue, Gra... | |
pageToken = _messages.StringField(2)
parent = _messages.StringField(3, required=True)
class OsconfigProjectsSetIamPolicyRequest(_messages.Message):
r"""A OsconfigProjectsSetIamPolicyRequest object.
Fields:
resource: REQUIRED: The resource for which the policy is being specified.
See the operation documentation ... | |
<reponame>TencentYoutuResearch/PersonReID-TSF<gh_stars>10-100
from __future__ import print_function
import sys
import time
import os.path as osp
from PIL import Image
import cv2
import numpy as np
import random
from collections import defaultdict
from .Dataset import Dataset
from ..utils.utils import measure_time
fro... | |
import os
import shutil
import tempfile
import unittest
from pavilion import config
from pavilion.test_config import PavTest, variables
from pavilion.test_config.test import PavTestError
from pavilion.suite import Suite
class PavTestTests(unittest.TestCase):
TEST_DATA_ROOT = os.path.realpath(__file__)
TEST_DATA_R... | |
there is no match between the key types supported by this index and the ones
accepted by the collection
"""
if not accepted_key_types:
return
if self.supported_key_types.isdisjoint(accepted_key_types):
raise ImplementationError(
'%s can only return keys of type %s' % (
self.__class__.__name__,
', '.join(self.... | |
"""Contains definitions for the preactivation form of Residual Networks.
Residual networks (ResNets) were originally proposed in:
[1] <NAME>, <NAME>, <NAME>, <NAME>
Deep Residual Learning for Image Recognition. arXiv:1512.03385
The full preactivation 'v2' ResNet variant implemented in this module was
introduced b... | |
<gh_stars>0
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: base40.py
# Purpose: Base40/Music21 Pitch/Interval Translator
#
# Authors: <NAME>
#
# Copyright: Copyright © 2009-2010 <NAME> and the music21 Project
# License: LGPL or BSD, see license.txt
#----... | |
'description'
question = self._create_mc_question(description)
# link a skill to the question
skill_graph = SkillGraph.load()
skill = skill_graph.add(Skill.build(SKILL_NAME, SKILL_DESC))
question.dict[SKILLS_KEY] = [skill.id]
models.QuestionDAO.save(question)
skill_map = SkillMap.load(self.course)
questions =... | |
- MS', 'pt': 'Dourados - MS'},
'55673411':{'en': 'Dourados - MS', 'pt': 'Dourados - MS'},
'55673412':{'en': 'Douradina - MS', 'pt': 'Douradina - MS'},
'55673413':{'en': 'Panambi - MS', 'pt': 'Panambi - MS'},
'55673414':{'en': 'Vila Vargas - MS', 'pt': 'Vila Vargas - MS'},
'55673416':{'en': 'Dourados - MS', 'pt': '... | |
"""
Utility functions for generating annulus mesh between start and end loops of points.
"""
from __future__ import division
import copy
from collections.abc import Sequence
from opencmiss.utils.zinc.field import findOrCreateFieldCoordinates
from opencmiss.zinc.element import Element
from opencmiss.zinc.node import N... | |
<filename>pycparserext/ext_c_parser.py
from __future__ import division
import pycparser.c_parser
import pycparser.c_ast as c_ast
try:
import pycparser.ply.yacc as yacc
except ImportError:
import ply.yacc as yacc # noqa: F401
from pycparser.plyparser import parameterized, template
class CParserBase(pycparser.c_pars... | |
"""
- environment with unfixed number of obstacles, env.reset(number of obstacles), maximum number == 50
- action-dim: 6 / 26 actions
- agent.reset_optimizer: leraning rate decay
- reward: projection reward
- add target model, update its weights every target_update epochs
- add force reward for each step by envok... | |
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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-... | |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2017 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
... | |
#!/usr/bin/env python
#
import random
import numpy as np
from copy import copy
from bart_utils import empty, Tree, logsumexp, softmax, check_if_zero, get_children_id
#from itertools import izip, count
from itertools import count
class Particle(Tree):
def __init__(self, train_ids=np.arange(0, dtype='int'), param=emp... | |
import json
import logging
import os
import re
import shutil
import tempfile
from datetime import timedelta
from functools import partial
from pathlib import Path
from typing import List, Dict, Optional, Any, AsyncIterator, Tuple
import pytest
from _pytest.logging import LogCaptureFixture
from aiohttp import ClientTim... | |
<filename>rllib/policy/rnn_sequencing.py
"""RNN utils for RLlib.
The main trick here is that we add the time dimension at the last moment.
The non-LSTM layers of the model see their inputs as one flat batch. Before
the LSTM cell, we reshape the input to add the expected time dimension. During
postprocessing, we dynami... | |
<reponame>timgates42/subversion
#!/usr/bin/env python
#
# svndumpfilter_tests.py: testing the 'svndumpfilter' tool.
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache So... | |
<reponame>mbonsma/PhD-materials
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 28 14:46:00 2021
@author: madeleine
This script loads simulation files and processes them into an array,
then updates all_data.csv
Requires all_data.csv to be available in the same folder
Requires all_params.csv to ... | |
= ds[-2]
else:
vd = ds[-1]
if vd[:4] == 'olev' or vd == 'rho':
gtype = 'o'
nz = self.mcfg['nlo']
elif vd[:4] == 'alev':
nz = self.mcfg['nla']
elif vd in ['slevel']:
nz = self.mcfg['nls']
elif vd in ['snowdepth','sdepth']:
nz = 5
elif vd == 'aslevel':
nz = self.mcfg['nlas']
else:
mlg.prnt( 'Failed to pa... | |
import os
import unittest
import logging
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
from slicer.util import VTKObservationMixin
#
# CombineModels
#
class CombineModels(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.com/Slicer/Slicer/blob... | |
#!/usr/bin/env python
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This is the main of the glideinFrontend
#
# Arguments:
# $1 = work_dir
#
# Author:
# <NAME>
#
import os
import sys
import fcntl
import subprocess
import traceback
import signal
import time
import string
import logging
STARTUP_DIR = ... | |
<filename>Dataflow/full_executer_wordshop.py
# -*- coding: utf-8 -*-
"""Full Executer WordShop.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1kGSQWNtImJknauUN9L8ZRRwIzAdwbmo_
First, we load the pegasus paraphraser.
"""
# Commented out IPython mag... | |
from collections import OrderedDict
import math
from auto_ml import utils
import pandas as pd
from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier
from sklearn.metrics import mean_squared_error, make_scorer, brier_score_loss, accuracy_score, explained_variance_score, mean_absolute_error, ... | |
'string',
'name': 'string',
'description': 'string',
'dataSourceName': 'string',
'requestMappingTemplate': 'string',
'responseMappingTemplate': 'string',
'functionVersion': 'string'
},
],
'NextToken': 'string'
}
**Response Structure**
- *(dict) --*
- **functions** *(list) --*
A list of ``Function`` ob... | |
0, 0, 0, 0],
[1658, 1.063334, 0, 9999, -9999, 1.0, 100, 1, 1.879381, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1659, 42.758003, 0, 9999, -9999, 1.0, 100, 1, 91.77667, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1660, 81.182801, 0, 9999, -9999, 1.0, 100, 1, 186.942171, 0.0, 0, 0, 0, 0, 0, 0... | |
"""Test hook that runs shard splits continuously."""
import copy
import random
import threading
import time
import uuid
import bson
import pymongo.errors
from buildscripts.resmokelib import errors
from buildscripts.resmokelib.testing.fixtures import interface as fixture_interface
from buildscripts.resmokelib.testing... | |
<reponame>grudloff/metric-learn<filename>metric_learn/mmc.py<gh_stars>0
"""Mahalanobis Metric for Clustering (MMC)"""
from __future__ import print_function, absolute_import, division
import warnings
import numpy as np
from six.moves import xrange
from sklearn.base import TransformerMixin
from sklearn.utils.validation i... | |
#!/usr/bin/env python
""" Redis Enterprise Cluster log collector script.
Creates a directory with output of kubectl for
several API objects and for pods logs unless pass a -n
parameter will run on current namespace. Run with -h to see options
"""
import argparse
import json
import logging
import os
import re
import s... | |
<gh_stars>0
#!/usr/bin/python
# -----------------------------------------------------------------------------------------------
# fb_index_diff.py - Functions for the 'Index Management->Index Comparison' tab.
# WRW 7 May 2022 - Move raw index .csv files to 'Raw-Index' and build in 'Raw-Index' folder name here.
# ----... | |
self._nplike
)
self._handle_error(
self._nplike[
"awkward_ListArray_num",
tonum.dtype.type,
self.starts.dtype.type,
self.stops.dtype.type,
](
tonum.data,
self.starts.data,
self.stops.data,
self.length,
)
)
return ak._v2.contents.numpyarray.NumpyArray(
tonum, None, None, self._nplike
)
else:
next = se... | |
-1, -1),
A vertex at (1, -1, 1),
A vertex at (1, 1, -1)]
sage: P = polytopes.permutahedron(5)
sage: P.an_affine_basis()
[A vertex at (1, 2, 3, 5, 4),
A vertex at (2, 1, 3, 5, 4),
A vertex at (1, 3, 2, 5, 4),
A vertex at (4, 1, 3, 5, 2),
A vertex at (4, 2, 5, 3, 1)]
The method is not implemented for unbounde... | |
e.g., (500, str('K')).
T_max (tuple): The maximum temperature for kinetics computations, e.g., (3000, str('K')).
T_count (int): The number of temperature points between ``T_min`` and ``T_max``.
max_job_time (float): The maximal allowed job time on the server in hours (can be fractional).
rmg_database (RMGDatabase):... | |
ValueError("Axis out of bounds")
self.axis = axis
# Allow rotation of only subset of elements/slices
self.D = X.dims[0][axis]
if subset is None:
#self.subset = np.ones(self.D, dtype=bool)
self.subset = None #tuple(range(self.D))
else:
#self.subset = tuple(range(self.D))
self.subset = subset #self.subset[subse... | |
= 'L1003'
response['message'] = '认证失败'
return response
else:
high_queue.enqueue_call(queue_target_list, args = (username_result['username'], target_list, request['description'], mysqldb,), timeout = 7200000)
response['code'] = 'L1000'
response['message'] = '请求成功'
return response
except Exception as e:
print(e)... | |
= math.sqrt(count * (count + 1) * (2.0 * count + 1.0) / 24.0)
z = math.fabs(wt - mn) / se
prob = 2 * (1.0 - zprob(abs(z)))
return wt, prob
def kruskalwallish(*args):
"""
The Kruskal-Wallis H-test is a non-parametric ANOVA for 3 or more
groups, requiring at least 5 subjects in each group. This function
calculates ... | |
target set, when None (default) the target_name
will be set equal to the name
>>> from amuse.datamodel import Particles
>>> from amuse.units import units
>>> particles1 = Particles(2)
>>> particles2 = particles1.copy()
>>> particles1.mass = 1 | units.m
>>> particles2.mass = 3 | units.m
>>> channel = particles1... | |
selection)
columns = sorted(index.column() for index in selection)
rowcount = rows[-1] - rows[0] + 1
colcount = columns[-1] - columns[0] + 1
table = [[''] * colcount for _ in range(rowcount)]
for index in selection:
row = index.row() - rows[0]
column = index.column() - columns[0]
table[row][column] = index.data... | |
# Copyright 2017 Intel Corporation
#
# 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... | |
"""
NeuronBuild | <NAME> | 2013 | <EMAIL>
version date: January 26, 2020
A script to import swc files downloaded from neuromorpho.org, and create accurate
spline-based models of neuronal structure. The original swc file format is detailed here:
<NAME>, <NAME>, Pyapali, G.K, <NAME>. An on-line archive of reconstructed
h... | |
<filename>qsiprep/workflows/dwi/base.py
"""
Orchestrating the dwi-preprocessing workflow
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: init_dwi_preproc_wf
"""
import os
from nipype import logging
from nipype.pipeline import engine as pe
from nipype.interfaces import utility as niu
from nipype.inter... | |
Format for report. Valid values are: `textORcsv`, `Parquet`. If `Parquet` is used, then Compression must also be `Parquet`.
"""
return pulumi.get(self, "format")
@format.setter
def format(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "format", value)
@property
@pulumi.getter(name="refreshClosedRe... | |
3, 111, 119, 110, 2, 1, 1))
) == (self.s, null)
def testWithOptionalAndDefaultedIndefModeChunked(self):
assert decoder.decode(
ints2octs((48, 128, 5, 0, 36, 128, 4, 4, 113, 117, 105, 99, 4, 4, 107, 32, 98, 114, 4, 3, 111, 119, 110, 0, 0, 2, 1, 1, 0, 0))
) == (self.s, null)
def testWithOptionalAndDefaultedDefMod... | |
Nmap As Root:
\033[31m>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
\033[31m#\033[37m nmap --interactive
\033[31m#\033[37m !sh
""")
#----------------------------------------------------------------------------------------------------------------------
def secure_con():
import socket, ssl
context = ssl.SSLContext(ssl.PROTO... | |
"3585": 4620,
"3586": 4401,
"3587": 4767,
"2762": 5370,
"5009": 3031,
"2760": 5377,
"2765": 5365,
"999": 12925,
"4620": 3598,
"4428": 3217,
"905": 14420,
"908": 14615,
"4421": 3367,
"1847": 7709,
"1846": 8092,
"4424": 8311,
"254b": 140530,
"254a": 147896,
"4959": 1406,
"2165": 7175... | |
import csv
import json
from io import open
from torch import LongTensor
import re
import random
# detect pattern
# detect <TIME>
pattern_time1 = re.compile(r"[0-9]+[ap]")
pattern_time2 = re.compile(r"[0-9]+[;.h][0-9]+")
pattern_time3 = re.compile(r"[ap][.][am]")
pattern_time4 = range(2000, 2020)
# pattern_time5: toke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.