input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>python-src/fastpdb/__init__.py
__name__ = "fastpdb"
__author__ = "<NAME>"
__all__ = ["PDBFile"]
__version__ = "1.0.1"
import numpy as np
import biotite
import biotite.structure as struc
import biotite.structure.io.pdb as pdb
from .fastpdb import PDBFile as RustPDBFile
class PDBFile(biotite.TextFile):
r"""... | |
total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the authentication
in the spec for a single request.
:type _request_auth: dict, optional
:return: Returns the result objec... | |
<reponame>Yard1/scikit-learn-intelex
#===============================================================================
# Copyright 2021 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 ... | |
<gh_stars>10-100
# For each channel, we assume all the pixel (x,y) dimensions are i.i.d., and solve a scalar quantization problem
import numpy as np
np.random.seed(0)
import tensorflow as tf
import utils
class ChannelwisePriorCDFQuantizer:
def __init__(self, num_channels, max_bits_per_coord, float_type='float32... | |
import pytest
from spacy import registry
from spacy.tokens import Doc, Span
from spacy.language import Language
from spacy.lang.en import English
from spacy.pipeline import EntityRuler, EntityRecognizer, merge_entities
from spacy.pipeline.ner import DEFAULT_NER_MODEL
from spacy.errors import MatchPatternError
from spa... | |
<gh_stars>0
"""Tucker Sync common module.
Common code used by server and client implementations.
License:
The MIT License (MIT), see LICENSE.txt for more details.
Copyright:
Copyright (c) 2014 <NAME> and <NAME>.
"""
import inspect
import json
import logging
import os
from schematics.models import Model
from schem... | |
the Project name
:type config_name: string
:param config_name: the logtail config name to apply
:type group_name: string
:param group_name: the machine group name
:return: RemoveConfigToMachineGroupResponse
:raise: LogException
"""
headers = {}
params = {}
resource = "/machinegroups/" + ... | |
angle = WritableAngle(top.angles[angle_idx])
angle_spring_constants1.append(angle.spring_constant)
for proper_idx in alchemizer._exclusive_propers:
proper = WritableProper(top.propers[proper_idx])
proper_constants1.append(proper.constant)
for improper_idx in alchemizer._exclusive_impropers:
improper = WritableI... | |
import numpy as np
from numpy.linalg import inv
from geomdl import NURBS
from geomdl import multi
from geomdl import construct
from geomdl import convert
from geomdl.visualization import VisVTK as vis
from geomdl.visualization import VisMpL
from geomdl import exchange
import matplotlib.pyplot as plt
from mpl_toolkits.m... | |
a instance of `wx.Menu`.
"""
menu = wx.Menu(style=wx.MENU_TEAROFF)
if PHOENIX: menu.AppendItem = menu.Append
mi = wx.MenuItem(menu, ID_SANDBOX_RGB, u'%s\t%s' %(_(u'&RGB'), RGBShortcut), _(u'Updates the current view colors: RGB'))
bmp = wx.Image(gIconDir + os.sep + 'rgb.png', wx.BITMAP_TYPE_PNG).Scale(16, 16).Con... | |
175.
# o Encoded Additional Authenticated Data (AAD); this example uses the
# Additional Authenticated Data from Figure 173, encoded to
# base64url [RFC4648] as Figure 176.
# 75m1ALsYv10pZTKPWrsqdg
# Figure 174: Content Encryption Key, base64url-encoded
# veCx9ece2orS7c_N
# Figure 175: Initialization Vector, base6... | |
issubclass(list, typing.Reversible)
assert not issubclass(int, typing.Reversible)
def test_protocol_instance_type_error(self):
with self.assertRaises(TypeError):
isinstance([], typing.Reversible)
class GenericTests(TestCase):
def test_basics(self):
X = SimpleMapping[str, Any]
Y = SimpleMapping[XK, str]
X[st... | |
"""
super().__init__()
if CONFIG_SEPARATOR in name:
raise ValueError("Name cannot contain the config-hierarchy divider ({})".format(CONFIG_SEPARATOR))
self._name = name
self._description = description or ""
self._default = default
self._optional = optional
self._requirements = {} # type: Dict[str, RequirementIn... | |
<reponame>mosesn/pants
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import errno
import ... | |
<gh_stars>1-10
"""A few utils (specshow, melspectrogram) vendored from librosa.
This code was copied from parts of librosa, and adapted, so as to be able to use
targeted functionality with less dependencies and manual installation
(namely for libsndfile) than librosa has.
Librosa can be found here: https://librosa.or... | |
<reponame>rhan1498/marine-integrations
"""
@package mi.instrument.satlantic.suna_deep.ooicore.driver
@file marine-integrations/mi/instrument/satlantic/suna_deep/ooicore/driver.py
@author <NAME>
@brief Driver for the ooicore
Release notes:
initial_rev
"""
__author__ = '<NAME>'
__license__ = 'Apache 2.0'
from mi.core.... | |
0.91400000000000003, 1.0, 1.0],
[0.90918200000000005, 0.90900000000000003, 1.0, 1.0],
[0.90319400000000005, 0.90300000000000002, 1.0, 1.0],
[0.89121800000000007, 0.89100000000000001, 1.0, 1.0],
[0.88622800000000013, 0.88600000000000001, 1.0, 1.0],
[0.87425200000000003, 0.874, 1.0, 1.0],
[0.86926200000000009, 0.86... | |
You are not enrolled in this section!")
return
# If event has ended or closed check-ins
if event.completed == "1":
bot.send_message(user_chat_id, "The instructor/admin has closed this event, you can no longer mark your attendance. Please contact your instructor / TAs if you are late.")
return
# If user a... | |
#coding:utf-8
#
# id: bugs.core_2988
# title: Concurrent transaction number not reported if lock timeout occurs
# decription:
# 08-aug-2018.
# ::: ACHTUNG :::
# Important change has been added in FB 4.0.
# According to doc\\README.read_consistency.md, read committed isolation level
# was modified and new transaction wi... | |
<gh_stars>10-100
__all__ = ['Target', 'Fit', 'MODELS']
import copy as cp
from pylab import *
from .data import *
from . import qnms
import lal
from collections import namedtuple
import pkg_resources
import arviz as az
# def get_raw_time_ifo(tgps, raw_time, duration=None, ds=None):
# ds = ds or 1
# duration = inf if d... | |
<gh_stars>0
import ast
import keyword
import sys
from typing import List
from typing import NamedTuple
from typing import Optional
from typing import Sequence
from typing import Tuple
from tokenize_rt import NON_CODING_TOKENS
from tokenize_rt import Token
from tokenize_rt import tokens_to_src
from tokenize_rt import U... | |
<filename>hpj.py<gh_stars>0
# hpj.py
# Simple Python to Javascript translator with an emphasis on readability of generated code.
# This code is based on <NAME>'s py2js code. It is a very
# basic python to javascript intereprter, with an emphasis on
# readability of javascript code.
#
# Usage: python hpj.py <file.py>
# ... | |
0x23303C: (0x896C, 0), # East Asian ideograph
0x21303D: (0x4E4B, 0), # East Asian ideograph
0x21303E: (0x5C39, 0), # East Asian ideograph
0x21303F: (0x4E4F, 0), # East Asian ideograph
0x213040: (0x4E4E, 0), # East Asian ideograph
0x233041: (0x8976, 0), # East Asian ideograph
0x233042: (0x8974, 0), # East Asian id... | |
level
x = list(itertools.chain.from_iterable(s for s in x if isinstance(s, list) or isinstance(s, tuple)))
else:
return 0
def listify(x):
"""
Can be used to force method input to a list.
"""
# The isinstance() built-in function is recommended over the type() built-in function for testing the type of an object
... | |
import mindspore.nn as nn
import mindspore.ops as ops
from mindspore.common import initializer as init
####################################################################
# ------------------------- Discriminators --------------------------
####################################################################
class D... | |
""" pgp.py
this is where the armorable PGP block objects live
"""
import binascii
import collections
try:
import collections.abc as collections_abc
except ImportError:
collections_abc = collections
import contextlib
import copy
import functools
import itertools
import operator
import os
import re
import warnings
imp... | |
<filename>src/view/views/python/explorer/PythonExplorer.py
#!/usr/bin/python
'''
Created on Jan 10, 2019
@author: vijay
'''
from src.view.util.FileOperationsUtil import FileOperations
import wx
# from src.view.table.CreateTable import CreateTableFrame
import logging.config
from src.view.constants import ... | |
self.ActiveX.GetFieldData(self.OUTBLOCK1, "time", i).strip()
시가 = float(self.ActiveX.GetFieldData(self.OUTBLOCK1, "open", i).strip())
고가 = float(self.ActiveX.GetFieldData(self.OUTBLOCK1, "high", i).strip())
저가 = float(self.ActiveX.GetFieldData(self.OUTBLOCK1, "low", i).strip())
종가 = float(self.ActiveX.GetFieldData(... | |
<gh_stars>1-10
#!/usr/bin/env python3
"""
=======================================
= Twitter cleaner =
= https://twitter.com/telepathics =
=======================================
"""
import json
import random
import time
from datetime import datetime
import gspread
import pytz
from dateutil.relativedelta import relat... | |
(72)
iciuuh (63) -> gslii, fqaefy, hwuwj
xifaq (38)
oqdukh (56)
hasyyr (24)
khzbxke (174) -> ftkflbo, tracdgp
zoryb (73) -> eusnn, exqkey
ebnqn (9)
pncxkcd (156) -> izpxjp, myckhlw
qqmlvk (96)
qpxgye (93)
qybit (79)
stbgj (10)
smsoi (53)
zlpxr (136) -> iuauic, dznlyl
wfwbq (42)
frcqooy (69)
zxrmy (70)
mxvaxl (60)
wwzli... | |
<gh_stars>1-10
# ====================
# Imports
# ====================
# Standard
import asyncio
import math
import time
from datetime import datetime, timedelta
from typing import Any, Dict, Optional
# Community
from discord import Member, Role
from discord.enums import HypeSquadHouse
from discord.errors import Forb... | |
[PlotNums._get_square_row_cols(nSubplots, fix=True) for nSubplots in nSubplots_list]
>>> print(repr(np.array(rc_list).T))
array([[1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3],
[1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4]])
"""
if nSubplots == 0:
return 0, 0
if inclusive:
rounder = np.ceil
else:
rounder = np.floor
if fix:
# This f... | |
import ast
from collections import (
defaultdict,
)
from unittest import TestCase, skip
from darglint.lex import (
condense,
lex,
)
from darglint.parse.identifiers import (
ArgumentIdentifier,
ExceptionIdentifier,
NoqaIdentifier,
)
from darglint.parse.google import (
parse,
)
from darglint.errors import (
Inde... | |
)
#print 'New Efield shape: ', E_in.shape
# fill in required dictionary keys from defaults if not given
if 'lcell' in list(p_dict.keys()):
lcell = p_dict['lcell']
else:
lcell = p_dict_defaults['lcell']
if 'Elem' in list(p_dict.keys()):
Elem = p_dict['Elem']
else:
Elem = p_dict_defaults['Elem']
if '... | |
from __future__ import annotations
import json
import os
import shutil
import subprocess
import tempfile
import uuid
from abc import ABC, abstractmethod
from typing import Any, Union
from urllib.error import HTTPError
from urllib.request import urlopen, urlretrieve
import warnings
import meerkat as mk
import pandas a... | |
from __future__ import print_function
import sys, wx, wx.lib, wx.combo, os, re, pickle, traceback, json
from wx.lib.scrolledpanel import ScrolledPanel
from types import *
# Quisk will alter quisk_conf_defaults to include the user's config file.
import quisk_conf_defaults as conf
import _quisk as QS
# Settings is [
#... | |
coefficient in Morisons equation (-) [used only when TwrLdMod=1]')
# WAVES
WtrDens = Float(desc='Water density (kg/m^3)')
WtrDpth = Float(desc='Water depth (meters)')
WaveMod = Enum(0, (0,1,2,3,4), desc='Incident wave kinematics model {0: none=still water, 1: plane progressive (regular), 2: JONSWAP/Pierson-Mosko... | |
<gh_stars>0
import torch
from sys import platform
if platform != "win32":
from torch_geometric.data import Data
else:
import open3d as o3d
import sys
import os
import io
import cv2
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mpl_toolkits import mplot3d
import matplotlib.patches as mpatches
import ... | |
<gh_stars>1-10
# coding=utf-8
from datetime import datetime
import json
import math
from StringIO import StringIO
import subprocess32 as subprocess
import os
import uuid
from cachetools.func import lru_cache, rr_cache
from celery import Celery, chain, chord, states
from flask import Flask, redirect, request, send_fro... | |
# If the argument passed is a variable (identifier) then try get value
if token_stream[token][0] == 'IDENTIFIER':
# Get value and handle any errors
value = self.get_variable_value(token_stream[token][1])
if value != False:
ast['PrebuiltFunction'].append( {'arguments': [value]} )
else:
self.send_error_message("... | |
render(self, dialog):
if self._index is None and self._value is not None:
# Search for a matching item with the specified value or ID.
for index, child in enumerate(self._children):
if child.text == self._value:
break
else:
for index, child in enumerate(self._children):
if child.ident == self._value:
break
el... | |
from tensorflow.python.platform import flags
from tensorflow.contrib.data.python.ops import batching
import tensorflow as tf
import json
from torch.utils.data import Dataset
import pickle
import os.path as osp
import os
import numpy as np
import time
from scipy.misc import imread, imresize
from torchvision.datasets imp... | |
indeces
'''
abstractNums=get_elements(self.numbering, 'w:abstractNum')
indres=[0]
for x in abstractNums :
styles=get_elements(x, 'w:lvl/w:pStyle')
if styles :
pstyle_name = styles[0].get(norm_name('w:val') )
if pstyle_name == style :
ind=get_elements(x, 'w:lvl/w:pPr/w:ind')
if ind :
indres=[]
for indx i... | |
# coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outp... | |
<reponame>CiscoDevNet/ydk-py
""" Cisco_IOS_XR_ipv4_acl_datatypes
This module contains a collection of generally useful
derived YANG data types.
Copyright (c) 2013\-2018 by Cisco Systems, Inc.
All rights reserved.
"""
import sys
from collections import OrderedDict
from ydk.types import Entity as _Entity_
from ydk.t... | |
"""Testing for the tree module."""
# =============================================================================
# Imports
# =============================================================================
# Standard
from itertools import product, chain
# Third party
import numpy as np
import pytest
from sklearn.exc... | |
<reponame>david-fisher/320-S21-Track2
import rest_framework
import datetime
from django.shortcuts import render
from django.http import *
from rest_framework import generics, renderers, status, views, viewsets
from rest_framework.response import Response as DRF_response
from rest_framework.views import APIView
from res... | |
# * HXL
# - can be a Triple Store for Semantic Web support
#
tablename = "inv_req_tag"
self.define_table(tablename,
self.inv_req_id(),
# key is a reserved word in MySQL
Field("tag",
label = T("Key"),
),
Field("value",
label = T("Value"),
),
s3_comments(),
*s3_meta_fields())
self.configure(tablename,
de... | |
<reponame>markendr/esys-escript.github.io<gh_stars>0
##############################################################################
#
# Copyright (c) 2003-2018 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://ww... | |
# Copyright 2016, Google 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 code must retain the above copyright
# notice, this list of conditions and the follo... | |
##############################################################################
#
# Copyright (c) 2003-2018 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unt... | |
f(\beta) = l * (0.5 * ||\beta||²_2 - c),
where ||\beta||²_2 is the squared L2 loss function. The constrained
version has the form
0.5 * ||\beta||²_2 <= c.
Parameters
----------
l : Non-negative float. The Lagrange multiplier, or regularisation
constant, of the function.
c : Float. The limit of the constrain... | |
<gh_stars>0
'''
application object and main UI helper classes
'''
import os, sys, time, string, traceback
import urwid
from urwidtrees.widgets import TreeBox
from urwidtrees.tree import Tree
from urwidtrees.decoration import CollapsibleIndentedTree as DecoratedTree
from urwid.util import is_wide_char
from urwidtools ... | |
: yt UnitRegistry, optional
A yt unit registry to use in the conversion. If one is not
supplied, the default one will be used.
"""
# Converting from AstroPy Quantity
u = arr.unit
ap_units = []
for base, exponent in zip(u.bases, u.powers):
unit_str = base.to_string()
# we have to do this because AstroPy is sill... | |
# tindar.py
from typing import Optional
from pulp import *
import numpy as np
from pathlib import Path
from custom_timer import Timer
import itertools
import json
PROJECT_DIR = str(Path(__file__).resolve().parents[1])
class Tindar:
'''Class to solve Tindar pairing problems
Input
-----
love_matrix: np.array
s... | |
"""_catalogue.py: RESQML parts (high level objects) catalogue functions."""
import logging
log = logging.getLogger(__name__)
import zipfile as zf
import resqpy.olio.uuid as bu
import resqpy.olio.xml_et as rqet
def _parts(model,
parts_list = None,
obj_type = None,
uuid = None,
title = None,
title_mode = 'is',... | |
import sha
import time
from patch_tool import *
def add_assets(asset_tree):
asset_tree.add_ignore("mv.patch")
asset_tree.add_ignore("mv.patch.cur")
# Directories for main assets
asset_tree.add_asset_path("Base", "Fonts")
asset_tree.add_asset_path("Base", "GpuPrograms")
asset_tree.add_asset_path("Base", "Icons"... | |
<filename>tests/test_coin_outputs.py<gh_stars>0
import skycoin
import tests.utils as utils
def test_TestUxBodyHash():
uxb, _ = utils.makeUxBodyWithSecret()
hash_null = skycoin.cipher_SHA256()
hashx = skycoin.cipher_SHA256()
assert skycoin.SKY_coin_UxBody_Hash(uxb, hashx) == skycoin.SKY_OK
assert hashx != hash_nul... | |
{'Entry':1900, 'Exit':2999},
"127mm mk 34 AAC": {'Entry':1900, 'Exit':2999},
"127mm mk 41 AAC": {'Entry':1900, 'Exit':2999},
"127mm mk 41 HC": {'Entry':1900, 'Exit':2999},
"127mm mk 80 HE-PD EX-175": {'Entry':1900, 'Exit':2999},
"127mm mk 80 HE-PD mk 67": {'Entry':1900, 'Exit':2999},
"12cm/50 Mdl50 HE": {'Entry':... | |
<gh_stars>1-10
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | |
define.requiering_feature is None \
or define.name in IGNORED \
or define.value is None \
or define.is_deprecated:
return
call = ''
if define.macro_call:
call, ty = PREDEFINED_UTILS[define.macro_call]
call = '%s!' % call
value = define.value
else:
value, ty = self.rust_value(define.value)
self._generate_fea... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import threading
import time
import sys
import math
import signal
import configparser
import audioop
import subprocess as sp
import argparse
import os
import os.path
import pymumble.pymumble_py3 as pymumble
import variables as var
import logging
import logging.handlers
im... | |
is the empty dictionary {})
if self.closure != {}:
closed_system = []
for equation in system:
equation = equation.subs(self.closure).expand()
closed_system.append(equation)
system = closed_system
# 2. Clean from expectation of random fields
full_system_in_metric += self._clean_system_from_expectation(system)
... | |
"""
Standalone Utility for conversion of ArcView files to STARS project.
----------------------------------------------------------------------
AUTHOR(S): <NAME> <EMAIL>
<NAME> <EMAIL>
----------------------------------------------------------------------
"""
from guimixin import *
from guimaker import *
import os... | |
hour = time.month, time.day, time.weekday, time.hour
shift = np.flatnonzero((month == 10) & (wd == 6) & (hour == shift_hour) & (day > 24)) # DST shift hours in October
for i, df in dic.items():
print(i)
print(df.head())
# DST shift in October
for s in shift:
print(s)
if sum(np.isnan(df.iloc[s, :])) > 0 and sum... | |
Security Modules in the Amazon Redshift Cluster Management Guide.
See also: AWS API Documentation
:example: response = client.create_hsm_configuration(
HsmConfigurationIdentifier='string',
Description='string',
HsmIpAddress='string',
HsmPartitionName='string',
HsmPartitionPassword='<PASSWORD>',
HsmServerPub... | |
fiat):
url = "https://poloniex.com/public?command=returnOrderBook¤cyPair=%s" % (
self.make_market(crypto, fiat)
)
resp = self.get_url(url).json()
return {
'asks': [(float(x[0]), x[1]) for x in resp['asks']],
'bids': [(float(x[0]), x[1]) for x in resp['bids']]
}
def make_market(self, crypto, fiat):
retu... | |
"""
This module provides functions to facilitate reporting information
about uncertainty calculations.
The abbreviation ``rp`` is defined as an alias for :mod:`reporting`,
to resolve the names of objects defined in this module.
Reporting functions
-------------------
* The function :func:`budget` produces... | |
import dataclasses
import pickle
import re
import unittest
from pathlib import Path
from struct import unpack
from typing import (
NewType,
TYPE_CHECKING,
Any,
Dict,
List,
Match,
Tuple,
Union,
cast,
)
try:
from compat import ( # type: ignore
log_debug,
log_error,
log_warn,
InstructionTextToken,
Instruct... | |
11},
},
{
"eventId": 14,
"eventType": "ActivityTaskStarted",
"activityTaskStartedEventAttributes": {"scheduledEventId": 12},
},
{
"eventId": 15,
"eventType": "ActivityTaskCompleted",
"activityTaskCompletedEventAttributes": {
"scheduledEventId": 11,
"result": "5",
},
},
{"eventId": 16, "eventType": "Decis... | |
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def associate_member_account(self, memberAccountId: str):
"""
Associates a... | |
be blocking or non-blocking.)
"""
if FCGI_DEBUG: logging.debug('_recvall (%d)' % (length))
dataList = []
recvLen = 0
while length:
data = stream.read(length)
if not data: # EOF
break
dataList.append(data)
dataLen = len(data)
recvLen += dataLen
length -= dataLen
# if FCGI_DEBUG: logging.debug('recived l... | |
format :
str broker_id (not empty)
str market_id (not empty)
str symbol (not empty)
int market_type
int unit_type
int contract_type
int trade_type
int orders
str base (not empty)
str base_display (not empty)
int base_precision (not empty)
str quote (not empty)
str quote_display (not empty)
int quote_preci... | |
<gh_stars>1-10
#!/usr/bin/env python
""" md5s3stash
content addressable storage in AWS S3
"""
from __future__ import unicode_literals
import sys
import os
import argparse
import tempfile
import urllib2
import urllib
import urlparse
import base64
import logging
import hashlib
import basin
import boto
import magic
from ... | |
2))
inp = X, Y = 7, 11
lmb(inp, out=out)
assert np.allclose(out, [[3 * X**2 * Y, X**3],
[Y + 1, X + 1]])
@unittest.skipUnless(have_numpy, "Numpy not installed")
def test_jacobian__broadcast():
x, y = se.symbols('x, y')
args = se.DenseMatrix(2, 1, [x, y])
v = se.DenseMatrix(2, 1, [x**3 * y, (x+1)*(y+1)])
jac =... | |
<filename>services/traction/acapy_client/api/credential_definition_api.py
"""
Aries Cloud Agent
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0.7.2
Generated by: https://openapi-generator.tech
"""
imp... | |
discovery service is used by
clients to query information about peers. Such as - which peers have joined a
channel, what is the latest channel config, and what possible sets of peers
satisfy the endorsement policy (given a smart contract and a channel).
:attr ConfigPeerLimits limits: (optional)
:attr ConfigPeerGat... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
''' Runs various chrome tests through valgrind_test.py.'''
import glob
import logging
import optparse
import os
import subprocess
... | |
# -*- coding: utf-8 -*-
################################################################################
# Copyright (c), AiiDA team and individual contributors. #
# All rights reserved. #
# This file is part of the AiiDA-wannier90 code. #
# #
# The code is hosted on GitHub at https://github.com/aiidateam/aiida-wannier... | |
0, 0, 0, 0],
[1401, 4.261563, 0, 9999, -9999, 1.0, 100, 1, 89.339497, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1402, 1.799696, 0, 9999, -9999, 1.0, 100, 1, 26.328902, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1403, 24.445525, 0, 9999, -9999, 1.0, 100, 1, 119.651672, 0.0, 0, 0, 0, 0, 0, ... | |
", "
except IndexError:
await ctx.send(
"Not enough values were provided to update the row in the table."
)
return
command += " WHERE " + category + "=?"
try:
filec.execute(command, (value,))
except Exception as e:
await ctx.send(
"Error while running sql command:\n```py\n"
+ "".join(traceback.format_except... | |
import socket
import ssl
import os
import re
import gzip
import time
import tkinter
import tkinter.font
# DEFAULT_URL = "https://browser.engineering/http.html"
# DEFAULT_URL = "https://mozz.us/"
# DEFAULT_URL = "http://browser.engineering/redirect"
DEFAULT_URL = "file://" + os.path.abspath(os.path.join(os.path.dirnam... | |
passage = passage[:truncate_num]
if len(passage) > max_x2_len:
max_x2_len = len(passage)
x2.append(passage)
return x1, x2, candidates, y_list, max_x1_len, max_x2_len, max_a_len
def get_eval_concat_samples_from_one_list(self, inst_idx, truncate_num=0):
concat_x = []
positives = []
candidates = []
max_x... | |
<filename>pygcam/mcs/XMLResultFile.py
# Created on 5/11/15
#
# Copyright (c) 2015-2017. The Regents of the University of California (Regents).
# See the file COPYRIGHT.txt for details.
import os
from collections import OrderedDict, defaultdict
from datetime import datetime
import pandas as pd
from ..config import get... | |
a specific CAN channel of a device.
:param int channel: CAN channel to be initialized (:data:`Channel.CHANNEL_CH0` or :data:`Channel.CHANNEL_CH1`).
:param int BTR:
Baud rate register BTR0 as high byte, baud rate register BTR1 as low byte (see enum :class:`Baudrate`).
:param int baudrate: Baud rate register for all... | |
second a list of
numpy arrays containing returns for each corresponding year
'''
assert(len(timestamps) == len(returns))
if not len(timestamps): return np.array([], dtype=np.str), np.array([], dtype=np.float)
s = pd.Series(returns, index=timestamps)
years_list = []
rets_list = []
for year, rets in s.groupby(s.... | |
import serial, traceback, threading, time, sys, struct, os, array
import zipfile, shelve, random, binascii
import cPickle as pickle
import fakeserial
import itertools
################################################################################
# parsers.py
# A fairly lightweight threaded library for parsing HEG i... | |
FIXME: catch this bug in testcase
#self.change_focus((maxcol,maxrow), pos,
# row_offset+rows, 'above')
self.change_focus((maxcol,maxrow), pos,
row_offset-rows, 'above')
return
# check if cursor will stop scroll from taking effect
if cursor is not None:
x,y = cursor
if y+focus_row_offset-1 < 0... | |
= STEPS_LIB.api_get_load_related_model_float_parameter(ibus, ickt, model_type, par_name, self.toolkit_index);
par_name = self.__get_string_from_c_char_p(par_name)
parameters.append((par_name, par_value))
return tuple(parameters)
def get_line_related_model_name(self, line, model_type):
"""
Get transmission line ... | |
<reponame>SeraphRoy/PyPy-Functional
from rpython.jit.codewriter.effectinfo import EffectInfo
from rpython.jit.codewriter import longlong
from rpython.jit.metainterp import compile
from rpython.jit.metainterp.history import (Const, ConstInt, make_hashable_int,
ConstFloat)
from rpython.jit.metainterp.optimize import Inv... | |
sessions
self.target_margin = pd.Series(np.array([2, 2, np.deg2rad(5), np.deg2rad(3), np.deg2rad(3), np.deg2rad(3), np.deg2rad(3)]), ismore_pos_states)
self.target_margin = self.target_margin[self.pos_states]
self.add_dtype('target_margin', 'f8', (len(self.target_margin),))
self.sounds_general_dir = os.path.expa... | |
##############################################################################
# EVOLIFE www.dessalles.fr/Evolife <NAME> #
# Telecom ParisTech 2014 www.dessalles.fr #
##############################################################################
################################################################... | |
import asyncio
from asyncio import ensure_future as aef
from odroid_factory_api import API_MANAGER
from functools import wraps
from utils.log import init_logger
from copy import deepcopy
from usb import USB
import ethernet
import aiohttp
import iperf
import os
from evtest import Evtest
from task import Component
from ... | |
<reponame>andersop91/core
"""Test config flow."""
from ipaddress import IPv4Address
from unittest.mock import ANY, patch
from pyatv import exceptions
from pyatv.const import PairingRequirement, Protocol
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import zeroc... | |
binding "
"%(binding)s for port %(port)s, deleting "
"DHCP binding on server",
{'binding': binding['id'], 'port': port['id']})
fake_db_binding = {
'port_id': port['id'],
'nsx_service_id': dhcp_service['nsx_service_id'],
'nsx_binding_id': binding['id']}
self._delete_dhcp_binding_on_server(context, fake_db_bindin... | |
<reponame>ArcGIS/military-tools-geoprocessing-toolbox<filename>tools/militarytools/esri/toolboxes/scripts/VisTools.py<gh_stars>10-100
# coding: utf-8
'''
------------------------------------------------------------------------------
Copyright 2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
... | |
1, 0, 1, 0],
world=self.world)
no_14_vehicle_planner = WaypointFollower_FullMap(actor=self.no_14_vehicle,
target_speed=self.no_14_vehicle_speed,
actor_location=no_14_wp_location,
map=self._map, avoid_collision=True,
pattern_1=[1, 1, 0, 3, 1, 1, 1, 1, 1, 0, 1, 0],
world=self.world)
self.vehicle_planners = [fir... | |
<filename>libcloud/storage/drivers/local.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... | |
self.build(context, token)
return 11
if self.match_TagLine(context, token):
self.end_rule(context, 'Scenario')
self.end_rule(context, 'ScenarioDefinition')
self.start_rule(context, 'Rule')
self.start_rule(context, 'RuleHeader')
self.start_rule(context, 'Tags')
self.build(context, token)
return 22
if self.matc... | |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from collections import defaultdict
from datetime import datetime
from dateutil import relativedelta
from itertools import groupby
from operator import itemgetter
from re import findall as regex_findall, split as regex_s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.