input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
from hashlib import md5, blake2b, sha256, sha1
################################################################################################################
#
# All Music
#
################################################################################################################
class allmusicUtils:
def __in... | |
# for (\nabla\mu) \nu + \mu (\nabla\nu)
vmata[i] = vmata[i] + vmata[i].swapaxes(-1,-2).conj()
vmatb[i] = vmatb[i] + vmatb[i].swapaxes(-1,-2).conj()
elif xctype == 'MGGA':
raise NotImplementedError('meta-GGA')
if dma.ndim == vmata[0].ndim: # One set of DMs in the input
vmata = vmata[0]
vmatb = vmatb[0]
return l... | |
<reponame>PlasticMem/tencentcloud-sdk-python<filename>tencentcloud/live/v20180801/models.py
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | |
"""The functions for converting to and from the Hyperbolic simplex basis"""
from copy import deepcopy
import logging
import numpy as np
#from psych_metric.distrib.simplex.euclidean import EuclideanSimplexTransform
def cart2polar(vectors):
"""Convert from 2d Cartesian coordinates to polar coordinates.
Parameters
... | |
<filename>fiscalyear.py
"""Utilities for managing the fiscal calendar."""
from __future__ import division, with_statement
__author__ = '<NAME>'
__version__ = '0.1.0'
import calendar
import contextlib
import datetime
# Number of months in each quarter
MONTHS_PER_QUARTER = 12 // 4
MIN_QUARTER = 1
MAX_QUARTER = 4
#... | |
(0x91FE, 0), # East Asian ideograph
0x3A2F7C: (0x64C0, 0), # East Asian ideograph
0x395A2F: (0x58F2, 0), # East Asian ideograph
0x334F59: (0x7A93, 0), # East Asian ideograph
0x293C57: (0x8F79, 0), # East Asian ideograph
0x6F4F5A: (0xB989, 0), # Korean hangul
0x215C21: (0x901F, 0), # East Asian ideograph
0x215C22... | |
"""
05/10/2021 - <NAME>
The functions in the file are used to generate the Dynamic
Quantum Variational Ansatz (DQVA) in a manner that is amenable
to circuit cutting.
"""
from qiskit import QuantumCircuit, AncillaRegister, converters
from qiskit.circuit import ControlledGate
from qiskit.circuit.library.standard_gates i... | |
<reponame>securedataplane/preacher<filename>src/testing/TestON/tests/CHOtest/CHOtest.py
import sys
import os
import re
import time
import json
import itertools
class CHOtest:
def __init__( self ):
self.default = ''
def CASE1( self, main ):
"""
Startup sequence:
apply cell <name>
git pull
mvn clean install
... | |
<filename>cardboard/cards/sets/darksteel.py
from cardboard import types
from cardboard.ability import (
AbilityNotImplemented, spell, activated, triggered, static
)
from cardboard.cards import card, common, keywords, match
@card("Neurok Transmuter")
def neurok_transmuter(card, abilities):
def neurok_transmuter():
... | |
<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import binascii
import codecs
import os
import platform
import re
import subprocess
import threading
import time
import frida
def main():
from colorama import Fore, Style
import json
from frida_tools.application import C... | |
#!/usr/bin/env python
#
# imagewrapper.py - The ImageWrapper class.
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides the :class:`ImageWrapper` class, which can be used
to manage data access to ``nibabel`` NIFTI images.
Terminology
-----------
There are some confusing terms used in this module, so it may be us... | |
i.e.
no possibility for noise. Lindblad SPAM operations are the "normal"
way to allow SPAM noise, in which case error terms up to weight
`maxSpamWeight` are included. Tensor-product operations require that
the state prep and POVM effects have a tensor-product structure; the
"tensorproduct" mode exists for historic... | |
assert batch.multiply(3, 4) is None
begin = time.time()
results = batch(oneway=True)
duration = time.time() - begin
assert duration < 0.1, "oneway batch with delay should return almost immediately"
assert results is None
def testPyroTracebackNormal(self):
with Pyro5.client.Proxy(self.objectUri) as p:
with pyte... | |
\
optional, and may be empty if no secret is required. If the secret object \
contains more than one secret, all secret references are passed.
:param read_only: Specifies a read-only configuration for the volume. Defaults to \
false (read/write).
"""
def __init__(
self,
driver: str,
fs_type: str,
volume_attr... | |
<filename>calc.py
#!/usr/bin python3
# -*- coding:UTF-8 -*-
# Author: nigo
import os
import json
import pandas as pd
import akshare as ak
import baostock as bs
import datetime
import numpy as np
from multiprocessing import Pool
import multiprocessing.pool as mpp
import istarmap
from tqdm import tqdm
import plotly.figur... | |
# -*- coding: utf-8 -*-
import os, sys, requests, json, logging, time, base64, imghdr
if sys.version_info[0] > 2:
import http.client
else:
import httplib
assert httplib
from optparse import OptionParser
from datetime import datetime
__version__ = '2.60.0'
FORMAT = "%(message)s"
logging.basicConfig(format=FORMAT... | |
<reponame>webhacking/finance<filename>finance/models.py<gh_stars>0
import collections
import functools
import operator
from datetime import datetime, timedelta
import os
from sqlalchemy import create_engine, desc
from sqlalchemy import (
BigInteger,
Column,
DateTime,
Enum,
ForeignKey,
ForeignKeyConstraint,
Inte... | |
#!/usr/bin/python2.5 # pylint: disable-msg=C6301,C6409
#
# Copyright 2009 Google 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... | |
owner_id:
raise commands.errors.CheckFailure
if new_volume == def_v:
return await ctx.invoke(self.defvolume_delete)
if 0 <= new_volume <= 100:
settings = await SettingsDB.get_instance().get_guild_settings(ctx.guild.id)
settings.volume = new_volume
await SettingsDB.get_instance().set_guild_settings(settings)
aw... | |
import pandas as pd
import numpy as np
import copy
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import cross_val_score, train_test_split, GridSearchCV
from sklearn.feature_selection import mutual_info_classif, SelectKBest
import matplotlib.pyplot as plt
from sklearn import svm
from sk... | |
255, 255);")
self.title_senha_16.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.title_senha_16.setObjectName("title_senha_16")
self.title_email_16 = QtWidgets.QLabel(self.registro_16)
self.title_email_16.setGeometry(QtCore.QRect(0, 90, 80, 30))
self.title_email_16.setMinimum... | |
<reponame>jinju-rhee/microeconometrics_replication
from localreg import *
import pandas as pd
import numpy as np
import econtools
import econtools.metrics as mt
from auxiliary.auxiliary_subset import *
from auxiliary.auxiliary_tables import *
##===============================
## For descriptive statistics table
d... | |
# -*- coding: utf-8 -*-
import operator
import sys
import numpy as np
import tensorflow as tf
from jtr.nn.models import get_total_trainable_variables
from jtr.util.tfutil import tfrun
class Vocab(object):
"""
Vocab objects for use in jtr pipelines.
Example:
>>> #Test Vocab without pre-trained embeddings
>>> ... | |
sub-model
if isinstance(value, dict):
for entrykey, entryval in value.items():
if entry_err_attr[entrykey] == numDSs:
raise PyDSTool_AttributeError('Parameter does not' +\
' exist in any sub-model: %s = %f'%(entrykey,
entryval))
if entry_err_val[entrykey] == numDSs:
raise PyDSTool_ValueError('Parameter value er... | |
<gh_stars>0
"""sls.py
An implementation of the robust adaptive controller.
Both FIR SLS version with CVXPY and the common
Lyapunov relaxation.
"""
import numpy as np
import cvxpy as cvx
import utils
import logging
import math
import scipy.linalg
from abc import ABC, abstractmethod
from adaptive import AdaptiveMet... | |
# coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd" file="viewer_api.py">
# Copyright (c) 2003-2021 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this ... | |
selector: [{"title":"notepad"},{"title":"Cancel"}]
"""
lResultFlag = False
lSecsSleep = 1 # Настроечный параметр
lSecsDone = 0
lResultList = None
# Цикл проверки
while lResultFlag == False and lSecsDone < inWaitSecs:
# pdb.set_trace()
lResultList = []
# Итерация проверки
lIndex = 0
for lItem in inSpecifica... | |
4)
for i in range(len(values)):
buffer[(i*4): (i*4+4)] = struct.pack('>f',values[i])
return buffer
def DoubleArrayTransByte(self, values ):
'''double数组变量转化缓存数据,需要传入double数组 -> bytearray'''
if (values == None) : return None
buffer = bytearray(len(values) * 8)
for i in range(len(values)):
buffer[(i*8):... | |
if has_super:
count -= w_super.total_field_cnt
for i in range(offset, offset + count):
write_loop(self._ref(i), port, env)
port.write(" ")
def write(self, port, env):
w_type = self.struct_type()
typename = w_type.name.utf8value
if w_type.isprefab:
self.write_prefab(port, env)
elif w_type.all_opaque():
port.... | |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -*- mode: Python -*-
'''
lj23layers v0.7.6 for LJ v0.8+
LJ functions (API) for python plugins/clients
"layers" version :
- "PL" has been replaced by "layer"
- "Client"
Each program using this API to manage complexity, should declare itself by calling Config, but it's ... | |
structure. The existnece of the data can be tested
###### with has_external_data and it is then retrieved with get_filename (again).
## def add_external_data(self, resource_name, file_name):
## """
## Method to add a link to an utterance file resource (e.g. file of MFCCs)
## by a path relative to the *.utt file.
... | |
!= proposed20xxVersion and origMainBuildNumber != proposedMainBuildNumber: # These are quite different versions
if not tkMessageBox.askyesno( 'Warning! 20XX File Version Mismatch', """The CSS file you're """ + 'importing, "' + os.path.basename(newExternalFilePath) + """", was not """
'designed for to ... | |
# SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_clue`
================================================================================
A high level library representing all the features of the Adafruit CLUE.
* Author(s): <NAME>
Implementation Notes
-----... | |
<gh_stars>0
import discord
from discord.ext import commands
import datetime
import json
import asyncpg
import typing
import asyncio
import aiohttp
import humanfriendly
import functools
from random import randint
from fire.converters import TextChannel
from fire.invite import findinvite
from fire.youtube import findchan... | |
identifiers[y]
if key2 == key1:
continue
if param_loglevel >= 3:
print "#############################################"
print "# comparing %s to %s" % (key1, key2)
seq_master = mali[key2]
ref_exons = exons[key2]
map_cmp2ref = MaliIO.getMapFromMali(seq, seq_master, gap_char)
# map exon boundaries to referen... | |
else:
np.testing.assert_array_almost_equal(diff, 0, decimal=15)
def test_concentration_profile(self):
"""Test that the concentration in the centre of the negative particles is
greater than the average concentration in the particle and also that the
concentration on the surface of the negative particle is less tha... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""Cisco Identity Services Engine Certificates API wrapper.
Copyright (c) 2021 Cisco and/or its affiliates.
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 wit... | |
in child.get_children():
print('\n Grandchild:')
gchild.info()
"""
def test_node_remove_supports(self):
#
# Split and balance
#
node = QuadNode()
node.split()
sw_child = node.children['SW']
sw_child.split()
sw_ne_grandchild = sw_child.children['NE']
sw_ne_grandchild.split()
node.balance()
#
# Coa... | |
#!/bin/python2
# Copyright (c) 2019 ZettaDB inc. All rights reserved.
# This source code is licensed under Apache 2.0 License,
# combined with Common Clause Condition 1.0, as detailed in the NOTICE file.
import sys
import json
import getpass
import argparse
from cluster_common import *
def generate_storage_startstop(... | |
atom[1] to 0,0,0 origin
atomsR.append(numpy.array([[0], [0], [0], [1]],
dtype=numpy.float64))
# a0r is len1 up from a1 on Z axis, X=Y=0
atomsR[0][2][0] = self.len1
# a2r X is sin( sar ) * len3
atomsR[2][0][0] = numpy.sin(sar) * self.len3
# a2r Z is -(cos( sar ) * len3)
atomsR[2][2][0] = - (numpy.cos(sar) * sel... | |
The new notification level for the guild.
explicit_content_filter: The new explicit content filter level for the guild.
afk_channel: The voice channel that should be the new AFK channel.
afk_timeout: How many seconds does a member need to be afk before they get moved to the AFK channel. Must be either `60`, `300`, `... | |
type: bool
savehtml=False, # type: int
outputfile=None, # type: bool
fp=None, # type: Optional[IO]
ccmode=CC_PROCESSES # type: str
):
# type: (...) -> int
"""Reformats the files according to style with all option values. Then it groups the
different results and generates an overview about what source code diffe... | |
event.make_event_embed(ctx)
await ctx.send(_("Please wait for an someone to approve your event request."))
admin_msg = await approval_channel.send(embed=em)
start_adding_reactions(admin_msg, ReactionPredicate.YES_OR_NO_EMOJIS)
pred = ReactionPredicate.yes_or_no(admin_msg)
reaction, user = await ctx.bot.wait_for("r... | |
order
Yields
------
str
The name of the fields, one by one.
"""
yield self.field.name
for other_field in self.other_fields:
yield other_field.name
def _can_filter_fields(self, fields_and_suffixes):
"""Tell if the index can handle the given fields + suffixes
For the parameters, see ``_MultiFieldsIndexMixi... | |
<gh_stars>10-100
import math, sys
import maya.api.OpenMaya as om
import maya.api.OpenMayaUI as omui
import maya.api.OpenMayaAnim as oma
import maya.api.OpenMayaRender as omr
from maya.OpenMaya import MGlobal
# This is insane. There are two Python APIs in Maya, and both of them are missing lots of
# stuff, and ... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
@authors: <NAME>, <NAME>
"""
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.support.ui import Select
from selenium import webdriver
from scipy.constants import minute, hour, milli, nano, micro
from pprint import pprint
from chardet import detec... | |
creates a context for cut uv tool. This context only works in the UV editor.
Flags:
- adjustSize : asz (bool) [edit]
If true, puts the tool into the mode where dragging the mouse will edit the brush size. If false, puts the tool back
into the previous mode.
- displayShellBorders : dsb (bool) [query,edit]
Togg... | |
show=False):
"""
title::
generate_defender_utilities_plot
description::
This method will plot 3c and 3d, and provide other stats used in the
paper (ttests and percent change).
NOTE: Only plots/reports results if there are values other than zero
in the array. If all values are zero, it does not plot/report ... | |
import numpy as np
import sys
np.set_printoptions(linewidth=np.inf)
np.set_printoptions(precision=3)
import matplotlib.pyplot as plt
import math
n_x=30
n_y=30
dx=1.0/n_x
dy=1.0/n_y
Re=100
def momentum_link_coefficients(u_star,u_face,v_face,p,source_x,source_y,A_p,A_e,A_w,A_n,A_s):
D_e=dy/(dx*Re)
D_w=dy/(dx*Re... | |
1.0 1.0
1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0
1.0
1.0 1.0 1.0 1.0 1.0
1.0 1.0
1.0 1.0 1.0
1.0 1.0 1.0 1.0 1.0
Element: 202
Faces:
-1 -1 -1 -1 -1 -1
Nodes:
217 225 218 226 313 321 314 322
Scale factors:
1.0 1.0 1.0 1.0 1.0
1.... | |
"""Class implementing TRS client."""
from functools import partial
import json
import logging
from pathlib import Path
import re
import shutil
import socket
import sys
from typing import (Dict, List, Optional, Tuple, Type, Union)
import urllib3
from urllib.parse import quote
import pydantic
from pydantic.main import ... | |
False
# The date format used by logging formatters for %(asctime)s
# c.IPClusterEngines.log_datefmt = '%Y-%m-%d %H:%M:%S'
# Deprecated, use engine_launcher_class
# c.IPClusterEngines.engine_launcher = None
# Create a massive crash report when IPython encounters what may be an internal
# error. The default is to appe... | |
<reponame>jochenater/catboost
from __future__ import unicode_literals
from ctypes import windll, byref, ArgumentError, c_char, c_long, c_ulong, c_uint, pointer
from ctypes.wintypes import DWORD, HANDLE
from prompt_toolkit.renderer import Output
from prompt_toolkit.styles import ANSI_COLOR_NAMES
from prompt_toolkit.wi... | |
##
## Name: dnd.py
## Purpose: Interface to Dartmouth Name Directory services
##
## Copyright (C) 2004-2007 <NAME>, All Rights Reserved.
##
## 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 ... | |
<filename>physt/special.py<gh_stars>0
"""Transformed histograms.
These histograms use a transformation from input values to bins
in a different coordinate system.
There are three basic classes:
* PolarHistogram
* CylindricalHistogram
* SphericalHistogram
Apart from these, there are their projections into lower dime... | |
<reponame>tlapusan/dtreeviz
import numpy as np
import pandas as pd
import matplotlib.patches as patches
import matplotlib.pyplot as plt
from matplotlib.collections import PatchCollection
from colour import Color
from PIL import ImageColor
from dtreeviz.colors import adjust_colors, GREY
from dtreeviz.trees import add_... | |
<reponame>Miracle2333/BSPPN
"""
Mask R-CNN
Configurations and data loading code for MS COCO.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for ... | |
<reponame>vishalbelsare/pyplan-ide<filename>pyplan/pyplan/dashboard/service.py
import uuid
from types import SimpleNamespace
from django.db.models import Q
from rest_framework import exceptions
from pyplan.pyplan.common.baseService import BaseService
from pyplan.pyplan.common.calcEngine import CalcEngine
from pyplan.... | |
G.nodes():
info = nodeInfoDictPerturbed[node]
if 'argsIndex' in info:
argsIndex = info['argsIndex']
pressure = info['simulationData']['pressure']
velocityPressurePerturbed[argsIndex] = pressure
for edgeIndex in edgeIndexList:
info = edgeInfoDictPerturbed[edgeIndex]
if 'argsIndex' in info:
argsIndex = info['a... | |
# from dsgn.utils.torch_utils import generate_coord
from __future__ import print_function
import argparse
import os
import time
import numpy as np
import torch
from torch._C import device
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
import torch.optim as optim
from torch.serializatio... | |
' ' + settings['None']['output_path']
print("Generating normalised RPKM/FPKMs: "+cmd_fpkm)
subprocess.call(cmd_fpkm, shell=True)
def de_analysis (settings, group1, group2, output_prefix, bin_path=''):
""" Calculate DEG analysis between two groups (column numbers 1-indexed)
"""
cmd_deg = 'Rscript '+bin_path+'de_an... | |
import torch
import torch.nn as nn
import torch.nn.functional as F
from distributions import Categorical2D
from utils import init, init_normc_
class Flatten(nn.Module):
def forward(self, x):
return x.view(x.size(0), -1)
class Policy(nn.Module):
def __init__(self, obs_shape, action_space, base_kwargs=None, curio... | |
90.00 P 1
SCALE1 0.084731 0.000000 0.000000 0.00000
SCALE2 0.000000 0.060321 0.000000 0.00000
SCALE3 0.000000 0.000000 0.071551 0.00000
ATOM 1 N PHE A 63 6.412 9.770 7.572 1.00 10.00 N
ATOM 2 CA PHE A 63 6.289 9.157 6.198 1.00 10.00 C
ATOM 3 C PHE A 63 6.292 10.223 5.110 1.00 10.00 C
ATOM 4 O PHE A 63 6.451 11.437 5.24... | |
"""Functional tests for all the routes."""
from book_api.models.book import Book
from book_api.models.user import User
from book_api.tests.conftest import FAKE
def test_signup_other_methods_gets_404_status_code(testapp):
"""Test that other HTTP method requests to signup get a 404 status code."""
for method in ('ge... | |
<gh_stars>1-10
"""Tools (notably `xpSpace`) for processing and presenting experiment data."""
import collections
import copy
import logging
import os
import shutil
import warnings
from pathlib import Path
import colorama
import dill
import matplotlib as mpl
import numpy as np
import struct_tools
from matplotlib impor... | |
"""
This module defines the generic base class and the functionality.
All browsers from :py:mod:`browser_history.browsers` inherit this class.
"""
import abc
import csv
import datetime
import json
import os
import shutil
import sqlite3
import tempfile
import typing
from collections import defaultdict
from functools im... | |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for pyvo.dal.query
"""
from __future__ import print_function, division
import os, sys, shutil, re, imp, glob, tempfile, random, time
import unittest, pdb
from urllib2 import URLError, HTTPError
import pyvo.dal.query as dal... | |
this job
`('kill', jobno)` : immediately kill this job
`('available_cores')` : put available core count in outqueue
job_info must be in the form:
`(int(jobno), str(command), int(threads), list(dependencies))`
outqueue : multiprocessing.Queue
job information available_cores if argument was available_cores
max_job... | |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | |
# -*- coding: utf-8 -*-
#
# <NAME>
# orthologue
# (c) 1998-2021 all rights reserved
#
# externals
import numbers
from . import gsl # the extension
# the class declaration
class Vector:
"""
A wrapper over a gsl vector
"""
# types
from .Permutation import Permutation as permutation
# constants
defaultFormat ... | |
# Copyright 2020 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 writing, softw... | |
numbytes)
if signext:
assign(f, "spec_rd_wdata", "spec_rd_addr ? $signed(result) : 0")
else:
assign(f, "spec_rd_wdata", "spec_rd_addr ? result : 0")
assign(f, "spec_pc_wdata", "rvfi_pc_rdata + 4")
assign(f, "spec_trap", "!misa_ok")
print("`endif", file=f)
footer(f)
def s(instruction, funct3, numbytes, misa=0... | |
error, re-authenticating..."
)
== 5
)
self.assertIn(
"INFO iCloud re-authentication failed! Please try again later.",
self._caplog.text,
)
# Make sure we only call sleep 4 times (skip the first retry)
self.assertEqual(sleep_mock.call_count, 4)
assert result.exit_code == -1
def test_handle_connection_error... | |
# catch and set all unexpected exceptions
except Exception as e:
self.set_exception(e)
self.complete_task()
return False
def check(self):
try:
rest = RestConnection(self.server)
# make sure view was deleted
query = {"stale": "ok"}
content = rest.query_view(self.design_doc_name, self.view.name,
self.bucket, ... | |
<gh_stars>1-10
""" Node.
Do not edit this file by hand.
This is generated by parsing api.html service doc.
"""
from ambra_sdk.exceptions.service import AccountNotFound
from ambra_sdk.exceptions.service import AlreadyConnected
from ambra_sdk.exceptions.service import AlreadyDone
from ambra_sdk.exceptions.service import... | |
"source_id": "SMILES: C[C@@H]1C[C@H]2[C@@H]3C[C@@H](C4=CC(=O)C=C[C@@]4([C@]3([C@H](C[C@@]2([C@]1(C(=O)SCF)O)C)O)F)C)F",
"target_id": "MONDO:0004979",
"attributes": {
"p_val": 0.17901741601915602
}
},
{
"type": "associated_with",
"source_id": "CAS: 90566-53-3",
"target_id": "MONDO:0004979",
"attributes": {
"p... | |
<reponame>Sillte/fairypptx
"""
Policy:
-----------
`converter.config` will contain the required extensions for expansion.
Memeorandum
-----------
When you want to `newline` in markdown,
please consider the usage of ` `.
Reference
------
# https://hackage.haskell.org/package/pandoc-types-1.22.1/docs/Text-Pa... | |
<gh_stars>1-10
import logging
import pyfftw
import dask
import warnings
import numpy as np
import time
import traceback
from multiprocessing import cpu_count
from dask.diagnostics import ProgressBar
from ghostipy.utils import (hz_to_normalized_rad, normalized_rad_to_hz)
from ghostipy.spectral.wavelets import (Wavelet... | |
(List, Set, Tuple)
), "Please specify a list of agent ids to watch"
assert isinstance(
agents_list_alive.minimum_agents_alive_in_list, int
), "Please specify an int for minimum number of alive agents in the list"
assert (
agents_list_alive.minimum_agents_alive_in_list >= 0
), "minimum_agents_alive_in_list should... | |
extstructs=self.registry.validextensionstructs[typeName] if name == 'pNext' else None,
condition=conditions[name] if conditions and name in conditions else None,
cdecl=cdecl))
# If this struct extends another, keep its name in list for further processing
if typeinfo.elem.attrib.get('structextends') is not None:
se... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import PIL
import numpy as np
import weakref
from math import floor
from .helper import make_slice_list
class Pixel:
def __init__(self, parent, row, col):
self._parent = weakref.ref(parent)
self._col = col
self._row = row
self._value = parent.getpixel(row, col)
@property... | |
<filename>sdk/python/pulumi_azure_native/labservices/v20181015/environment_setting.py<gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
fr... | |
from bs4 import BeautifulSoup
import sys
import time
from random import randint
import re
import requests
import pandas as pd
from psycopg2.extras import execute_batch
import traceback
import queue
from datetime import datetime
from BaseScraper import BaseScraper
class LetterboxScraper(BaseScraper):
def scrape(sel... | |
import os
import re
import subprocess
import random
import shutil
import logging
import time
from anchore import anchore_utils
from anchore.util import scripting, contexts
class Navigator(object):
_logger = logging.getLogger(__name__)
def __init__(self, anchore_config, imagelist, allimages):
self.config = anchore... | |
<filename>src/sparse_alignments/evaluation.py
import argparse
import os
import numpy as np
import pickle
import json
import sys
sys.path.append('../')
import src.utils as utils
from scipy.stats import hypergeom
import scipy.sparse as sp
from scipy.spatial.distance import cosine
from collections import defaultdict, Orde... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .brokerage_base import BrokerageBase
from ..event.event import LogEvent
from ..account import AccountEvent
from ..data import TickEvent, TickType, BarEvent
from ..order.order_type import OrderType
from ..order.fill_event import FillEvent
from ..order.order_event import... | |
right')
raw_pred_right = CCL_check_1ststg(raw_pred_right)
else:
raw_ct_right_shape = (raw_ct_shape[0], raw_ct_shape[1], int(raw_ct_shape[2] * 3 / 5))
raw_pred_right_shape = [raw_ct_shape[0], 200, 200, num_labels_1ststg]
raw_pred_right_tmp = np.zeros(shape=raw_pred_right_shape) # raw_ct_shape[0], 200, 200,... | |
import torch
from allennlp.common.util import END_SYMBOL, START_SYMBOL
from allennlp.data.vocabulary import DEFAULT_PADDING_TOKEN, Vocabulary
from allennlp.models import Model
from allennlp.modules import FeedForward, MatrixAttention, TextFieldEmbedder, TokenEmbedder
from allennlp.nn import InitializerApplicator, Regul... | |
<gh_stars>1-10
import csv
import json
import math
import os
import h5py
import numpy as np
# import staintools
from matplotlib.colors import LinearSegmentedColormap
from numba import jit
from scipy import ndimage
import cv2
import random
from skimage.feature import peak_local_max
import skimage.segmentation
from skimag... | |
from medium.powlib import pluralize
import datetime
from cerberus import Validator
import xmltodict
import simplejson as json
import datetime, decimal
from medium.config import myapp
from medium.powlib import merge_two_dicts
from medium.encoders import pow_json_serializer
from medium.decoders import pow_json_deserializ... | |
<reponame>mike-n-7/tsr<gh_stars>10-100
#!/usr/bin/env python
# Copyright (c) 2013, Carnegie Mellon University
# All rights reserved.
# Authors: <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Re... | |
= value
# Then update the entry
new_release_json[release_entry] = _stringify_config(new_version_config)
return new_release_json
##
## Main functions
##
def _update_release_json(ctx, release_json, release_entry, new_version: Version, github_token):
"""
Updates the provided release.json object by fetching comp... | |
<filename>app/main.py
import math
from tkinter import *
from tkinter import messagebox, filedialog
from tkinter.font import Font
from tkinter.ttk import Progressbar
import geopandas as gpd
import numpy as np
import shapefile
from descartes import PolygonPatch
from geopandas import GeoDataFrame, points_from_xy
from matp... | |
<reponame>dmitryvinn/cinder
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
from __future__ import annotations
import ast
from ast import (
AST,
And,
AnnAssign,
Assign,
AsyncFunctionDef,
Attribute,
AugAssign,
Await,
BinOp,
BoolOp,
Call,
ClassDef,
Compare,
Constant,
DictComp,... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
General functions supporting other modules.
"""
import datetime as dt
import fiona
import numpy as np
import os
import pandas as pd
import pyproj
import sqlite3
from functools import partial
from shapely import geometry as geo
from shapely import ops
def boxcox_backtransform... | |
from __future__ import annotations
import uvicore
from uvicore.typing import Any, Callable, List, Dict, Optional, Decorator, get_type_hints
from uvicore.http.routing.router import Router
from uvicore.contracts import ApiRoute as RouteInterface
from prettyprinter import pretty_call, register_pretty
from uvicore.support.... | |
<reponame>matthew-cen/schedule-creator
# TODO: Implement modification/validation logic
# TODO: Default values
# TODO: Use datetime module for time handling
# TODO: KeyError for days and empty input
from utilities import parse_day, parse_time, parse_command, parse_command_num
from exceptions import *
from schedule impor... | |
import click
import io
import requests
import time
import zlib
from prog.cli import request
from prog.cli import create
from prog.cli import delete
from prog.cli import show
from prog.cli import set as cli_set
from prog.cli import unset
from prog import client
from prog import multipart
from prog import output
from pr... | |
"""The tests for the Jewish calendar sensor platform."""
from collections import namedtuple
from datetime import time
from datetime import datetime as dt
from unittest.mock import patch
import pytest
from homeassistant.util.async_ import run_coroutine_threadsafe
from homeassistant.util.dt import get_time_zone, set_de... | |
to ensure that at least one replication
# snapshot with repl_status success exists at all times.
snapshot.repl_status = 'success'
# For completeness also set repl_status to success on destination.
# The snapshot list must be refreshed as the dst_dataset snapshot cache
# does not know that a new snapshot has arriv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.