input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
that has shared network with no subdomain access
self.apiclient.connection.apiKey = self.user_d1_apikey
self.apiclient.connection.securityKey = self.user_d1_secretkey
self.vmdata["name"] = self.acldata["vmD111A"]["name"] + "-shared-scope-domain-nosubdomainaccess-domain-admin"
self.vmdata["displayname"] = self.acld... | |
<reponame>sloebrich/sage
# -*- coding: utf-8 -*-
r"""
Interfaces to R
This is the reference to the Sagemath R interface, usable from any
Sage program.
The %r interface creating an R cell in the sage
notebook is decribed in the Notebook manual.
The %R and %%R interface creating an R line or an R cell in the
Jupyter n... | |
loc = para_local[0], scale = para_local[1]) == 0:
plume_draw[i] = numpy.random.normal(loc = input_plume[i], scale = draw_scale[i], size = 1)
print "try resample plume"
if prior_type_plume[i] == "Uniform":
plume_draw[i] = numpy.random.normal(loc = input_plume[i], scale = draw_scale[i], size = 1)
while plume_dra... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: <NAME>, <EMAIL>
# !python3
"""
Make nice spectrum objects to pass around SED class
"""
import copy
from functools import wraps, partial
from itertools import groupby
from operator import itemgetter
from multiprocessing import Pool
import os
from pkg_resources impo... | |
#!/usr/bin/env python
#-------------------------------------------------------------------#
# Benchmark runner
#-------------------------------------------------------------------#
# NOTE: this script reads from the standard output/error to extract
# information about OCCAM and ROPgadget. Thus, any change in these
# ... | |
#!/usr/bin/env python
# encoding: utf-8
"""
first_level.py
Created by O.Colizoli, June-2019
Last update: 11-06-2019
Python version 2.7
The following packages need to be installed because they are called from the command line, but not imported:
fsl
"""
# TO DO:
# bids output files: sub, session, task, run, filetypeb... | |
<gh_stars>0
# multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai... | |
"""
d = {}
for t in reversed(cls.__mro__):
d = dict(d, **getattr(t, 'permissions_desc', {}))
return d.get(permission, '')
def parent_security_context(self):
"""Return the parent of this object.
Used for calculating permissions based on trees of ACLs.
"""
return self.config.parent_security_context()
@prope... | |
<filename>src/python/turicreate/toolkits/clustering/dbscan.py
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Class definition a... | |
# Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
import pythoncom
import win32com.client
import time
from pythoncom import com_error
import robot.libraries.Screenshot as screenshot
import os
from robot.api import logger
class SapGuiLibrary:
"""The SapGuiLibrary is a library that enables users to create tests for the Sap Gui application
The library uses the Sap S... | |
from __future__ import division, print_function, absolute_import
import numpy as np
import tensorflow.compat.v1 as tf
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import standard_ops
import tflearn
from tflearn import utils
from tflearn import variables as va
from tflearn import activati... | |
<filename>pygears/hls/ir.py<gh_stars>100-1000
import ast as opc
import inspect
import attr
import typing
import textwrap
from dataclasses import dataclass, field
from pygears.typing.base import TypingMeta, GenericMeta, class_and_instance_method
from functools import reduce
from pygears import Intf
from pygears.core.po... | |
<filename>ditto/utils.py
from collections import deque
from typing import Type, List, Tuple
from airflow import DAG
from airflow.models import BaseOperator
import networkx as nx
from ditto.api import TaskMatcher, DAGFragment
import re
from queue import Queue
class TransformerUtils:
@staticmethod
def get_list_ind... | |
<reponame>chkoar/scikit-learn-extra<filename>sklearn_extra/cluster/_k_medoids.py
# -*- coding: utf-8 -*-
"""K-medoids clustering"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD 3 clause
import warnings
import numpy as np
from sklearn.base import BaseEstimator, ... | |
for forward pagination |default| :code:`None`
:param int first: Maximum number of objects to return. Maximum: 100. |default| :code:`20`
:param list[str] tag_ids: IDs of tags. Maximum 100 entries |default| :code:`None`
:raises ~twitchAPI.types.TwitchAPIException: if the request was malformed
:raises ~twitchAPI.types... | |
z-faces", fontsize=16)
>>> ax2 = fig.add_subplot(122)
>>> mesh.plot_image(phi_c, ax=ax2, normal='Y', slice_loc=0, v_type="CC")
>>> ax2.set_title("Averaged to cell centers", fontsize=16)
>>> plt.show()
Below, we show a spy plot illustrating the sparsity and mapping
of the operator
.. collapse:: Expand to show s... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 15 21:56:08 2020
@author: <NAME>
"""
# STEP1----------------- # Importing the libraries------------
#-------------------------------------------------------------
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import glob
... | |
"""
Wrapper to get species from a summary dictionary and split them
into train/val/test using the scaffold split in ChemProp.
"""
import csv
import os
import numpy as np
import json
import shutil
import argparse
from rdkit import Chem
from tqdm import tqdm
from nff.utils import bash_command, parse_args, fprint, prop_... | |
import subprocess as sp
import os
import speech_recognition as sr
import webbrowser as wb
r = sr.Recognizer()
while True:
os.system("tput setaf 10")
print("\t\tWELCOME TO VOICE CONTROLLED AUTOMATION MENU")
print("\t\t--------------------------------")
print()
print()
print("which services would you like to auto... | |
<reponame>afourmy/e-napalm
from ast import literal_eval
from atexit import register
from contextlib import contextmanager
from flask_login import current_user
from importlib.util import module_from_spec, spec_from_file_location
from json import loads
from logging import error, info, warning
from operator import attrget... | |
noteNumber: A list of note references to the notes provided below.
adjudication: The adjudications results.
subDetail: Third tier of goods and services.
"""
__name__ = 'ExplanationOfBenefit_Detail'
def __init__(self, dict_values=None):
self.sequence = None
# type: int
self.type = None
# reference to Codeabl... | |
#!/usr/bin/env python3
"""Generate a random GURPS Dungeon Fantasy character."""
import argparse
from collections import Counter
import copy
from enum import Enum, auto
import os
import random
import re
from typing import Dict, List, Set, Tuple
import typing
import xml.etree.ElementTree as et
class TraitType(Enum)... | |
False
context = self.retrieve_context(keys[1])
if context is None:
return False
if len(keys) == 3:
if keys[2] not in ('max-trades', 'mode'):
return False
if context.trade_quantity_type == context.TRADE_QUANTITY_MANAGED:
# in this mode it must be managed by its handler
return False
if keys[2] == 'max-trade... | |
m
except:
raise
else:
dumpkeys = []
for _,v in porttype.items():
dumpkeys.extend(v.get('portkeys'))
for m in self._dumpkeys(dumpkeys):
yield m
def updatephysicalport(self,name,vhost='',systemid='%',bridge='%',**args):
"update physicalport info that id, return updated info"
if not name:
raise ValueError("mu... | |
`pandas.DataFrame`
## Example
```python
>>> fred = FRED(api_key='<KEY>')
>>> fred.category_related_tags(category_id=125, tag_names=['services', 'quarterly']).head()
group_id notes created popularity series_count
name
discontinued gen 2012-02-27 16:18:19+00:00 67 4
nsa seas Not Seasonally Adjusted 2012-02-27 16... | |
import discord
import aiohttp
import asyncio
import json
import bs4
from bs4 import BeautifulSoup
from __main__ import send_cmd_help
from .utils import chat_formatting as chat
from discord.ext import commands
IMAGE_SEARCH = 'http://www.dnd.beyond.com/{}?filter-search={}'
schema={
'spells':(
{'id':'string'},
{'inde... | |
'''
alyE5071B
Created on Jun, 2015
@author: bmates1
'''
import gpib_instrument
import numpy as np
import pickle
import pylab
import math
import time
class alyE5071B(gpib_instrument.Gpib_Instrument):
'''
The network analyzer Agilent E5071B GPIB communication class
'''
def __init__(self, pad, board_number = 0, na... | |
from subprocess import Popen, PIPE, signal
import os
import re
from modules.webrequests import GetCPUHardwareData, UpdateSupportedDevices
from modules.deviceCacher import GetCachedDeviceData, CacheDevice
from modules.deviceInfoFormat import PrintError
CPUHardwareData = {}
def SetCPUHardwareData():
global CPUHardwa... | |
import copy
import ipaddress
import json
import logging
from tests.common.errors import RunAnsibleModuleFail
from tests.common.devices.sonic import SonicHost
from tests.common.devices.sonic_asic import SonicAsic
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.constants import DEFAUL... | |
#!/usr/bin/env python
"""
Parser for FCS 2.0, 3.0, 3.1 files. Python 2/3 compatible.
`
Distributed under the MIT License.
Useful documentation for dtypes in numpy
http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.byteswap.html?highlight=byteswap#numpy.ndarray.byteswap # noqa
http://docs.scipy.org/doc/n... | |
'geometries')
slice_ = self.get(ix, src)
if view is None:
slice_lens = np.array([len(item) for item in slice_])
axis = np.argmin(slice_lens)
else:
mapping = {0: 0, 1: 1, 2: 2,
'i': 0, 'x': 1, 'h': 2,
'iline': 0, 'xline': 1, 'height': 2, 'depth': 2}
axis = mapping[view]
if axis == 0:
crop = self.__load_h5py... | |
"""ダイナミクスを導出"""
import sympy as sy
#from sympy import sqrt
import tqdm
import kinematics
import utils
def operate_T2(A):
"""T2演算"""
return A[0,0] + A[1,1]
def operate_V(A):
"""ベクトル化演算"""
V_A = A.reshape(len(A), 1)
return V_A
def operate_tilde(A):
"""行列の最後の列を0埋め"""
m, _ = A.shape
tilde_A = A
for i in ran... | |
<gh_stars>1-10
import abc
import asyncio
import cProfile
import functools
import ipaddress
import json
import logging
import pstats
import re
import string
import types
import typing
import uuid
from email.utils import parseaddr
import acme.jws
import acme.messages
import aiohttp_jinja2
import josepy
import yarl
from ... | |
#!/usr/bin/env python
# Copyright 2018, 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 co... | |
# coding: utf-8
"""Dirty Hack to cache simprod data for weighting for offline usage
Code is adopted from `from_simprod` function:
https://code.icecube.wisc.edu/projects/icecube/browser/IceCube/meta-projects/
combo/trunk/weighting/python/weighting.py#L823
Line 823 is where to get the database PW from.
"""
from __futur... | |
<gh_stars>10-100
#!/usr/bin/python
from __future__ import print_function, absolute_import
###Sterimol (and Tolman CA) Calculator###
###############################################################
# sterimoltools.py #
# #
###############################################################
#Python Libraries
import subpr... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import bisect
import collections
import io
import itertools
import json
import os
import pprint
import re
import sqlite3
import stat
import sys
import tarfile
import tempfile
import time
import traceback
from timeit import default_timer as timer
try:
imp... | |
<gh_stars>0
from os import listdir, system, remove
from os.path import isfile, join
import re
import multiprocessing
from urllib.parse import unquote
import json
from lxml import etree
import pandas as pd
import tqdm
import time
import httplib2
from bs4 import BeautifulSoup, SoupStrainer
import wget
from multiprocessin... | |
<reponame>securedataplane/mts
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 22:12:05 2018
@author: saad
"""
'''
Scenarios:
+ Single tenant:
+ phy2vm2vm2phy_Baseline_NoDPDK
+ phy2vm2vm2phy_Baseline_DPDK
+ phy2vm2vm2phy_SRIOV_NoDPDK
+ phy2vm2vm2phy_SRIOV_DPDK
+ phy2phy_Baseline_NoDPD... | |
import autogalaxy as ag
import numpy as np
import pytest
from autogalaxy import exc
from autogalaxy.plane import plane
from skimage import measure
from autogalaxy.mock import mock
def critical_curve_via_magnification_from_plane_and_grid(plane, grid):
magnification = plane.magnification_2d_from_grid(grid=... | |
'31'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '咸'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = ... | |
import numpy as np
import gym
import copy
import matplotlib.pyplot as plt
from matplotlib import animation
from collections import defaultdict
from dps import cfg
from dps.env.basic import game
from dps.env.env import BatchGymEnv
from dps.utils import Param, square_subplots, create_maze
from dps.train import Hook
from... | |
0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, ... | |
def create_xpub_wallet(self, xpub):
account = BIP32_Account({'xpub':xpub})
self.storage.put('seed_version', self.seed_version)
self.add_master_public_key(self.root_name, xpub)
self.add_account('0', account)
class BIP32_RD_Wallet(BIP32_Wallet):
# Abstract base class for a BIP32 wallet with a self.root_derivation
... | |
<filename>whoville/cloudbreak/apis/v3utils_api.py
# coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitori... | |
return passwd.GetMyHomeDir()
return passwd.GetHomeDir(token)
def _EvalVarNum(self, var_num):
# type: (int) -> value_t
assert var_num >= 0
return self.mem.GetArgNum(var_num)
def _EvalSpecialVar(self, op_id, quoted):
# type: (int, bool) -> Tuple[value_t, bool]
"""Returns (val, bool maybe_decay_array).
TODO: ... | |
= ',np.max(np.abs(np.log(np.diagonal(cov))-np.log(var_kkk))))
np.testing.assert_allclose(np.log(np.diagonal(cov)), np.log(var_kkk), atol=0.4*tol_factor)
# Patch on 2,3
print('with patches on 2,3:')
kkkp.process(cat, catp)
print(kkkp.zeta.ravel())
np.testing.assert_allclose(kkkp.zeta, kkk.zeta, rtol=0.1 * tol_fac... | |
(ie. not logged) user can see a user's river.
"""
# request uA's river without loging in.
resp = self.client.get(reverse("user_river_sieve",
kwargs={"owner_name":"uA"}))
self.assertEqual(302,resp.status_code)
self.assertRegex(
resp["Location"],
reverse('user_login')
+ "\\?next="
+ reverse("user_river_sieve",
... | |
to identify the main channel at each divergence:
• A 50-meter buffer polygon is drawn around each flowline feature. A flat end-cap is used, so that only areas perpendicular to the flowlines are included in each buffer.
• Zonal statistics for the lidar-based DEM values within each buffer polygon are computed using t... | |
arguments.
revision = int(request.args.get('revision',
ts.Machine.DEFAULT_BASELINE_REVISION))
field = fields.get(request.args.get('field', None), metric_fields[0])
# Get the list of all runs we might be interested in.
recent_runs = session.query(ts.Run) \
.filter(ts.Run.start_time > yesterday) \
.all()
# Aggr... | |
# Copyright 2016 IBM, Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | |
<gh_stars>0
# -*- coding: utf-8 -*-
import json
import os
from datetime import datetime, timedelta
from urllib.parse import urlencode
from django.conf import settings
from django.core import mail
from django.core.files.storage import default_storage as storage
from django.test import RequestFactory
from django.urls i... | |
'gaussian', 'gaussian2', etc. If False, only the segment
with exact name match gets a replacement.
Raises:
ValueError: If the argument can not be matched (either the argument
name does not match or the argument number is wrong).
ValueError: If the name can not be matched.
"""
# TODO: is there any reason to use... | |
, OOo ]
lisp . lisp_start_rloc_probe_timer ( 1 , II )
O0o0Ooo = { "type" : "itr-crypto-port" , "port" : iiI1iIiI }
lisp . lisp_write_to_dp_socket ( O0o0Ooo )
if 84 - 84: ooOoO0o + i11iIiiIii - OOooOOo * ooOoO0o
if 33 - 33: ooOoO0o % i1IIi - oO0o . O0 / O0
if 96 - 96: OoooooooOO + IiII * O0
if 86 - 86: Ii1I
if 2... | |
length == 1:
primary.addPathsFrom(parts[piece[0]])
elif length > 1:
primary.addPathsFrom(parts[piece[0]])
for idx in range(1, length):
secondary.addPathsFrom(parts[piece[idx]])
data = [
primary,
secondary]
self.jewelrySets[key].append(data)
self.currentJewelry = {
'LEar': [
0,
0,
0],
'REar': [
0... | |
partition_hint=100, count_downsamplings=POPS,
impose_high_af_cutoff_here=not impose_high_af_cutoff_upfront)
ht = ht.join(possible_ht, 'outer')
return ht
def build_models(coverage_ht: hl.Table, trimers: bool = False, weighted: bool = False, half_cutoff = False,
) -> Tuple[Tuple[float, float], Dict[str, Tuple[float... | |
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
import os
import sys
import subprocess
import string
import argparse
from time import gmtime, strftime
version = 'v2.0'
print('createImageSeq {}'.format(version))
print('python {}'.format(sys.version))
... | |
a.sampling_interval,
sampling_rate=2 * a.sampling_rate)
npt.assert_equal(ts.Frequency(b.sampling_rate),
ts.Frequency(2 * a.sampling_rate))
npt.assert_equal(b.sampling_interval,
ts.TimeArray(0.5 * a.sampling_rate))
b = ts.UniformTime(duration=10,
sampling_interval=a.sampling_interval)
npt.assert_equal(b.sampl... | |
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of data model for SVC monitor
"""
from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
from cfgm_common.vnc_db import DBBase
from cfgm_common import svc_info
class DBBaseSM(DBBase):
obj_type = __name__
d... | |
def test_asinh_taggedData_rank0(self):
arg=Data(46.3645811357,self.functionspace)
arg.setTaggedValue(1,98.4380067047)
res=asinh(arg)
ref=Data(4.52979928711,self.functionspace)
ref.setTaggedValue(1,5.28259995573)
self.assertTrue(isinstance(res,Data),"wrong type of result.")
self.assertEqual(res.getShape(),(),"wro... | |
fh_out.write('\t'.join(fields)+'\n')
else: # chrom is not on the list
fh_out.write(line+'\n')
else: # chrom is not on the list
fh_out.write(line+'\n')
linenum = linenum +1
fh_log.write("In "+ str(table) + ": " +str(var_count) +' in ' + str(line_count) + ' variants\n')
fh_log.close()
conn.close()
fh.clo... | |
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
_lease_id = None
if lease_access_conditions is not None:
_lease_id = lease_access_conditions.lease_id
request = build_delete_request(
url=self._config.url,
versio... | |
<filename>bathy_smoother/bathy_smoother/LP_bathy_tools.py
import numpy as np
from bathy_smoother import bathy_smoothing
# This code is adapted from the matlab code
# "LP Bathymetry" by <NAME>
# http://drobilica.irb.hr/~mathieu/Bathymetry/index.html
# For a description of the method, see
# <NAME>, <NAME>, <NAME>, A new... | |
1055,5,146.0,176,Adult Care,1970-01-01 06:56:00,0.2,24.0,0.36
1056,10,47154.0,177,Leisure,1970-01-01 06:57:00,63.93,4276.0,63.27
1057,6,12515.0,177,Work and Education,1970-01-01 06:57:00,16.97,1122.0,16.6
1058,11,6417.0,177,Travel and Other,1970-01-01 06:57:00,8.7,608.0,9.0
1059,3,3900.0,177,Housework,1970-01-01 06... | |
<reponame>scramjetorg/framework-python<gh_stars>10-100
from scramjet.pyfca import Pyfca, DropChunk
import asyncio
from scramjet.ansi_color_codes import *
from os import environ
import scramjet.utils as utils
from collections.abc import Iterable, AsyncIterable
import re
DEBUG = 'DATASTREAM_DEBUG' in environ or 'SCRAMJE... | |
None, None, None),
0x80ef: (0x001f, "mTALocalCred", "ms-Exch-MTA-Local-Cred", 2, None, None, None),
0x80f0: (0x001f, "mTALocalDesig", "ms-Exch-MTA-Local-Desig", 2, None, None, None),
0x80f1: (0x0102, "nAddress", "ms-Exch-N-Address", 2, None, None, None),
0x80f2: (0x0003, "nAddressType", "ms-Exch-N-Address-Type", 2,... | |
# Copyright 2014 Big Switch Networks, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | |
<reponame>jumploop/Python3_WebSpider
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2020/9/23 23:06
# @Author : 一叶知秋
# @File : simple.py
# @Software: PyCharm
import codecs
import copy
import csv
import json
import logging
import logging.config
import math
import os
import random
import sys
from collections ... | |
res += C12[u, v].dot(x.dot(AA34[u, v].conj().T))
return res
def eps_r_op_2s_AA12_C34(x, AA12, C34):
res = np.zeros((AA12.shape[2], C34.shape[2]), dtype=C34.dtype)
for u in xrange(C34.shape[0]):
for v in xrange(C34.shape[1]):
res += AA12[u, v].dot(x.dot(C34[u, v].conj().T))
return res
def eps_l_op_2s_AA12_C34(... | |
<filename>voltha/adapters/adtran_olt/test/resources/test_adtranolt_platform.py
# Copyright 2017-present Adtran, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | |
"""
An implementation of the OpenAI Transformer Language Model.
Mostly just a slightly modified version of
https://github.com/huggingface/pytorch-openai-transformer-lm
so thanks to them!
Some of these modules duplicate code elsewhere in AllenNLP,
but the serialized weights depend on the exact parameter setup
here, so... | |
<reponame>Tseplyaev/aiida-fleur
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. #
# All rights reserved. #
# This file is part of the AiiDA-FLEUR package. #
# #
# The code is hosted on GitHub at... | |
<filename>pymc3/tests/test_step.py<gh_stars>1-10
import shutil
import tempfile
from .checks import close_to
from .models import (simple_categorical, mv_simple, mv_simple_discrete,
mv_prior_simple, simple_2model_continuous)
from pymc3.sampling import assign_step_methods, sample
from pymc3.model import Model
from pymc3... | |
<filename>tests/fake_data.py
from scipy.signal import find_peaks
from astropy.io import fits
from astropy import constants as c
from astropy import units as u
import numpy as np
import pylab as plt
from astropy.table import Table
import os
from src.BAGLE import model
from src.BAGLE import model_fitter
from src.BAGLE im... | |
f'be read. Invalidating rotor.'
logger.error(message)
break
trajectory = parser.parse_1d_scan_coords(path=job.local_path_to_output_file) \
if self.species_dict[label].is_ts else None
invalidate, invalidation_reason, message, actions = scan_quality_check(
label=label,
pivots=job.pivots,
energies=energies,
scan_... | |
#! /usr/bin/env python
#
# mosaic.py -- Example of quick and dirty mosaicing of FITS images
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
Usage:
$ ./mosaic.py -o output.fits input1.fits input2.fits ... inputN.fits
"""
import sys
import os
import ma... | |
'concentration'), **kwargs)
def plot_displacement(self, recording_step, file_name=None, **kwargs):
if file_name is None:
file_name = "displacement_%04d.png"%recording_step
plot_params = {"label" : "displacement",
"title" : "displacement @ step %04d"%recording_step}
kwargs.update(plot_params)
self.plot(recording... | |
<filename>modules/volterra/volterra_resource_site_create.py<gh_stars>0
#!/usr/bin/env python3
import os
import sys
import json
import argparse
import urllib.request
from urllib.error import HTTPError
def get_tenant_id(tenant, token):
headers = {
"Authorization": "APIToken %s" % token
}
try:
url = "https://%s.c... | |
<gh_stars>0
import math
import sys
from scipy.interpolate import interp2d
from scipy.ndimage import rotate, center_of_mass
from scipy.spatial import distance
from skimage.feature import canny
from skimage.filters import rank, gaussian
from skimage.measure import subdivide_polygon
from skimage.morphology import medial_... | |
already exists: ", topdir)
return False
def _search_print_v1(self, repo_list):
"""Print search results from v1 API"""
for repo in repo_list["results"]:
if "is_official" in repo and repo["is_official"]:
is_official = "[OK]"
else:
is_official = "----"
description = ""
if "description" in repo and repo["descrip... | |
a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_contact_info(email, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str email: Email (urlencoded) of the contact OR its SMS attribute value (required)
:return: GetEx... | |
Write register
self._set_bank(0)
return self._i2c.write_byte_data(self.address, self._AGB0_REG_PWR_MGMT_1, register)
def low_power(self, on):
"""
Sets the ICM20948 module in or out of low power mode
:return: Returns true if the power mode setting write was successful, otherwise False.
:rtype: bool
"""... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import json
import math
import os
import sys
import time
from dynet import *
from optparse import OptionParser
from evaluation import *
from discrete_argid_feats import ArgPosition, OutHeads, SpanWidth
from raw_data import make_data_instance
from semafor_evaluation import convert... | |
element in enumerate(sequence):
# default input, argument name is 'inputs', value specified below
if index == 0:
inputs = 'inputs.0'
else:
inputs = 'steps.{}.produce'.format(index - 1)
if isinstance(element, pipeline_module.Pipeline):
step = pipeline_module.SubpipelineStep(element.to_json_structure(nest_subpipe... | |
from Voicelab.VoicelabWizard.VoicelabDataModel import VoicelabDataModel
from Voicelab.pipeline.Pipeline import Pipeline
import Voicelab.toolkits.Voicelab as Voicelab
import copy
from Voicelab.VoicelabWizard.InputTab import InputTab
import parselmouth
from parselmouth.praat import call
from Voicelab.default_settings i... | |
# (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
lookup: schedule_rruleset
author: <NAME> (@john-westcott-iv)
short_description: Generate ... | |
<reponame>capriele/Crazyflie-Indoor-Position-Logger-Controller
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
... | |
limited at the protocol level to a logically
adjacent topology.
ATTACK_VECTOR_LOCAL: The vulnerable component is not bound to the
network stack and the attacker's path is via read/write/execute
capabilities.
ATTACK_VECTOR_PHYSICAL: The attack requires the attacker to physically
touch or manipulate the vulnerable ... | |
10
try:
tempstep = int(values['-nxstepr-'])
if tempstep >= 0:
nxstep = tempstep
except:
pass
if (float(ntstep) * float(nxstep)) > 50000:
cancelRun = True
confirmLayout = [[sg.Text('The selected calculation is large and may take some time.')],[sg.Button('Continue'), sg.Button('Cancel')]]
confirmWindow = sg.Win... | |
data, "back": back, "err": back_err}
fig = self.draw.getfigure(**kargs)
fig.subplots_adjust(0.02, 0.02, 0.97, 0.97, wspace=0.1, hspace=0.1)
# Work out values for the histograms
erad = 0.69813170079773 # each segment gets 0.69813170079773 (or thereabouts) rads
eradh = erad / 2.0
eradq = eradh / 2.0
theta = nump... | |
<reponame>attom/barnfire<filename>src/materials_bondarenko.py<gh_stars>1-10
'''
<NAME>
Summer 2014
Bondarenko iteration utility for materials
'''
#STDLIB
import os
import shutil
#TPL
import numpy as np
#MINE
from materials_util import is_fissionable
import materials_util as util
from directories import get_common_dir... | |
import json
import global_settings as gs
from collections import defaultdict
def query_bigquery(query):
import boto3
import google.auth
from google.cloud import bigquery
"""
Runs a query in Google BigQuery and returns the result as a list of dicts
(each line is an element in the list, and each column is an entry... | |
self.set_keys=set([])
self.node_name=node_name
self.runtime_credentials=runtime_credentials
self.protocol = KademliaProtocolAppend(self.node, self.storage, ksize, node_name=self.node_name, set_keys=self.set_keys, runtime_credentials=self.runtime_credentials)
if kademlia_version != '0.5':
_log.error("##############... | |
import math
from .._compat import is_string_or_bytes, range, PY2, abc
from six import integer_types
def float_to_byte_bit_pair(n):
return (int(n), int((n - int(n)) * 8))
class BitView(abc.Sequence):
"""
Provides bit indexing over an existing buffer.
For example, you can do this:
bit_view = BitView(...)
bits_... | |
receiver node requesting a content
content : any hashable type
The content identifier requested by the receiver
log : bool
*True* if this session needs to be reported to the collector,
*False* otherwise
"""
self.session[flow_id] = dict(timestamp=timestamp,
receiver=receiver,
content=content,
log=log,
deadlin... | |
#!/usr/bin/env python
#
# Licensed under the BSD license. See full license in LICENSE file.
# http://www.lightshowpi.com/
#
# Author: <NAME> (<EMAIL>)
# Author: <NAME> (<EMAIL>)
# Author: <NAME>
# Author: <NAME> (<EMAIL>)
# Author: <NAME> (<EMAIL>)
"""Play any audio file and synchronize lights to the music
When execu... | |
#********************************************************************
# File: blocks_series2.py
# Author: <NAME>
#
# Description:
# Series 2 blocks
#
# Copyright (c) 2017 by Cisco Systems, Inc.
#
# ALL RIGHTS RESERVED. THESE SOURCE FILES ARE THE SOLE PROPERTY
# OF CISCO SYSTEMS, Inc. AND CONTAIN CONFIDENTIAL AND PROPR... | |
the Swift password.""")
@click.option('--if-match', help="""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide mat... | |
= _result
return _result
Shape = tf_export("raw_ops.Shape")(_ops.to_raw_op(shape))
def shape_eager_fallback(input, out_type, name, ctx):
if out_type is None:
out_type = _dtypes.int32
out_type = _execute.make_type(out_type, "out_type")
_attr_T, (input,) = _execute.args_to_matching_eager([input], ctx)
_inputs_fl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.