input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import time
from datetime import datetime, timedelta
from typing import List, Optional
import pyotp
import pytest
import pytz
from faker import Faker
from restapi.connectors import Connector
from restapi.env import Env
from restapi.exceptions import BadRequest, Conflict, Unauthorized
from restapi.services.authenticat... | |
from ldcnet.basic import *
from ldcnet.CoordConv import AddCoordsNp
import numpy as np
import torch
class ENet(nn.Module):
def __init__(self, h, w):
super(ENet, self).__init__()
self.geoplanes = 3
self.geofeature = GeometryFeature()
self.h = h
self.w = w
# rgb encoder
self.rgb_conv_init = convbnrelu(in_channe... | |
<reponame>irrdnet/irrd4
import logging
from collections import OrderedDict
from enum import Enum
from typing import Optional, List, Set, Tuple, Any, Dict
from IPy import IP
from pytz import timezone
from irrd.conf import get_setting, RPKI_IRR_PSEUDO_SOURCE
from irrd.rpki.status import RPKIStatus
from irrd.rpsl.rpsl_o... | |
None and json.data_matricula.data_nasc is not js_undefined:
data_de_nascimento_formated = validations.format_iso_date_datetime(
json.data_matricula.data_nasc, "dd/MM/yyyy", "date"
)
endereco_imagem_aluno = "/static/{0}/images/user.png".format(
window.PhanterPWA.VERSIONING
)
if json.data_matricula.foto3x4 is not ... | |
<gh_stars>10-100
"""
This is a python library to manage the tables on Google Document using Google Docs API.
- All values can be retrieved from the table on Google Document.
- Values can be put to the table.
- Delete table, rows and columns of the table.
- New table can be created by including values.
- Append ... | |
<reponame>BiocomputeLab/curveball
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of curveball.
# https://github.com/yoavram/curveball
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, <NAME> <<EMAIL>>
from __future__ import print_function
from ... | |
<gh_stars>1-10
import numpy as np
import tensorflow as tf
import yolo.config as cfg
slim = tf.contrib.slim
class YOLONet(object):
def __init__(self, is_training=True):
""" 构造函数 利用 cfg 文件对网络参数进行初始化,同时定义网络的输入和输出 size 等信息, 其中 offset 的作用应该是一个定长的偏移 boundery1和boundery2
作用是在输出中确定每种信息的长度(如类别,置信度等)。 其中 boundery1 指的是对于所有的... | |
the dock item.
"""
self.titleBarWidget().setTitle(title)
# A concession to practicality: walk the ancestry and update
# the tab title if this item lives in a dock tab.
container = self.parent()
if container is not None:
stacked = container.parent()
if stacked is not None:
tabs = stacked.parent()
if isinstanc... | |
<reponame>def670/lfd<filename>lfd/rapprentice/knot_classifier.py<gh_stars>10-100
#!/usr/bin/env python
import numpy as np
#
# line segment intersection using vectors
# see Computer Graphics by <NAME>
#
def perp( a ) :
b = np.empty_like(a)
b[0] = -a[1]
b[1] = a[0]
return b
# line segment a given by endpoints a1, ... | |
return len(self.children)
def __getitem__(self, idx):
return self.children[idx]
def _get_enc_self(self):
sub_enc = [a.enc_self for a in self]
sub_enc = [x for x in sub_enc if x]
if sub_enc:
return self.sep.join(sub_enc)
else:
return None
enc_self = property(_get_enc_self)
def enrich_tree(self, a_tree):
... | |
# coding: utf-8
# (C) Copyright IBM Corp. 2020.
#
# 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... | |
# Copyright (c) 2012-2022, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 51.0.0
from . import AWSObject, AWSProperty, PropsDictType, Tags
from .validators import boolean, double, integer
class R... | |
<reponame>ozgurkara99/ISNAS-DIP
import torch
import torch.nn as nn
CONV_OPS = {
'sep_conv_3x3' : lambda C_in, C_out, affine: SepConv(C_in=C_in, C_out=C_out, kernel_size=3, padding=1, affine=affine),
'sep_conv_5x5' : lambda C_in, C_out, affine: SepConv(C_in=C_in, C_out=C_out, kernel_size=5, padding=2, affine=affine... | |
<filename>hyperbolic-rs/plot_embeds.py<gh_stars>1-10
# Copyright 2017 The Rudders Authors.
#
# 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
#
# U... | |
"""Game sample application"""
import time
import random
import math
import pygame
import numpy as np
from quaternion import from_rotation_vector
from pyxyz import *
class Missile(Object3d):
"""Missile class.
The missile will launch from a random position (defined on instancing) and will direct itself
towards the ... | |
<reponame>TouchTone/pyjsit
#!/usr/bin/python
# Helper module to control aria2c from Python
import subprocess, requests, random, xmlrpclib, time, urllib, socket
import os, weakref
from log import *
from tools import *
class AriaError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
... | |
use gather.
elif index_size == 1:
flattened_index_tuples = array_ops.reshape(indices, [-1])
return gather(params, flattened_index_tuples)
# Otherwise, params is a RaggedTensor, and indices is a 1D or 2D Tensor.
# Flatten both the index tuples and the params, such that the flattened
# index tuples point to the co... | |
<reponame>njru8cjo/fastinference<filename>fastinference/implementations/neuralnet/cpp/binary/implement.py
import os
import numpy as np
from jinja2 import Environment, FileSystemLoader
import textwrap
from math import ceil
from numpy.lib.arraysetops import isin
from fastinference.models.nn.Conv2D import Conv2D
from ... | |
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import sqlite3
from tkinter import colorchooser
root = Tk()
root.title('Codemy.com - TreeBase')
root.iconbitmap('')
root.geometry("1000x550")
def query_database():
# Clear the Treeview
for record in my_tree.get_children():
my_tree.delet... | |
<gh_stars>0
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ipac.py:
Classes to read IPAC table format
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: <NAME> (<EMAIL>)
"""
from __future__ import absolute_import, division, print_functi... | |
from __future__ import print_function
"""
ovm.py
TODO:
Define a VM that doens't use exceptions for control flow!
"""
import operator # for + - * / etc.
import os
import sys
import repr as repr_lib
from .pyvm2 import debug1
from ..lib import dis
# Create a repr that won't overflow.
repr_obj = repr_lib.Repr()
repr_... | |
p4start) / p4unit )
y4 = df[ (df.Year >= -20000) & (df.Year < 1000) ]['Global']
x4 = df[ (df.Year >= -20000) & (df.Year < 1000)]['Year']
s4 = stats.binned_statistic( x4, y4, 'mean', bins=np.linspace( p4start, p4end, p4n + 1) )
p4x = np.linspace( p4start + 500, p4end - 500, p4n ) # [-11500, +500] Kyr --> 13 bars
... | |
#!/usr/bin/python
"""Bitfinex Rest API V2 implementation"""
# pylint: disable=R0904
from __future__ import absolute_import
import json
from json.decoder import JSONDecodeError
import hmac
import hashlib
import requests
from bitfinex import utils
from enum import Enum
PROTOCOL = "https"
PUBLIC_PREFIX = "api-pub"
PRIVA... | |
<filename>test_autogalaxy/profiles/mass_profiles/test_stellar_mass_profiles.py
import numpy as np
import pytest
import autogalaxy as ag
grid = np.array([[1.0, 1.0], [2.0, 2.0], [3.0, 3.0], [2.0, 4.0]])
class TestEllGaussian:
def test__convergence_2d_from(self):
gaussian = ag.mp.EllGaussian(
centre=(0.... | |
exception.InvalidAPIVersionString as e:
return Fault(webob.exc.HTTPBadRequest(
explanation=six.text_type(e)))
except exception.InvalidGlobalAPIVersion as e:
return Fault(webob.exc.HTTPNotAcceptable(
explanation=six.text_type(e)))
# Identify the action, its arguments, and the requested
# content type
action_arg... | |
it shouldn't: {header}",
)
# Check that some *data* is present as expect: parent, but not child names
for parent_name in self.participant_names:
self.assertIn(
parent_name,
content,
"Parent given name was missing from CSV when selected as download field",
)
self.assertNotIn(
"ChildGivenName",
content,
"Chil... | |
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='JointType'):
if self._derived is not None and '_derived' not in already_processed:
already_processed.add('_derived')
outfile.write(' _derived=%s' % (self.gds_format_string(quote_attrib(self._deri... | |
"""
This module will encompass the code for analyzing the molecular dynamics generated on the simulations as dcd files.
It also takes care of the CV generation for further feeding into the MLTSA pipeline.
"""
import numpy as np
import mdtraj as md
from itertools import combinations
from itertools import permutation... | |
self.xThreshold, self.yThreshold)
if upFinish is None:
continue
if QSWATTopology.pointOnLine(upStart[0], downFinish, self.xThreshold, self.yThreshold):
return True
if QSWATTopology.pointOnLine(upFinish[-1], downStart, self.xThreshold, self.yThreshold):
return False
QSWATUtils.error('Cannot find physically connec... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
###################################################################################
# Added to enable code completion in IDE's.
if 0:
from gluon import db,request, cache
from applications.baadal.models import * # @UnusedWildImport
################################################... | |
original_reserved
self.mock_p_client.update_inventory.assert_called_with(segment_id,
inventory, seg_plugin.IPV4_RESOURCE_CLASS)
self.assertEqual(
inventory['total'],
self.mock_p_client.update_inventory.call_args[0][1]['total'])
self.assertEqual(
inventory['reserved'],
self.mock_p_client.update_inventory.call_ar... | |
<gh_stars>0
"""
Copyright (c) 2019-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed ... | |
kml_file, '9900ee00')
sText += printLine(bPrint, kml_file, '</color>')
sText += printLine(bPrint, kml_file, '<width>')
sText += printLine(bPrint, kml_file, '6')
sText += printLine(bPrint, kml_file, '</width>')
sText += printLine(bPrint, kml_file, '</LineStyle>')
sText += printLine(bPrint, kml_file, '</Style... | |
(7339439504*mcMS**18)/(36855*mbkin**20*(1 - mcMS/mbkin)**2) +
(58715516032*mcMS**18)/(110565*mbkin**19*(1 - mcMS/mbkin)**2) -
(14678879008*mcMS**18)/(36855*mbkin**18*(1 - mcMS/mbkin)**2) -
(18003292256*mcMS**19)/(405405*mbkin**21*(1 - mcMS/mbkin)**2) -
(144026338048*mcMS**19)/(1216215*mbkin**20*(1 - mcMS/mbkin)... | |
end of the URL, e.g.:
svn switch ^/branches/somebranch/.
If your editor isn't launching correctly, setup SVN_EDITOR.
For more details, see the README.rst file distributed with svnwrap
(displayable via 'svn readme').
""".strip()
% dict(
svnwrap_ini_path=get_svnwrap_ini_path(), version=__version__,
)
)
def parse... | |
# -*- coding: utf-8 -*-
import abc
import mock
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from website.util.permissions import READ, WRITE, ADMIN
from tests.base import ApiAddonTestCase
from tests.factories import AuthUserFactory
from w... | |
# Copyright 2013-present Barefoot 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
src.delay_reverb_on_off != 0 and src.delay_reverb_type == 1 else 0
fn_prologue_reverb_on_off = lambda src: 1 if src.delay_reverb_on_off != 0 and src.delay_reverb_type == 2 else 0
fn_sync = lambda src: 1 if src.ring_sync == 2 else 0
fn_ring = lambda src: 1 if src.ring_sync == 0 else 0
fn_str_pred = lambda src: "PRED"
... | |
node
@try_manual
def step_integration_runtime_node_delete(test, rg_5, rg, rg_2, rg_3, rg_4, rg_6, rg_7, rg_8, rg_9, rg_10, rg_11, rg_12,
rg_13, rg_14, rg_15, rg_16, rg_17, checks=None):
if checks is None:
checks = []
test.cmd('az synapse integration-runtime-node delete -y '
'--integration-runtime-name "{myIntegrat... | |
PERNAH DIBUAT SEBELUMNYA MAKA
# PROGRAM AKAN MENGAMBIL DATA PADA MONGODB
if ("Mata kuliah" in col_dosen.find_one({"_id" : data_dosen['_id']})) is True and (matkul in col_dosen.find_one({"_id" : data_dosen['_id']})['Mata kuliah']) is True and ("Pekan " + pekan in col_dosen.find_one({"_id" : data_dosen['_id']})['Mata k... | |
# --------------------------------------------------------------------------
# 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 may cause incor... | |
import unittest
from unittest import mock
import os
from tethys_cli.scaffold_commands import proper_name_validator, get_random_color, theme_color_validator, \
render_path, scaffold_command
class TestScaffoldCommands(unittest.TestCase):
def setUp(self):
self.app_prefix = 'tethysapp'
self.extensions_prefix = 'tet... | |
*(float) --*
The value of the Y coordinate for a point on a ``Polygon`` .
- **Id** *(string) --*
The identifier for the recognized text. The identifier is only unique for a single operation.
- **Relationships** *(list) --*
A list of child blocks of the current block. For example a LINE object has child blocks ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# License: © 2022 <NAME> All Rights Reserved
# Author: <NAME>
# Usage: python3 dikjstra.py
import os
import sys
import json
import uuid
import time
import folium
import random
from termcolor import colored
from geojson import MultiLineString, Point
from math import radian... | |
<filename>src/test/sharestore_lib/SharestorePool.py
import socket
import sys
import time
import logging
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TCompactProtocol
import os
sys.path.append(os.path.abspath(os.path... | |
in scatter plot. Default is 1. Try to\n"\
"change it to optimize the plot."
)
plot.add_argument(
"-sc",
dest="sc",
required=False,
default=0,
type=int,
help="Dot color for each PET in scatter plot. Default is 0. Try to\n"\
"change it see how many colors are supported by cLoops2."
)
plot.add_argument(
"-sa"... | |
<gh_stars>10-100
import gurobipy
import torch
import numpy as np
class IncorrectActiveConstraint(Exception):
pass
class MixedIntegerConstraintsReturn:
"""
We often convert a piecewise linear(affine) function y=f(x) to mixed
integer linear constraints, where `x` is our input, and `y` is our output.
The mixed in... | |
<gh_stars>1-10
# Copyright (C) 2013 Red Hat
# see file 'COPYING' for use and warranty information
#
# selinux gui is a tool for the examining and modifying SELinux policy
#
# 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... | |
left outer join mediaserver.PodcastEpisode PE on (P.podcast_id = PE.podcast_id)
JOIN mediaserver.mediaitemmetadata mimd on (PE.podcast_id = mimd.media_id)
JOIN mediaserver.Metadata md on (mimd.md_id = md.md_id)
JOIN mediaserver.MetadataType mdt on (md.md_type_id = mdt.md_type_id)
WHERE md.md_type_id = 6 AND md.md_i... | |
<filename>evolution/player.py<gh_stars>0
""" Represents a Player for the Evolution game
"""
from .trait import Trait
from .species import Species
from .feeding_intent import FeedNone, StoreFat, FeedVegetarian, FeedCarnivore, CannotFeed, FeedingIntent
from .traitcard import TraitCard
from .action4 import Action4
from .... | |
self._mask_info['self'] = False
source = mask.find('source')
if source == None: # Read in source information about the mask
raise Exception('Mask specified with no source!')
else:
self._mask_info.update(self._load_source(mask))
def _getSourceBandName(self, source, image):
'''Automatically determines the source... | |
import pandas as pd
import os
import csv
import copy
from pprint import pprint
import math
import dgl
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import scipy.sparse as sp
from dgl.nn import SAGEConv
import itertools
from sk... | |
__hash__(self):
return super().__hash__()
class BitVecOperation(BitVec, Operation):
def __init__(self, size, *operands, **kwargs):
super().__init__(size, *operands, **kwargs)
class BitVecAdd(BitVecOperation):
def __init__(self, a, b, *args, **kwargs):
super().__init__(a.size, a, b, *args, **kwargs)
class Bit... | |
these initial samples are discarded
:return: list of w_samples drawn
"""
"""Define model for MCMC.
NOTE the DemPref codebase creates a sampler via PyMC3 version 3.5;
this codebase adapts their model to PyMC3 version 3.11.2.
We use the NUTS sampling algorithm (an extension of
Hamilitonian Monte Carlo MCMC): ht... | |
<reponame>zimyang/Rubiks-Cube-Server<filename>rubikscubennnsolver/RubiksCube444.py
# standard libraries
import logging
# rubiks cube libraries
from rubikscubennnsolver import RubiksCube, wing_str_map
from rubikscubennnsolver.LookupTable import LookupTable, LookupTableIDAViaC
from rubikscubennnsolver.LookupTableIDAViaG... | |
htRangeOffset.getGPU() ] )
ctxt.codegen.kernelCalls.append ( scanCall )
ctxt.codegen.openMirrorKernel ( "_ins" )
emit ( call ( qlib.Fct.HASH_COUNT_MULTI,
[self.htmem.ht, self.htmem.numEntries, hashVar] ), ctxt.codegen.currentKernel )
ctxt.codegen.mirrorKernel.addVar ( htRangeOffset )
payl = self.payload... | |
= os.path.join(tempdir, path)
subdir = os.path.dirname(new_path)
if not os.path.exists(subdir):
os.makedirs(subdir)
with open(new_path, 'w') as f:
f.write(str(content))
try:
yield tempdir
finally:
rmtree(tempdir)
def with_tempdir(f):
"""
Decorator to give a single test a tempdir as argument to test method.... | |
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2019 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... | |
<reponame>GingerBear/texar<gh_stars>0
# Copyright 2019 The Texar 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
#... | |
if return_train_score:
key = 'train_%s' % name
ret[key] = train_scores_dict[name]
return ret
def cross_val_score_eval_set(eval_set_selection,
estimator, X, y=None, groups=None, scoring=None,
cv=None, n_jobs=None, verbose=0, fit_params=None,
pre_dispatch='2*n_jobs', error_score=np.nan):
"""
Evaluate a score by... | |
return value
@property
def name(self):
"""
Return the name of the parameter (if supplied)
"""
return self._name
def __repr__(self):
args = []
if self._name:
args.append("name='%s'" % self._name)
args.append("value='%s'" % (self._value,))
if self._type:
args.append("type='%s'" % self._type)
if self._defaul... | |
'numpy.bool_'>
assert net.pipe.at[p[1], "in_service"] == False # is actually <class 'numpy.bool_'>
assert net.pipe_geodata.at[p[0], "coords"] == [(10, 10), (20, 20)]
assert net.pipe_geodata.at[p[1], "coords"] == [(100, 10), (200, 20)]
assert net.pipe.at[p[0], "name"] == "p1"
assert net.pipe.at[p[1], "name"] == "p2... | |
<filename>squash_server_dummy.py<gh_stars>0
#License MIT 2017 <NAME>
import os
import pygame
import pygame.mixer
import threading
import queue
import json
import flask
import numpy as np
from PIL import Image
from io import BytesIO
import logging
from flask_limiter import Limiter
from flask_limiter.util import get_rem... | |
sent_term_matrix
def chunk_file(set_name, out_full_dir, out_dir, chunk_size=1000):
in_file = os.path.join(out_full_dir, '%s.bin' % set_name)
reader = open(in_file, "rb")
chunk = 0
finished = False
while not finished:
chunk_fname = os.path.join(out_dir, '%s_%03d.bin' % (set_name, chunk)) # new chunk
wit... | |
<gh_stars>0
""" Classes containing MLIR AST node types, fields, and conversion back to
MLIR. """
from enum import Enum, auto
from typing import Any, List, Union
from lark import Token
class Node(object):
""" Base MLIR AST node object. """
# Static field defining which fields should be used in this node
_fields_... | |
+ m.x311 + m.x312 + m.x352 + m.x353 + m.x354 <= 12)
m.c4202 = Constraint(expr= 12*m.b104 + 12*m.b111 + 12*m.b112 - m.x216 - m.x223 - m.x224 + m.x258 + m.x265 + m.x266
+ m.x272 + m.x279 + m.x280 + m.x286 + m.x293 + m.x294 + m.x300 + m.x307 + m.x308 + m.x314
+ m.x321 + m.x322 + m.x356 + m.x363 + m.x364 <= 12)
m.c4203... | |
# Core Library
import ast
from typing import Iterable, Set
# Third party
import pytest
# First party
from flake8_simplify import Plugin, get_if_body_pairs
def _results(code: str) -> Set[str]:
"""Apply the plugin to the given code."""
tree = ast.parse(code)
plugin = Plugin(tree)
return {f"{line}:{col} {msg}" for... | |
+ post_annotation_file, ".")
filelist = ["results", "work"]
del_file(filelist)
run = Run(run_id=run_id + "_p", pipeline="Post-ATAC-Seq", start_time=timezone.now())
run.save()
from .scripts.postrnaseq.start_pipeline import postatacchipseq
result = postatacchipseq(bed_file=post_bed_file, gtf_file=post_annotation... | |
<reponame>tayayan/suisho
#先手番合法手生成
import re
import Bboard
import Bboardbak2
import Wboard
import Wboardbak2
import board
import oute
#動かした後に先手玉に王手がかかっていないか判定
def kaihimore(sfen):
oute.oute = 0
#以下合法手生成コード
def move1():
global depth1
b1a,b2a,b3a,b4a,b5a,b6a,b7a,b8a,b9a = '','','','','','','','',''
b1b,b2b,b3b,b4b... | |
<reponame>ajintom/music_sync<filename>src/apps/devices/rgbanimations.py<gh_stars>0
import numpy
import random
import time
from cubelib import rgbwireframe
from cubelib import rgbemulator
# TODO:
# shiftPlane(axis, plane, delta)
# moves the plane along the axis by delta steps, if it exceeds dimensions, just clear it o... | |
menu_content.id}
)
# Confirmation screen populated with all to be deleted items
self.assertContains(
confirmation_response,
'<p>Are you sure you want to delete the menu item "{}"?'.format(child)
)
self.assertContains(
confirmation_response,
'All of the following related items will be deleted:</p>'
)
self.as... | |
def verify_plugin_settings(self):
puts("Verifying settings requested by plugins...")
missing_settings = False
missing_setting_error_messages = []
with indent(2):
for name, meta in self.required_settings_from_plugins.items():
if not hasattr(settings, name):
error_message = (
"%(setting_name)s is missing. It's r... | |
include the bugfix version!
self.mRepositories[key]["QRequest"] = QNetworkRequest(url)
self.mRepositories[key]["QRequest"].setAttribute(QNetworkRequest.Attribute(QgsNetworkRequestParameters.AttributeInitiatorClass), "Relay")
authcfg = self.mRepositories[key]["authcfg"]
if authcfg and isinstance(authcfg, str):
if ... | |
lbl='신장계'),
3158: SChildCategory(b=array([13]), m=array([212]), lbl='무술도복'),
3159: SChildCategory(b=array([56]), m=array([503]), lbl='베트남(기타)'),
3160: SChildCategory(b=array([2]), m=array([300]), lbl='쏘서'),
3161: SChildCategory(b=array([23]), m=array([228]), lbl='유두케어'),
3162: SChildCategory(b=array([34]), m=array... | |
used on the translation, transcription and extrinsic noise rate constants
simulation_timestep : float
The discretisation time step of the simulation. Only applies if the model is 'langevin' or 'agnostic'.
simulation_duration : float
The duration of the simulated time window for each trace. Only applies if the mod... | |
<filename>iicl.py
def randomAlphaNumeric( length ):
alphaNumeric = ''
for i in range(0, length):
alphaNumeric = alphaNumeric + random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
return alphaNumeric
def getConstellation(name):
result = ''
constellations = ['The Aries constellation c... | |
errordetail: The internal error message or exception dump.
:type errordetail: str
"""
_attribute_map = {
'exceptiontype': {'key': 'exceptiontype', 'type': 'str'},
'errordetail': {'key': 'errordetail', 'type': 'str'},
}
def __init__(
self,
*,
exceptiontype: Optional[str] = None,
errordetail: Optional[str] =... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import ConfigParser
import os
import os.path
import shutil
import sys
import time
import PixivHelper
script_path = PixivHelper.module_path()
class PixivConfig(object):
'''Configuration class'''
__logger = PixivHelper.GetLogger()
configFileLocation = ... | |
to not count the start node
# when we start from 0: the start node is expected in the count already
filter_term = f"FILTER counter1{fltr.op}{fltr.num + cl.navigation.start}"
else:
root_key = f"l{depth-1}_l0_res._key==l{depth-1}_l{depth-1}_res._key"
filter_term = f"FILTER ({root_key}) or (counter{depth}{fltr.op}{fl... | |
<filename>homeassistant/components/isy994/binary_sensor.py
"""Support for ISY994 binary sensors."""
from datetime import timedelta
from typing import Callable
from pyisy.constants import ISY_VALUE_UNKNOWN
from homeassistant.components.binary_sensor import (
DOMAIN as BINARY_SENSOR,
BinarySensorEntity,
)
from homeas... | |
<reponame>mikkelkp/honeybee-radiance-folder
# -*- coding: utf-8 -*-
"""
Radiance folder structure module.
This module includes classes for writing and reading to / from a Radiance folder
structure.
See https://github.com/ladybug-tools/radiance-folder-structure#radiance-folder-structure
"""
import json
import warning... | |
#!/usr/bin/python
import cv2
from threading import Thread
import time
import copy
from autopark.msg import list_ui
from std_msgs.msg import String
import rospy
from Tkinter import *
import tkMessageBox
import os
import signal
import atexit
# initialize window
window = Tk()
window.wm_withdraw()
# initialize ros node... | |
<reponame>danieldanciu/schoggi
# Copyright 2012 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/LICENSE-2.0
#
# Unless requ... | |
text.replace(' nw ', ' Northwest ')
text = text.replace(' nnw ', ' North-northwest ')
return text
# Modified 12/15/2010 (MHB) - modified to recognize the new way NHC will
# present metric speeds. Will continue to recognize the "old" way for
# testing purposes as well.
def _removeKM(self, words):
# Remove refer... | |
are:
"SVD":
Repeatedly performs singular value decomposition on
the matrix, detecting redundant rows based on nonzeros
in the left singular vectors that correspond with
zero singular values. May be fast when the matrix is
nearly full rank.
"pivot":
Uses the algorithm presented in [5]_ to identify
redundant ro... | |
#!/usr/bin/env python
#########################################################################
# 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
#... | |
edge IDs.
"""
def map_to_homo_nid(self, ids, ntype):
"""Map type-wise node IDs and type IDs to homogeneous node IDs.
Parameters
----------
ids : tensor
Type-wise node Ids
ntype : str
node type
Returns
-------
Tensor
Homogeneous node IDs.
"""
def map_to_homo_eid(self, ids, etype):
"""Map type-wise ed... | |
inputs):
ind4shape = 1 if self.scalar_mask[0] else 0
return cgt.shape(inputs[ind4shape])
def typ_apply(self, input_types):
assert ((input_types[0].ndim==0) == self.scalar_mask[0]) and ((input_types[1].ndim==0) == self.scalar_mask[1])
if self.scalar_mask==(False,False):
assert input_types[0].ndim == input_types[1]... | |
object.
The values in the dictionary are either 1 or 0. 1 indicates
a buy flag is associated with that stock. 0 indicates there
is no buy flag for that stock.
"""
bollinger = self.statistics.bollinger_bands(stock_data=stock_data)
inputSymbols = self.statistics.sd_to_is(stock_data=stock_data)
'''Split the data ... | |
import pygame as pg
import sys
from random import choice, random
from os import path
from settings3 import *
from sprites3 import *
from tilemap3 import *
# HUD functions
def draw_player_health(surf, x, y, pct, pic, picx, picy):
if pct < 0:
pct = 0
BAR_LENGTH = 100
BAR_HEIGHT = 20
fill = pct * BAR_LENGTH
outlin... | |
masking
self.boardSubstrate = Substrate([]) # Keep substrate in internal representation,
# Draw it just before saving
self.backboneLines = []
self.hVCuts = set() # Keep V-cuts as numbers and append them just before saving
self.vVCuts = set() # to make them truly span the whole panel
self.vCutLayer = Layer.Cmts_Us... | |
<filename>riscv_ctg/generator.py
# See LICENSE.incore for details
import random
from collections import defaultdict
from constraint import *
import re
from riscv_ctg.constants import *
from riscv_ctg.log import logger
import time
from math import *
import struct
import sys
import itertools
one_operand_finstructions = ... | |
<gh_stars>1000+
##########
# load1.py
##########
import boards
import util
import time
def main():
screen = util.Screen(boards.boards[0])
screen.update()
time.sleep(2)
row, col = 1, 9
while True:
character = screen.read(row, col)
if character == '_' or character == '*':
col += 1
elif character == '|':
row -... | |
# -*- coding: utf-8 -*-
"""
The MySQL database support module
Copyright 2017-20180 <NAME> and <NAME>
"""
# pylint: disable=import-error
# pylint: disable=mixed-indentation, bad-whitespace, bad-continuation, missing-docstring
# -- Imports ------------------------------------------------
import time
import mysql.connec... | |
= ERROR: Chi_free and chi_red ratios requires the definition of Dmax in order to operate!', file=sys.stderr )
sys.exit(1)
if fitMetric == 'cormap_matrix' and fitMode == 2:
print( '= = = ERROR: Refuse to do CorMap matrices for a matrix of fits. This is not currently supported.', file=sys.stderr )
sys.exit(1)
# Read... | |
versionadded:: 0.4.0
"""
for f_name, validators in self.__binobj_struct__.field_validators.items():
f_obj = self.__binobj_struct__.components[f_name]
value = self[f_name]
# First, invoke the validators defined on the field object.
for instance_validator in f_obj.validators:
instance_validator(value)
# Second,... | |
# -*- coding: utf-8 -*-
r"""
Output functions
These are the output functions for latexing and ascii/unicode art versions of
partitions and tableaux.
AUTHORS:
- <NAME> (?): initial version
- <NAME> (2013-02-14): Added support for displaying conventions and
lines, and tableaux of skew partition, composition, and
ske... | |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
----------------------------------------------... | |
<gh_stars>0
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0... | |
use rcParameter
self.grid(self._gridOn, which=rcParams['axes.grid.which'],
axis=rcParams['axes.grid.axis'])
props = font_manager.FontProperties(
size=rcParams['axes.titlesize'],
weight=rcParams['axes.titleweight'])
self.title = mtext.Text(
x=0.5, y=1.0, text='',
fontproperties=props,
verticalalignment='baseli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.