input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
VanillaBaseControl):
raise VanillaError("invalid object")
cell = button._nsObject.cell()
self._window.setDefaultButtonCell_(cell)
def bind(self, event, callback):
"""
Bind a callback to an event.
**event** A string representing the desired event. The options are:
+-------------------+------------------------... | |
"""
Enthält die API-Endpunkte.
Alle Endpunkte liefern im Fehlerfall einen Key 'err_msg'.
"""
import flask
import logging
from flask import (Blueprint, request, send_file, send_from_directory)
from werkzeug.utils import secure_filename
from os import path
from datetime import datetime
from visuanalytics.server.db im... | |
"diag_affine"):
assert(len(termLbl) == 2), "Stochastic term labels should have form ('S',<basis element label>)"
if termLbl[1] not in otherBasisLabels:
otherBasisLabels.append(termLbl[1])
else:
assert(len(termLbl) == 3), "Stochastic term labels should have form ('S',<bel1>, <bel2>)"
if termLbl[1] not in otherBasi... | |
<gh_stars>0
"""
File: pylinex/fitter/MetaFitter.py
Author: <NAME>
Date: 3 Sep 2017
Description: File containing class which employs many Fitter objects to form
grids of fit statistics with which to perform parameter number
optimization.
"""
import numpy as np
import matplotlib.pyplot as pl
from matplotlib.colors imp... | |
conditional(SX ind, [SX] x, SX x_default, bool short_circuit) -> SX
conditional(MX ind, [MX] x, MX x_default, bool short_circuit) -> MX
If the condition
Parameters:
-----------
ind: evaluates to the integer k, where 0<=k<f.size(), then x[k] will be
returned, otherwise
x_default: will be returned.
"""
... | |
<gh_stars>100-1000
# coding: utf-8
# In[1]:
import os
import math
import random
import numpy as np
import tensorflow as tf
import cv2
import glob
import os
import argparse
import lxml.etree
from datetime import datetime
slim = tf.contrib.slim
# In[2]:
#get_ipython().magic('matplotlib inli... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
basic slicing
if not isarray and not interp:
isbasic = True
else:
isbasic = False
ret = []
for axis in dimensions:
ret.append(xsel[axis])
ret = xSelect(ret)
ret.isbasic = isbasic
ret.interp = interp
ret.masked = masked
ret.order = order
return ret
#@-node:schmidli.20080322120238.15:idxsel2xsel
#@+node:s... | |
import os
import csv
import threading
from .classes import Node, Link, Network, Column, ColumnVec, VDFPeriod, \
AgentType, DemandPeriod, Demand, Assignment, UI
from .colgen import update_links_using_columns
from .consts import SMALL_DIVISOR
__all__ = [
'read_network',
'load_columns',
'output_columns',
'output_... | |
<filename>usaspending_api/etl/tests/integration/test_load_multiple_submissions.py
import pytest
from datetime import datetime, timezone, date
from decimal import Decimal
from django.core.management import call_command, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
from django.test import Transaction... | |
<filename>src/data_processing.py
import math
from collections import Counter
from functools import reduce
from itertools import combinations, permutations, combinations_with_replacement
from statistics import mean
from time import sleep
import json
import csv
import logging
from geopy import geocoders
from geopy impo... | |
<gh_stars>0
from opensimplex import OpenSimplex
import pandas as pd
import xarray as xr
import numpy as np
import constants
import netCDF4
import random
import pygmt
import math
import csv
import os
def create_temp_dir():
'''
PARAMETERS: none
RETURN VALUE: none
REQUIREMENTS: none
PURPOSE: creates new temp directo... | |
mbkin**6 - (505200*mckin**4*q_cut**2*sB)/mbkin**8 -
(4070880*mckin**6*q_cut**2*sB)/mbkin**10 - (4525536*mckin**8*q_cut**2*sB)/
mbkin**12 + (142656*mckin**10*q_cut**2*sB)/mbkin**14 -
(2771904*mckin**12*q_cut**2*sB)/mbkin**16 - (4946496*mckin**14*q_cut**2*sB)/
mbkin**18 - (5925840*mckin**16*q_cut**2*sB)/mbkin**20 -... | |
'''
access_groups_v2
=============
The following methods allow for interaction into the Tenable.io
:devportal:`access-groups-v2 <v2-access-groups>` API endpoints.
Methods available on ``tio.access_groups_v2``:
.. rst-class:: hide-signature
.. autoclass:: AccessGroupsV2API
.. automethod:: list
.. automethod:: creat... | |
import pytest
from ..model import Model, SnapshotSource, CreateOptions
from ..snapshots import Snapshot, DummySnapshotSource
from ..exceptions import DeleteMutlipleSnapshotsError
from ..config import Config
from ..globalinfo import GlobalInfo
from ..settings import Setting
from .faketime import FakeTime
from datetime ... | |
<gh_stars>0
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
# Add files or directories matching the regex patterns to t... | |
<filename>src/populations.py
from src import individual
import random
import numpy as np
class Population:
def __init__(self, pop_size, n_var, n_of, n_lim):
self._size = pop_size
self._n_var = n_var
self._n_lim = n_lim
self._n_of = n_of
self.population = []
if self._n_of > 1:
self.populationQ = []
self.popul... | |
<gh_stars>0
import requests
from pprint import pprint
import time
BASE_URL = 'http://host.docker.internal:8080'
REALM = 'ma-graphql-shop'
CLIENT_ID = 'external'
CLIENT_SECRET = '49caadde-e89f-404b-815b-44ea4470e399'
USERNAME = 'admin'
PASSWORD = '<PASSWORD>'
def authenticate():
# grant_type=password&client_id=ext... | |
# Return values
return train_gid_set, data_list, label_list
@register_ibs_method
def classifier_train_image_svm(
ibs, species_list, output_path=None, dryrun=False, C=1.0, kernel='rbf'
):
from sklearn import svm, preprocessing
# Load data
logger.info('Loading pre-trained features for images')
# Save model pick... | |
"""
return self.reference_string()
def __unicode__(self):
"""
x.__unicode__() <==> unicode(x)
Return unicode version of passage string. Uses en-dash for ranges.
"""
return self.reference_string(dash=u"–")
def abbr(self):
"""
Return abbreviated passage string
"""
return self.reference_string(abbreviated=Tr... | |
# -*- coding: utf-8 -*-
#
# (c) Copyright 2001-2015 HP Development Company, L.P.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any late... | |
import numpy as np
import pandas as pd
from sklearn.metrics import silhouette_samples, silhouette_score
from sklearn.metrics import confusion_matrix, accuracy_score, recall_score, precision_score, f1_score,roc_auc_score,roc_curve
from sklearn.metrics import mean_squared_error,mean_absolute_error,r2_score
import ma... | |
error = nmap_process.communicate()
# If there is output
if len(output):
parser = _XMLParser(output)
try:
parsed_nmap_output = parser.parse()
# If parsing error raise NmapScanError with STDERR info.
except ET.ParseError as e:
raise NmapScanError('Could not parse output from nmap: {}'.format(e)) from None
except... | |
-11, 5, -5, 4],
[ 26, -26, 10, -10, 30, -30, 23],
[ 20, -20, 3, -3, 33, -33, 23],
[ 5, -5, 25, -25, 24, -24, 4],
[ 17, -17, 4, -4, 22, -22, 0]
]
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as AdditiveCyclic
G = AdditiveCyclic(35)
Mb=[]
for R in zip(*M):
for i in range(7):
Mb.append... | |
# You may use, modify and redistribute this module under the terms of the GNU GPL3.0.
"""
Translate a morph target from a mesh with topology 1 to a mesh with topology 2
The shape of old and new objs must be similar. We assume the new mesh is done using a retopology tool.
=========================== ==============... | |
self.memo is not None:
result['memo'] = self.memo
result['attachments'] = []
if self.attachments is not None:
for k in self.attachments:
result['attachments'].append(k.to_map() if k else None)
return result
def from_map(self, m: dict = None):
m = m or dict()
if m.get('memo') is not None:
self.memo = m.get('m... | |
in range(elem978):
elem979 = iprot.readString()
self.ids.append(elem979)
iprot.readListEnd()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
self.validate()
def write(self, oprot):
self.validate()
oprot.writeStructBegin('getContactsForChannel_args')
if self.ids ... | |
for a ConvBPDN variant with projection onto the
:math:`\ell_1` ball instead of an :math:`\ell_1` penalty.
|
.. inheritance-diagram:: ConvBPDNProjL1
:parts: 2
|
Solve the optimisation problem
.. math::
\mathrm{argmin}_\mathbf{x} \;
(1/2) \left\| \sum_m \mathbf{d}_m * \mathbf{x}_m - \mathbf{s}
\right\|_2^2... | |
service_account_file
request.Project = project
request.Location = location
return stub.ListContainerCluster(request).items
def to_proto(self):
resource = cluster_pb2.ContainerCluster()
if Primitive.to_proto(self.name):
resource.name = Primitive.to_proto(self.name)
if Primitive.to_proto(self.description):
re... | |
<gh_stars>1-10
"""
Binance Pybot v1.1 (21-9-5)
https://github.com/rulibar/binance-pybot
"""
import os
import time
from calendar import timegm as timegm
import numpy
import random
import logging
import talib
from binance.client import Client
# instance vars
api_key = ""
api_secret = ""
client = Client(api_key, api_sec... | |
<reponame>DebeshJha/tensorflow-1
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
repair for flexural properties
- Block
class for blocks of plies oriented at the same fibre orientation
- calc_delta_lampamD_swap & calc_delta_lampamD_swap_1
returns the out-of-plane lamination parameters variation due to the swap
of ply groups, taking into account ... | |
locks we need up front, in order, because
# locking in a subquery doing an INSERT isn't guaranteed to use that
# order (deadlocks seen with commits on MySQL 5.7 without this,
# when using REPEATABLE READ.)
#
# We must do this on its own, because some drivers (notably
# mysql-connector-python) get very upset
# ("... | |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed ... | |
service object
self.client_service = client_service_class(
self.service_plugin,
self,
service_configuration,
exceptions.ServiceUtilsException,
extra_parameters
)
def start(self):
self.__start_base()
if EPOLL_SUPPORT:
self.__start_epoll()
def stop(self):
if EPOLL_SUPPORT:
self.__stop_epol... | |
import json
import uuid
from tests.testmodels import (
Event,
JSONFields,
Reporter,
SourceFields,
StraightFields,
Team,
Tournament,
UUIDFkRelatedModel,
UUIDFkRelatedNullModel,
UUIDM2MRelatedModel,
UUIDPkModel,
)
from tortoise import Tortoise, fields
from tortoise.contrib import test
from tortoise.fields.rel... | |
<reponame>cobrab11/black1-bot<filename>extensions/logger.py
# BS mark.1-55
# /* coding: utf-8 */
# BlackSmith mark.1
# logger.py
# © 2011-2013 simpleApps (http://simpleapps.ru)
# Thanks to: WitcherGeralt (<EMAIL>)
logConfigFile = "dynamic/logstate.txt"
logCacheFile = "logcache.txt"
logThemes = {}
Months, Days = ("... | |
<filename>osm_nbi/admin_topics.py
# -*- coding: utf-8 -*-
# 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 o... | |
<reponame>hayesgb/mlrun
import base64
import json
import os
import unittest.mock
import deepdiff
import kubernetes
import nuclio
import pytest
from fastapi.testclient import TestClient
from sqlalchemy.orm import Session
import mlrun.errors
from mlrun import code_to_function, mlconf
from mlrun.platforms.iguazio import... | |
<filename>energyPATHWAYS/supply.py
__author__ = '<NAME> & <NAME>'
import config as cfg
import util
import pandas as pd
import numpy as np
import copy
import logging
import time
from util import DfOper
from collections import defaultdict
from supply_measures import BlendMeasure, RioBlendMeasure, CO2PriceMeasure
from su... | |
<filename>tools/explorer_utils.py<gh_stars>0
from tools.lang import SELECT_THE_DIRECTORY
from tools.lang import DO_YOU_WANT_EXPLORE_SUBDIRECTORIES
from tools.lang import DO_YOU_WANT_SPLIT_THE_DB_BY_DIRECTORY
from tools.lang import ENTER_A_NAME_FOR_YOUR_DB
from tools.lang import SELECT_THE_OLDER_BD
from tools.lang impor... | |
<gh_stars>1000+
# -*- encoding: utf-8 -*-
# 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... | |
<reponame>kamfretoz/KamFreBOT
import asyncio
import time
from discord.ext import commands
import discord
import libneko
import json
import io
import dotenv
import os
import data.topics as topics
from textwrap import shorten, fill
from datetime import datetime
from random import randint, choice, random
... | |
w
# location based attention
class AttLoc(chainer.Chain):
def __init__(self, eprojs, dunits, att_dim, aconv_chans, aconv_filts):
super(AttLoc, self).__init__()
with self.init_scope():
self.mlp_enc = L.Linear(eprojs, att_dim)
self.mlp_dec = L.Linear(dunits, att_dim, nobias=True)
self.mlp_att = L.Linear(aconv_cha... | |
<gh_stars>0
'''
*
* Copyright (C) 2020 Universitat Politècnica de Catalunya.
*
* 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
*
* Unle... | |
<reponame>Jsl-1/homeassistant-zigate
"""
ZiGate component.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/zigate/
"""
import logging
import voluptuous as vol
import os
import datetime
from homeassistant.helpers.entity import Entity
from homeassistant.helpe... | |
:param biz_info: 业务ID及其对应的名称
:param username: 用户名
:return
"""
# 节点变量,用于后续订阅任务注册主机,安装等操作
subscription_nodes = []
for host in accept_list:
inner_ip = host["inner_ip"]
outer_ip = host.get("outer_ip", "")
login_ip = host.get("login_ip", "")
host_ap_id, host_node_type = self.check_ap_and_biz_scope(node_type, hos... | |
= self._parent._succ[self._end][edge_type]
def extend(self, path):
r"""
Extends self with another path.
EXAMPLES::
sage: p = iet.Permutation('a b c d','d c b a')
sage: r = p.rauzy_diagram()
sage: g1 = r.path(p,'t','t')
sage: g2 = r.path(p.rauzy_move('t',iteration=2),'b','b')
sage: g = r.path(p,'t','t','b','... | |
<filename>vcfpy/parser.py
# -*- coding: utf-8 -*-
"""Parsing of VCF files from ``str``
"""
import ast
import functools
import math
import re
import warnings
from . import header
from . import record
from . import exceptions
from .exceptions import (
CannotConvertValue,
LeadingTrailingSpaceInKey,
UnknownFilter,
Un... | |
between Entities, Specifications and
# attributes, please see @ref entities_specifications_and_attributes
# "this" page.
#
# The action of 'publishing' itself, is split into two parts, depending on
# the nature of the item to be published.
#
# @li **Preflight** When a Host is about to create some new media/asset... | |
# -*- coding: utf-8 -*-
# from __future__ import absolute_import, print_function, division
from future.utils import with_metaclass
from builtins import str
from builtins import range
import numpy as np
import scipy as sp
from abc import ABCMeta, abstractmethod
from scipy import integrate
import scipy.interpolate as in... | |
"""Data Provider implementation module for constructing data based on standard stock indicators
The data provider in this module is not indented to be instantiated outside of this module. Instead, upon the importing
of this module, the provider will create an instance of itself and register itself with the global D... | |
<reponame>sarang-apps/darshan_browser
#!/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.
import os.path
import subprocess
import unittest
import PRESUBMIT
from PRESUBMIT_test_mocks ... | |
stdout, and stderr is returned.
"""
p = subprocess.Popen(
self.composeCmdString(),
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
stdout, stderr = p.communicate()
return [p.returncode,stdout.strip(),stderr.strip()]
def __dir__(self):
keys = self.__dict__.keys()
if "parameterdefs" in self.__... | |
by self.eval_symbol())
"""
if tup in self.memo_C:
# result from memoization dictionary
return self.memo_C[tup]
else:
# iteratively determine coefficients by
# expansion of the Lyapunov equation
coeff = multinomial_coefficient(tup)
A0 = self.eval_symbol('A', ())
D = None # second matrix in Lyapunov equation
... | |
<gh_stars>0
#!/usr/bin/python3
# Copyright (c) 2019
# Physics, Computer Science and Engineering (PCSE)
# Christopher Newport University
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Red... | |
<filename>examples/plot_physical_vs_observed/plot_underlying_vs_observed_period_radius_credible.py
# To import required modules:
import numpy as np
import time
import os
import sys
import matplotlib
import matplotlib.cm as cm #for color maps
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec #for ... | |
# see if POSIX standard variables will work
return (int(os.environ.get('LINES')),
int(os.environ.get('COLUMNS')))
except TypeError:
# fall back on configuration variables, or if not
# set, (25, 80)
lines = options.console.max_lines
width = options.console.max_width
if lines is None:
lines = 25
if width is Non... | |
**ReservedNode** *(dict) --*
Describes a reserved node. You can call the DescribeReservedNodeOfferings API to obtain the available reserved node offerings.
- **ReservedNodeId** *(string) --*
The unique identifier for the reservation.
- **ReservedNodeOfferingId** *(string) --*
The identifier for the reserved no... | |
# Scale factor of image 4
f'{msid_prefix}CA01176', # Scale factor of image 5
f'{msid_prefix}CA01392', # Scale factor of image 6
f'{msid_prefix}CA01608'], # Scale factor of image 7
'image_status': [f'AOIMAGE{i}' for i in range(8)], # IMAGE STATUS FLAG
'fiducial_flag': [f'AOACFID{i}' for i in range(8)], # FIDUCIAL ... | |
# coding: utf8
"""
ref
1. http://disi.unitn.it/moschitti/Tree-Kernel.htm
2. http://disi.unitn.it/moschitti/Teaching-slides/slides-AINLP-2016/SVMs-Kernel-Methods.pdf
3. code: http://joedsm.altervista.org/pythontreekernels.htm
4. wiki: https://en.wikipedia.org/wiki/Tree_kernel
"""
from __future__ import print_function
im... | |
"""Module with utilities that ease the transformation of word sets to embeddings."""
import logging
from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union
import numpy as np
from sklearn.feature_extraction.text import strip_accents_ascii, strip_accents_unicode
from wefe.query import Query
from wefe... | |
#coding: UTF-8
#開始運行前,請先全選doc,按ctrl + shift + f9移除所有超鏈接並保存
#如果有超鏈接,轉換會出錯
#执行宏操作把doc中的编号转成固定文本
#編譯辭書格式:
#第一章 XXX
#第二章 XXX
#第三章 XX鎮、鄉、區
# 第一節 鎮名緣起
# 第二節 自然環境
# 第三節 區域特色
# 第四節 各里地名釋義
# 第一項 XX里(村) <-------------------------------抓取起始位置
# 里(村)名由來
# 里(村)的description,若干行
# 地名釋義
# (一)具體地名1
# 具體地名1的description,若干行
# (二)具體地名2
#... | |
" to method report_folder_and_file_get_folders_and_files" % key
)
local_var_params[key] = val
del local_var_params['kwargs']
# verify the required parameter 'id' is set
if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
local_var_params['id'] is None): # noqa: E501
raise ... | |
import random
from typing import cast, List, Optional, Set, Union
from cytoolz import itertoolz
from .. import errors, utils
from . import utils as aug_utils
def substitute_word_synonyms(
aug_toks: List[aug_utils.AugTok],
*,
num: Union[int, float] = 1,
pos: Optional[Union[str, Set[str]]] = None,
) -> List[aug_u... | |
the sum is smaller.
[200. if drop_remainder else 310.] * 3)
for_sums = defun(sum_for_loop)(dataset)
# For loops always call get next as optional inside tf functions, so we
# expect 310 here when using an input function (as there are 5 batches of
# size 4 round robined over 2 replicas.
expected_for_sum = 200.
if ... | |
<filename>io_scene_sphnx/export_ese.py
# Copyright (c) 2020-2021 Swyter <<EMAIL>>
# SPDX-License-Identifier: Zlib
"""
Name: 'Eurocom Scene Export'
Blender: 2.90.1
Group: 'Export'
Tooltip: 'Blender ESE Exporter for EuroLand'
Authors: Swyter and Jmarti856
"""
import bpy
import os
import math
import bmesh
... | |
redirected to one of the other fault domains
and the MySQL instance in that domain is promoted to the primary instance.
This redirection does not affect the IP address of the DB System in any way.
For a standalone DB System, this defines the fault domain in which the DB System is placed.
:param fault_domain: The... | |
<gh_stars>0
import abstract_component
import os
import subprocess
import numpy as np
import exodus
from output_suppression import Suppressor
from output_suppression import suppress_stdout_stderr
import sync_times
import sys
sys.path.append("/gpfs1/jtencer/UQTk_v3.0.4-install")
import PyUQTk.pce as uqtkpce
import PyUQ... | |
# --------------------------------------------------------
# Deep Feature Flow
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
import numpy as np
import os
import cv2
import random
from PIL import I... | |
<reponame>cartertinney/azure-iot-sdk-python
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------... | |
<gh_stars>0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 5.3
# in conjunction with Tcl version 8.6
# May 26, 2020 02:41:41 PM JST platform: Windows NT
import tkinter as tk
from tkinter import ttk
import threading
import time
from rmslogin import RakutenRms
class SearchWind... | |
import argparse
from astropy.io import ascii
from pandeia.engine.perform_calculation import perform_calculation
import json
import os
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.table import Table
from scipy.optimize import minimize
import numpy as np
import warnings
import pysynphot as S ... | |
<reponame>bogomhd/BeoLightControl
#!/usr/bin/python3
import yaml
import json
import requests
import time
import sys
import shutil
import signal
from os import system, path
from threading import Thread
from zeroconf import ServiceBrowser, Zeroconf
import ipaddress
import http.client
configuration_file = "BeoLightContr... | |
_to_dict(self):
"""Return a json dictionary representing this model."""
return self.to_dict()
def __str__(self) -> str:
"""Return a `str` version of this PeerResponseResources object."""
return json.dumps(self.to_dict(), indent=2)
def __eq__(self, other: 'PeerResponseResources') -> bool:
"""Return `true` when ... | |
6245691.858534137, 11.688941994097817, 0.015110828165630823, 1.670666167191741e-06],
[1050.9762404493679, 1257.606216652866, 1428.1727195332353, 2676217.667872637, 5029083.46383821,
6252781.131346029, 9.912726746719038, 0.01508497956653298, 1.6858501133596892e-06],
[1172.1322901571223, 1261.2561027220345, 1424.64792... | |
<filename>statestream/interfaces/process_if_cifar10.py
# -*- coding: utf-8 -*-
# Copyright (c) 2017 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/boschresearch/statestream
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may n... | |
<gh_stars>10-100
# ---------------------------------------------------------------
# image.py
# Set-up time: 2020/4/26 上午8:41
# Copyright (c) 2020 ICT
# Licensed under The MIT License [see LICENSE for details]
# Written by Kenneth-Wong (Wenbin-Wang) @ VIPL.ICT
# Contact: <EMAIL> [OR] <EMAIL>
# ------------------... | |
and _env_is_exposed(rspec):
ret.add(rspec)
return ret
def _envs_dulwich(repo):
'''
Check the refs and return a list of the ones which can be used as salt
environments.
'''
ret = set()
for ref in _dulwich_env_refs(repo['repo'].get_refs()):
# ref will be something like 'refs/heads/master'
rtype, rspec = ref[5... | |
<filename>src/emuvim/dcemulator/monitoring.py
__author__ = 'Administrator'
import urllib2
import logging
from mininet.node import OVSSwitch
import ast
import time
from prometheus_client import start_http_server, Summary, Histogram, Gauge, Counter, REGISTRY, CollectorRegistry, \
pushadd_to_gateway, push_to_gat... | |
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar value: Required. Collection of resources.
:vartype value: list[~azure.mgmt.appcontainers.models.Certificate]
:ivar next_link: Link to next page of reso... | |
<gh_stars>0
import asyncio
import discord
from discord.ext import commands
from discord.utils import get
from discord import FFmpegPCMAudio
from json import load
import random
import content.tables as tab
import content.pictures as pic
from os import environ
from youtube_dl import YoutubeDL
from cogs.music import Music... | |
<filename>Lib/test/test_random.py
import unittest
import random
import time
import pickle
import warnings
from math import log, exp, pi, fsum, sin
from functools import reduce
from test import test_support
class TestBasicOps(unittest.TestCase):
# Superclass with tests common to all generators.
# Subclasses must arra... | |
#! /usr/bin/env python
#=========================================================================
# Graph.py
#=========================================================================
#
# Author : <NAME>
# Date : June 2, 2019
#
from __future__ import print_function
from .Edge import Edge
from .Step import Step
from .... | |
<reponame>dchud/demodocus
"""
Software License Agreement (Apache 2.0)
Copyright (c) 2020, The MITRE Corporation.
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
https://www.ap... | |
<gh_stars>1-10
import abc
import numpy as np
from scipy.signal import convolve, sosfiltfilt
from scipy.optimize import linear_sum_assignment
from detectsound.utils import get_1d_gauss_kernel, get_1d_LoG_kernel, first_true, last_true
class _BlobExtractor:
"""
A general-purpose detector for extracting blob-like fea... | |
preamble
i, k = self._arg(1), self._arg(1)
x = self.file.read(k)
cs, ds = self._arg(4), self._arg(4)
self._pre(i, x, cs, ds)
elif byte == 248: # postamble (just some number of 248s)
break
else:
raise ValueError("unknown vf opcode %d" % byte)
def _init_packet(self, pl):
if self.state != _dvistate.outer:
rais... | |
= [[column] + self.values[column] for column in self.values]
else:
k = int(max_columns / 2)
columns = [elem for elem in self.values]
values0 = [[columns[i]] + self.values[columns[i]] for i in range(k)]
values1 = [["..." for i in range(len(self.values[columns[0]]) + 1)]]
values2 = [
[columns[i]] + self.values[col... | |
It saves the alchemical rotamer library, which is the combination
of the rotamer libraries of both molecules, to the path that
is supplied.
Parameters
----------
path : str
The path where to save the rotamer library
fep_lambda : float
The value to define an FEP lambda. This lambda affects
all the parameters. ... | |
<filename>template_flask/constants.py
REQUIREMENTS = [
'flask',
'flask_sqlalchemy',
'flask_login',
'flask_mail',
'flask_wtf',
'flask_debugtoolbar',
'gunicorn',
'pytest',
'pytest_cov'
]
INDEX_HTML = [
['<!DOCTYPE html>', False],
['<html lang="en">', False],
['<head>', False],
['\t<meta charset="UTF-8">', F... | |
obtain
information about the monitor in a simple way even in the
absence of quorum.
:param mon_id: the ID portion of the monitor's name (i.e., mon.<ID>)
:type mon_id: str
:returns: the string reply from the monitor
"""
self.require_state("configuring", "connected")
outstrp = pointer(pointer(c_char()))
outst... | |
cmds.getAttr(material+".intior")
bsdfElement.addChild( FloatParameter('intIOR', intIOR) )
# Get exterior IOR preset or value
exteriorMaterialName = cmds.getAttr(material + ".exteriorMaterial", asString=True)
exteriorMaterialName = exteriorMaterialName.split('-')[0].strip()
if exteriorMaterialName in iorMate... | |
<filename>ensembler/visualisation/plotConveyorBelt.py
import matplotlib.patches as patches
import matplotlib.patheffects as path_effects
import matplotlib.pyplot as plt
import numpy as np
def calc_lam(CapLam, i=0, numsys=8, w=0.1):
ome = (CapLam + i * np.pi * 2.0 / numsys) % (2. * np.pi)
if ome > np.pi:
ome = 2.0 ... | |
<filename>draw_card/announcement.py
import aiohttp
from bs4 import BeautifulSoup
import re
from datetime import datetime, timedelta
from .config import DRAW_PATH
from pathlib import Path
from asyncio.exceptions import TimeoutError
from nonebot.log import logger
try:
import ujson as json
except ModuleNotFou... | |
"""Activation Layers"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import builtins
import inspect
import string
from functools import partial
from pydoc import locate
import six
import torch
import torch.nn as nn
import torch.nn.functional as F
import ... | |
<filename>plugins/modules/panos_export.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020 Palo Alto Networks, 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://ww... | |
255, 255); }"))
self.gb_pb_sell_volume_1_1_9.setText(_fromUtf8(""))
self.gb_pb_sell_volume_1_1_9.setObjectName(_fromUtf8("gb_pb_sell_volume_1_1_9"))
self.gb_pb_sell_volume_1_3_9 = QtGui.QPushButton(self.gb_ETFOrder_9)
self.gb_pb_sell_volume_1_3_9.setGeometry(QtCore.QRect(350, 120, 41, 23))
self.gb_pb_sell_volume_1... | |
m.x112 == 0)
m.c81 = Constraint(expr= m.x18 - m.x98 - m.x99 == 0)
m.c82 = Constraint(expr= m.x23 - m.x110 - m.x112 == 0)
m.c83 = Constraint(expr= m.x98 - 3.34221486003388*m.b206 <= 0)
m.c84 = Constraint(expr= m.x99 + 3.34221486003388*m.b206 <= 3.34221486003388)
m.c85 = Constraint(expr= m.x110 - 1.32154609891348*m.... | |
import hashlib
import io
import os
import shutil
import pytz
import uuid
import boto3
from botocore.client import Config
from datetime import datetime
from functools import partial
from typing import Dict, Set
from django.db.models import Count, Prefetch, DateTimeField
from django.db.models.expressions import F, Q
f... | |
includes the number of homocides and population.
Creating two arrays from these columns.
>>> stl_e, stl_b = np.array(stl[:,10]), np.array(stl[:,13])
Creating a spatial weights instance by reading in stl.gal file.
>>> stl_w = pysal.open(pysal.examples.get_path('stl.gal'), 'r').read()
Ensuring that the elements ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.