input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
**units**\: second
"""
_prefix = 'ethernet-cfm-oper'
_revision = '2017-10-06'
def __init__(self):
super(Cfm.Global.IncompleteTraceroutes.IncompleteTraceroute, self).__init__()
self.yang_name = "incomplete-traceroute"
self.yang_parent_name = "incomplete-traceroutes"
self.is_top_level_class = False
self... | |
#!/usr/bin/env python
"""
CMSC733 Spring 2020: Classical and Deep Learning Approaches for
Geometric Computer Vision
Homework 0: Alohomora: Phase 1 Starter Code
Author(s):
<NAME> (<EMAIL>)
PhD Candidate in Computer Science,
University of Maryland, College Park
<NAME> (<EMAIL>)
PhD Student in Computer... | |
<gh_stars>0
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | |
# Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
"""Transaction related models to parse and construct transaction
payloads.
Attributes:
UnspentOutput (namedtuple): Object holding the information
representing an ... | |
<gh_stars>0
#coding: utf-8
from flask import Flask, request, abort
from linebot import ( LineBotApi, WebhookHandler )
from linebot.exceptions import( InvalidSignatureError )
from linebot.models import *
app = Flask(__name__)
line_bot_api = LineBotApi("<KEY> #-- YOUR_CHANNEL_ACCESS_TOKEN
handler = WebhookHandler("... | |
# Copyright 2018 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 required by ap... | |
<reponame>chisuhua/coasm
from enum import Enum
from collections import OrderedDict
from collections import namedtuple
from jinja2 import Template
from ctypes import *
import pdb
MAX_SREG_NUM = 255
MAX_USER_SREG_NUM = 220
MAX_VREG_NUM = 255
def utilReplace(str):
str = str.replace('_', "'_'")
str = str.replace('3', "... | |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: segment.py
# Purpose: Division of stream.Part into segments for individual handling
# Authors: <NAME>
#
# Copyright: Copyright © 2012 <NAME> and the music21 Project
# License: BSD, see license.txt
# --------... | |
65680: # {U_Prelude.Show.{Prec instance of Prelude.Classes.Ord_lam3}1}
return _idris_Prelude_46_Show_46__123_Prec_32_instance_32_of_32_Prelude_46_Classes_46_Ord_95_lam3_125_(
arg0
)
elif fn0[0] == 65681: # {U_Prelude.Show.{Prec instance of Prelude.Classes.Ord_lam4}1}
P_c0 = fn0[1]
return _idris_Prelude_46_Show_46... | |
"""
dic_mean = {}
dic_var = {}
for i in range(self.n):
conf = tuple(self.list_conf[i])
f = self.F[i]
mean = f.dot(w)
var = pow( np.exp(f.dot(v)), 2)
dic_mean[conf] = mean
dic_var[conf] = var
return (dic_mean, dic_var)
class LR:
"""
baseline: linear regression
"""
def __init__(self, data, hetero = Fal... | |
<gh_stars>1-10
import os
import uuid
from datetime import datetime
from collections import defaultdict, abc
from pathlib import Path
import numpy as np
import distutils.version
import spikeextractors as se
from spikeextractors.extraction_tools import check_get_traces_args, check_valid_unit_id
try:
import pynwb
from... | |
in chaining.
"""
if not (B_G > 0):
raise ValueError('must have B_G > 0; got %r' % (B_G,))
self.in_vals[IN_VAL_B] = B_G
return self
def set_bfield_for_s0(self, s0):
"""Set B to probe a certain harmonic number.
**Call signature**
*s0*
The harmonic number to probe at the lowest frequency
Returns
*self* fo... | |
import unittest
from context_with_email import GraphQlContextWithEmail
from graphql.document import GraphQlParser
from graphql.executor import GraphQlContext
from graphql.executor import GraphQlExecutor
from graphql.executor.test.star_wars_extra import get_sw_ship
from graphql.executor.test.star_wars_extra import SwSh... | |
# Copyright 2019 IBM Corp.
#
# 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 agr... | |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import copy
import os
import datetime
import shutil
from collections import OrderedDict
from itertools import product
import yaml
from numpy import uint8 # noqa: F401 (used in evaluated strings)
CURRENT_DIR = os.path.dirname(os.... | |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018 <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, c... | |
<reponame>vkolli/5.0_contrail-test<gh_stars>0
from base import BasePolicyTest
from tcutils.wrappers import preposttest_wrapper
import test
from vn_test import VNFixture
from policy_test import PolicyFixture, copy
from common.policy import policy_test_utils
from vm_test import VMFixture, time
from tcutils.topo.sdn_topo_... | |
import unittest
from textwrap import TextWrapper, wrap, fill, dedent, indent, shorten
class BaseTestCase(unittest.TestCase):
"""Parent class with utility methods for textwrap tests."""
def show(self, textin):
if isinstance(textin, list):
result = []
for i in range(len(textin)):
result.append(' %d: %r' % (i, te... | |
"""
Authors: <NAME>, <NAME>
Project: Graduation Thesis: GIAdog
This file provides an interface to control and monitor the simulation status.
"""
import numpy as np
import pybullet_utils.bullet_client as bc
from scipy import interpolate
from gym import spaces
from Scene import TerrainScene
from typing import List, ... | |
in embeddding but yes in files
else:
embedded_dataset = None
if load_ground_truth:
print("loading ground truth...")
box_data, qgt = self.load_ground_truth()
else:
box_data = None
qgt = None
# if os.path.exists(self.index_path()):
# vec_index = self.index_path() # start actor elsewhere
# else:
vec_index = ... | |
0.027929975725048677, 0.023096283447740142, 0.013246239250661214, 0.016591515379385257,
0.020124742001645903, 0.04280129966494781],
[0.012788278610805889, 0.01900825221815599, 0.03422528506129086, 0.04729076846086603,
0.029862497132645566, 0.026514444167261703, 0.04284894436016072, 0.04584681968530258,
0.0110333778... | |
= random.choice(self._broker_partitions)
kafka_conn = self._connections[broker_partition.broker_id]
kafka_conn.produce(self.topic, msgs, broker_partition.partition)
bytes_sent = sum(len(m) for m in msgs)
log.debug(self._log_str(u"sent {0} bytes to {1}"
.format(bytes_sent, broker_partition)))
return broker_partit... | |
<reponame>hopem/cinder
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... | |
<reponame>hyperevo/py-helios-node<gh_stars>0
from cytoolz import (
identity,
)
from eth_typing import Hash32
from eth_utils import (
decode_hex,
encode_hex,
int_to_big_endian,
is_integer,
big_endian_to_int,
to_wei,
from_wei,
)
import time
from hvm.rlp.transactions import BaseReceiveTransaction
from helios.exce... | |
<reponame>JoyChen1998/Network_PacketCapture<gh_stars>1-10
# encoding = utf-8
import socket
import time
import psutil
from struct import *
from multiprocessing import Pool
__AUTHOR__ = 'JoyChan'
__REPO__ = "https://github.com/JoyChen1998/Network_PacketCapture"
# ---* CONFIG *---
INTERVAL = 1 # for default speed to g... | |
<reponame>koreywylie/networkZoo<gh_stars>0
#!/usr/bin/env python
"""
networkZoo.py
"""
# Python Libraries
from os.path import join as opj # method to join strings of file paths
import getopt # used to parse command-line input
import os, sys, re, json, csv
from functools import partial
from string import digits
from n... | |
from . import constants as CONSTANTS
from .producer_property import ProducerProperty
from common.telemetry import telemetry_py
from common.telemetry_events import TelemetryEvent
class Image:
"""
If ``string`` is used, it has to consist of digits 0-9 arranged into
lines, describing the image, for example::
image ... | |
weight='HImass', tofield=False):
'''use this to create mesh of HI
'''
comm = halocat.comm
if mode == 'halos': catalogs = [halocat]
elif mode == 'galaxies': catalogs = [cencat, satcat]
elif mode == 'all': catalogs = [halocat, cencat, satcat]
else: print('Mode not recognized')
rankweight = sum([cat[weight].sum(... | |
# ##### BEGIN MIT LICENSE BLOCK #####
#
# MIT License
#
# Copyright (c) 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 rig... | |
Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: GetSecurityGroupBusinessObjectPermissionsResponse
If the method is called asynchronously,
returns the reques... | |
<reponame>sakagarwal/python-aiplatform<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2022 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/LIC... | |
<filename>pypy/module/_ssl/interp_ssl.py<gh_stars>1-10
from __future__ import with_statement
from pypy.rpython.lltypesystem import rffi, lltype
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace import Wrappable
from pypy.interpreter.typedef import TypeDef
from pypy.interpreter.gateway... | |
<reponame>RI-imaging/qpimage
import pathlib
import warnings
import h5py
import nrefocus
import numpy as np
from skimage.restoration import unwrap_phase
from . import holo
from .image_data import Amplitude, Phase, write_image_dataset
from .meta import MetaDict, DATA_KEYS, META_KEYS
from ._version import version as __v... | |
= False) -> DefaultBoxes:
"""
Convenience function for generating DefaultBoxes object for standard SSD300 model
:param voc: set True if default boxes should be made for VOC dataset.
Will set scales to be slightly larger than for the default
COCO dataset configuration
:return: DefaultBoxes object implemented for ... | |
136 / 409):
ac_num = 3
for s in range(1, 3):
k = s - ac_num
left = int(ac_center + k * space - 22 / 57 * space - half_w)
if left <= 0:
left = 0
if left >= 136:
left = int(right - ww)
right = int(ac_center + k * space - 22 / 57 * space + half_w)
if right <= 0:
right = int(left + ww)
if right >= 1... | |
:
if word[1] == "C" or word[1] == "c" :
toGuess = toGuess[:1] + "c" + toGuess[2:]
if word[2] == "C" or word[2] == "c" :
toGuess = toGuess[:2] + "c" + toGuess[3:]
if word[3] == "C" or word[3] == "c" :
toGuess = toGuess[:3] + "c" + toGuess[4:]
if word[1] != "C" and word[1] != "c" and word[2] != "C... | |
False otherwise.
kwargs will be passed onto the creation of the dataset. Please pass chunking, compression, dtype, and other
arguments this way
Returns
-------
h5_main : USIDataset
Reference to the main dataset
"""
def __check_anc_before_creation(aux_prefix, dim_type='pos'):
aux_prefix = validate_single_stri... | |
import copy
import glob
import hashlib
import logging
import os
import shutil
from subprocess import CalledProcessError, DEVNULL, check_output # skipcq:BAN-B404
import tempfile
import typing
from pathlib import Path
from typing import Any, Text, Tuple, Union, Optional, List, Dict, NamedTuple
from packaging import vers... | |
all the boundary edges
#regardless because -- very tricky -- it won't matter. The
#correct boundary value will be used based on how hdg and
#advect are implemented.
for j in range(self.levels):
#Add the interior vertical faces on the j'th level
if len(shp) == 3: #Scalar field
#Interior
tmp = field2D_ed[0][:, :,... | |
command to show the full 'COMM:' line, as it
# does not depend on execution data. The color codes are added or
# not, depending on user options.
#
# 4. 'Last Address' trick:
# On SED, the empty address // refers to the last address matched.
# As this behaviour can be affected when several DEBUG lines are
# inserted bef... | |
<reponame>silenceleaf/rclonesync-V2-fork
#!/usr/bin/env python
"""BiDirectional Sync using rclone"""
__version__ = "V2.7 190429" # Version number and date code
#==========================================================================================================
# Configure rclone, including authentication befo... | |
# .\_avm.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:8c3bce54577a879cd94d42789711c9f5d444aa71
# Generated 2017-02-16 11:50:59.033000 by PyXB version 1.2.3
# Namespace avm [xmlns:avm]
import pyxb
import pyxb.binding
import pyxb.binding.saxer
import io
import pyxb.utils.utility
import pyxb.utils.domutil... | |
to `false`.
"""
return pulumi.get(self, "locked")
@locked.setter
def locked(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "locked", value)
@property
@pulumi.getter
def message(self) -> Optional[pulumi.Input[str]]:
"""
A message to include with notifications for this monitor.
"""
return pulu... | |
of all domain DNS records for a Service Version. Returns an array items in the same format as the single domain /check."""
content = self._fetch("/service/%s/version/%d/domain/check_all" % (service_id, version_number))
return map(lambda x: FastlyDomainCheck(self, x), content)
def get_event_log(self, object_id):
... | |
<reponame>acrucetta/Chicago_COVI_WebApp
"""
=================
Structured Arrays
=================
Introduction
============
Structured arrays are ndarrays whose datatype is a composition of simpler
datatypes organized as a sequence of named :term:`fields <field>`. For example,
::
>>> x = np.array([('Rex', 9, 81.0),... | |
type for y coordinates")
raise Exception("Not a valid type for y coordinates")
if len(x) == len(y):
self.x = x
self.y = y
else:
logger.error("Input vectors have not the same length")
Exception("Input vectors have not the same length")
@property
def get_contours_number(self):
""" Return the number of sub-con... | |
<filename>rpbasicdesign/Designer.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Methods for conversion"""
__author__ = '<NAME>'
__license__ = 'MIT'
__date__ = '2020.10.21'
import itertools
import logging
import os
import pprint
import random
import sys
from csv import DictReader, DictWriter
from copy import dee... | |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2008, <NAME> <<EMAIL>>
#
# 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 code must retain the above copyright notice, this... | |
"fr_FR": "Colonie libre",
"it_IT": "Colonia libera",
"ja_JP": "自由植民地",
"ko_KR": "자유로운 거주지",
"pl_PL": "Wolna kolonia",
"pt_BR": "Colônia Livre",
"ru_RU": "Бесплатная колония"
},
"SCENARIO_VICTORIA_ABILITY": {
"de_DE": "<NAME>",
"es_ES": "Fiebre del oro victoriana",
"fr_FR": "Ruée vers l'or en Victoria",
"it_... | |
<gh_stars>1-10
#%%
#import importlib.util
#spec = importlib.util.spec_from_file_location("medical_ML.py", 'C:\\Users\\Andrew\\Documents\\Stanford\\medical\\medicalML_git\\medicalML')
#foo = importlib.util.module_from_spec(spec)
#spec.loader.exec_module(foo)
from medical_ML import Experiment, split_cohort#, test
import... | |
= os.listdir(file_path)
shutil.copy(file_path + '/daylight_detector_side.png', b + '/textures/blocks')
if 'daylight_detector_side.png' in file_names:
os.rename(os.path.join(b + '/textures/blocks', 'daylight_detector_side.png'),
os.path.join(b + '/textures/blocks', str('daylightdetector_side.png')))
except:
... | |
mask = np.ones(dims,dtype=np.int32)
equil = {"time":0.0,"data_source":os.path.abspath(filename), "mask":mask,
"br":br,"bt":bt,"bz":bz,"er":er,"et":et,"ez":ez}
return equil, rhogrid, btipsign
def read_ncdf(filename, vars=None):
'''
#+#read_ncdf
#+Reads a flat NetCDF file
#+***
#+##Arguments
#+ **filename**: ... | |
expr.key.accept(self)
expr.value.accept(self)
self.leave()
def visit_generator_expr(self, expr: GeneratorExpr) -> None:
self.enter()
self.analyze_comp_for(expr)
expr.left_expr.accept(self)
self.leave()
def analyze_comp_for(self, expr: Union[GeneratorExpr,
DictionaryComprehension]) -> None:
"""Analyses the '... | |
field associated with this file. May be None if there isn't
one, for example when we have an application/octet-stream upload.
"""
return self._field_name
@property
def file_name(self):
"""The file name given in the upload request.
"""
return self._file_name
@property
def actual_file_name(self):
"""The file... | |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | |
import json
import socket
import time
from hashlib import sha1
import random
import threading
from queue import Queue
from copy import copy
# project files
from src import utils
from src.utils import log
from src.Finger import Finger
from src.rpc_handlers import REQUEST_MAP, STATUS_CONFLICT
from src.Storage import Stor... | |
<filename>rl_coach/spaces.py
#
# Copyright (c) 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 app... | |
import operator
from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.baseobjspace import ObjSpace
from pypy.interpreter.function import Function, Method, FunctionWithFixedCode
from pypy.interpreter.argument import Arguments
from pypy.interpreter.typedef import default_identity_hash
from rpytho... | |
import json
import re
from datetime import datetime, timezone
from functools import lru_cache
import logging
import os
import dataclasses
import urllib
from jira import JIRA
from .entities import Issue, Comment, User, Source, Metadata, CommentMetadata
from . import utils
__all__ = ["Client", "Formatter", "get_usern... | |
zrem(self, tr, key:NativeType, members:ListOf(NativeType)) -> int:
""" Remove one or more members from a sorted set """
return self._query(tr, b'zrem', self.encode_from_native(key), *map(self.encode_from_native, members))
# Hashes
@_query_command
def hset(self, tr, key:NativeType, field:NativeType, value:NativeT... | |
min_
# same coordinates in image slicing scale
b_min = np.round(coord - hlf_hc[i] * inv_scale[i]).astype(int)
b_max = np.round(coord + hlf_hc[i] * inv_scale[i]).astype(int)
# correct for edges of image
if b_max >= shape[i]:
b_max = shape[i] - 1
if b_min < 0:
b_min = 0
# add the coordinate slice to the pair i... | |
9.65096318e-06,
# -1.17180876e-06, -1.47205710e-09, 3.78235738e-10], [-1.39289314e-07, -1.60277947e-12, -4.39124955e-15, 2.21338354e-11,
# -1.11538197e-11, -1.44742977e-16, 2.45995034e-16, 5.61168466e-06,
# -1.11813367e-06, -1.89357558e-09, 3.96106702e-10], [-2.38234690e-07, -2.34956564e-12, -8.11551999e-15, 2.78141126... | |
:type protection_container_name: str
:param replicated_protected_item_name: Replication protected item name.
:type replicated_protected_item_name: str
:param reprotect_input: Reverse replication input.
:type reprotect_input: ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationInput
:keyword callable ... | |
and generate metrics.
"""
experiment, network, _optimizer, _symbols_metadata = load_checkpoint(checkpoint_path)
logger.info("start testing classifier")
logger.info(f"experiment:\n{experiment}")
logger.info(f"network:\n{network}")
# get test dataloader
_, _, test_loader = generate_dataloaders(experiment)
crit... | |
tex_node)
elif engine == 'Octane':
if ao_exists == True:
diffuse_node.setInput(0, ao_node)
mat_node.setInput(input_slots['diffuse'], tex_node)
else:
mat_node.setInput(input_slots['diffuse'], tex_node)
if prim_group.lower() + "_subsurfacecolor.png" not in tex_list_lower:
transl_color_exists = True
cc_node... | |
if ('dmt',ci,ci) in cq:
cq[('dmt_sge',ci,ci)] = cq[('dmt',ci,ci)]
self.tau.append(numpy.zeros(cq[('u',ci)].shape,'d'))
for ci,ckDict in self.coefficients.diffusion.items():
if self.lag:#mwf looks like this was missing if lag May 7 09
for ck,cjDict in ckDict.items():
cq[('grad(phi)_sge',ck)]=copy.deepcopy(cq[('gr... | |
custom saveables.
with self.assertRaisesRegexp(
ValueError, "The same saveable will be restored with two names: v2"):
saver_module.Saver({"v2": v2.saveable, "v2too": v2.saveable})
# Verify non-duplicate names work.
saver_module.Saver({"v0": v0, "v2": v2.saveable})
def testBasicsWithListOfVariables(self):
save_... | |
<gh_stars>0
import tvm
import topi
import numpy as np
from tvm.testing import check_numerical_grads, estimate_performance, PerformanceEstimate
import time
import inspect
import sys
import argparse
# Whether to dump the generated code
verbose = False
# Whether to perform numerical gradient testing
perform_numgrad_test ... | |
<reponame>ni1o1/transdata
'''
BSD 3-Clause License
Copyright (c) 2021, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, t... | |
<reponame>mfisherlevine/astroquery<gh_stars>0
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
@author: <NAME>
@contact: <EMAIL>
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 4 Sept. 2019
"""
from unittest.mock import patch
import pytest
import tarfile
import os
impor... | |
return pulumi.get(self, "method")
@property
@pulumi.getter
def origin(self) -> Sequence[str]:
"""
The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin".
"""
return pulumi.get(self, "origin")
@property
@pulumi.getter(name="response... | |
Bx)
csr_tobsr(npy_int32 const n_row, npy_int32 const n_col, npy_int32 const R, npy_int32 const C,
npy_int32 const [] Ap, npy_int32 const [] Aj, npy_cfloat_wrapper const [] Ax,
npy_int32 [] Bp, npy_int32 [] Bj, npy_cfloat_wrapper [] Bx)
csr_tobsr(npy_int32 const n_row, npy_int32 const n_col, npy_int32 const R, npy... | |
<filename>Tests/test_python25.py
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import exceptions
import sys
import unittest
from iptest import is_cli, run_t... | |
param convert_upper. This way for
#mugration (ancestral reconstruction of non-sequences), you can
#use upper- and lower case characters for discrete states!
if (not self.is_vcf) and self.convert_upper:
self._aln = MultipleSeqAlignment([seq.upper() for seq in self._aln])
if self.seq_len:
if self.is_vcf and self.s... | |
<filename>AwesomeService/coveo-blitz-thrift/src/main/python/awesome/AwesomeService.py<gh_stars>1-10
#
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException... | |
<filename>orchestration/lxc/dev_environment/proxyb/rootfs/home/ubuntu/synproxy_dataplane.py<gh_stars>1-10
#!/usr/bin/env python3
"""
Copyright <2018> <<NAME>, Aalto University>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softwa... | |
'observer' in battle_armors_files[new_image['Battle_armors']] or 'Explorer' in battle_armors_files[new_image['Battle_armors']]:
random_type_arm_armor = random.randint(0, 9)
random_type_helmetless_armor = random.randint(0, 3)
random_type_warpaint = random.randint(0, 1)
new_image['Arm_armor'] = arm_armor[random_typ... | |
"""
Created on Aug 3, 2016
@author: ramseylab
"""
import pandas
from sqlalchemy import create_engine
from sqlalchemy.engine.url import URL
from sqlalchemy.pool import NullPool
import chrom_tool as ct
import numbers
import ast
import re
from allele_tool import parse_gb_alleles_col, parse_gb_allele_freqs_col
from genom... | |
# -*- coding: utf-8 -*-
"""This is a part of neuralflow package/EnergyModel class.
This source file contains functions for synthetic data generation."""
import numpy as np
import math
from tqdm import tqdm
from .energy_model_settings import MINIMUM_PEQ
def generate_data(self, deltaT=0.00001, time_epoch=[(0, 1)], las... | |
<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File for reading and setting configurations for the whole library.
I will not pretend this config file is a good way to do things.
But it is flexible, and works so far.
I make no guarantees that this will not destroy your computer.
Example config file:... | |
0xA5,
0xB8,
0xAB,
0xDC,
0x3A,
0xAE,
0xB6,
],
"gEfiPlatformMemory2ErrorSectionGuid": [
0x61EC04FC,
0x48E6,
0xD813,
0x25,
0xC9,
0x8D,
0xAA,
0x44,
0x75,
0x0B,
0x12,
],
"gEfiBlockIoCryptoAlgoAesXtsGuid": [
0x2F87BA6A,
0x5C04,
0x4385,
0xA7,
0x80,
0xF3,
0xBF,
0x78,
0xA9,
0x7B,
0xEC,
],
"gEfi... | |
test_repos_esercizi_di_programmazione_javascript():
# path_name = os.path.join(constants.seeds_dir, 'repos', 'esercizi-di-programmazione-javascript')
# multicall.multicall_directories(path_name, fuzzer='quickfuzz', validator=validate)
# def test_repos_esformatter_jsx():
# path_name = os.path.join(constants.seeds_dir,... | |
<filename>bombman.py
#!/usr/bin/env python
# coding=utf-8
#
# Bombman - free and open-source Bomberman clone
#
# Copyright (C) 2016 <NAME>
#
# 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 Foundation, eithe... | |
type passed to BaseSegment: {0}".format(
type(segments)))
def parse(self, parse_context=None):
"""Use the parse grammar to find subsegments within this segment.
A large chunk of the logic around this can be found in the `expand` method.
Use the parse setting in the context for testing, mostly to check h... | |
i , x , y in graph.iteritems() :
new_graph [ i ] = x + shift , y
return new_graph
# ==============================================================================
## Right shift of the graph
# @code
# graph = ...
# newg = graph >> 14.5
# @endcode
def _gr_rshift_ ( graph , shift ) :
"""Right shift of the graph
>>... | |
<filename>tests/test_emitter_queries.py
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (... | |
y_train)
print('Intercept \t: b = ', linreg.intercept_)
print('Coefficients \t: a = ', linreg.coef_)
# In[238]:
# Predict PYPL Prices values corresponding to Predictors
y_train_pred = linreg.predict(X_train)
y_test_pred = linreg.predict(X_test)
# Plot the Predictions vs the True values
f, axes = plt.subplots(1, 2... | |
<gh_stars>0
#!/usr/bin/env python2
import time
from math import radians
from service_router import *
from locomotion import *
from math import asin, pi, atan2
#, positionN, \
# velocityAll, accelerationAll, positionAll, readFSR
from kinematics import Kinematics
K=Kinematics()
threshold = 30
stepSize = 50
riser = 163
... | |
import pytest
from rubrik_cdm.exceptions import InvalidParameterException, CDMVersionException, InvalidTypeException
from rubrik_cdm import Connect
def test_cluster_version(rubrik, mocker):
def mock_get_v1_cluster_me_version():
return {'version': '5.0.1-1280'}
mock_get = mocker.patch('rubrik_cdm.Connect.get', au... | |
loc="upper right",
)
plt.subplots_adjust(bottom=0.15, right=0.95)
plt.savefig(
os.path.splitext(filename)[0] + "_Risk_Fig.png",
format="png",
bbox_inches="tight",
)
# pl.dump(fig, open(os.path.splitext(filename)[0] + 'Fig2.pickle', 'wb'))
StringIOBytes_risk = io.BytesIO()
plt.savefig(StringIOBytes_risk, forma... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2013, <NAME>, TUM
# 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 ... | |
<reponame>iinnovations/iicontrollibs
#!/usr/bin/python3
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, Interface Innovations"
__credits__ = ["<NAME>"]
__license__ = "Apache 2.0"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
import os
import sys
import inspect
... | |
config_cached[k.lower()] = v
def get_config_or_none(key):
ensure_config_loaded()
return config_cached.get(key.lower())
def set_config(key, value):
run_git("config", "--", key, value)
ensure_config_loaded()
config_cached[key.lower()] = value
def unset_config(key):
ensure_config_loaded()
if get_config_or_non... | |
<gh_stars>0
"""Test UGrid2dDataExtractor.cpp"""
import unittest
import xmsgridtrace
from xmsgrid.ugrid import UGrid
from xmsgridtrace.gridtrace import GridTrace
import numpy as np
class TestGridTrace(unittest.TestCase):
"""GridTrace tests"""
def create_default_single_cell(self):
"""Create a default single cell"""
... | |
predictionAcurracy = predictionAcurracy + 1
predictionAcurracy = predictionAcurracy/numberOfDataPoints*100
temporalRow = []
temporalRow.append(predictionAcurracy)
temporalRow.append(currentMatrix_b)
temporalRow.append(currentMatrix_x)
allAccuracies.append(temporalRow)
# We save the current the modeling results... | |
153.20
27.0 83.47 162.05
28.0 83.00 169.89
29.0 82.41 176.64
30.0 81.74 182.37
31.0 81.53 181.04
32.0 81.43 178.14
33.0 81.30 175.32
34.0 81.08 172.47
35.0 80.66 169.55
36.0 80.22 166.89
37.0 79.76 164.46
38.0 79.29 162.23
39.0 78.80 160.20
40.0 79.13 159.12
41.0 79.45 157.97
42.0 79.77 156.75
43.0 80.08 155.46
44.0 80... | |
"""
General serializer field tests.
"""
from __future__ import unicode_literals
import datetime
from decimal import Decimal
from uuid import uuid4
from django.core import validators
from django.db import models
from django.test import TestCase
from django.utils.datastructures import SortedDict
from rest_framework impo... | |
{"$in": list(extensions)}
if names_by_version_ids is not None:
or_query = []
for version_id, names in names_by_version_ids.items():
if version_id and names:
or_query.append({
"parent": _convert_id(version_id),
"name": {"$in": list(names)}
})
if not or_query:
return []
query_filter["$or"] = or_query
conn =... | |
in range(5)
for k in [np.arange(order, dtype=dtype), np.ones(1, dtype), None]))
def testPolyInt(self, a_shape, order, k, dtype):
rng = jtu.rand_default(self.rng())
np_fun = lambda arg1: np.polyint(arg1, m=order, k=k)
jnp_fun = lambda arg1: jnp.polyint(arg1, m=order, k=k)
args_maker = lambda: [rng(a_shape, dtype)]... | |
: lambda x : x * 2.23693629,
'knot2' : lambda x : x * 1.94384449,
'km_per_hour2' : lambda x : x * 3.6},
'cm_per_hour' : {'inch_per_hour' : lambda x : x * 0.393700787,
'mm_per_hour' : lambda x : x * 10.0},
'mm_per_hour' : {'inch_per_hour' : lambda x : x * .0393700787,
'cm_per_hour' : lambda x : x * 0.10},
'cm' : ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.