input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<gh_stars>10-100
import os
import sys
import copy
import zlib
import pickle
import json
import shutil
from importlib import import_module
from itertools import islice
from .utils_novel import get_cb_settings, request_to_dict, validate_results
import six
from scrapy import signals
from scrapy.crawler import Crawler
fr... | |
def p_opaque_0(self, t):
"""
opaque : OPAQUE ID gate_scope bit_list
"""
# TODO: even less of an idea than barrier how to deal with this
def p_opaque_1(self, t):
"""
opaque : OPAQUE ID gate_scope '(' ')' bit_list
"""
def p_opaque_2(self, t):
"""
opaque : OPAQUE ID gate_scope '(' gate_id_list ')' bit_list
"... | |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# 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 without restriction, including without limitation the rights
# to use, co... | |
# Copyright 2018 StreamSets 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 agreed to in writing, ... | |
<reponame>Octoberr/swm0920
"""table automated task"""
# -*- coding:utf-8 -*-
import time
import traceback
from commonbaby.helpers import helper_time
from commonbaby.sql import (SqlConn, SqliteColumn, SqliteConn,
SqliteConnManager, SqliteIndex, SqliteTable,
table_locker)
from ..sqlcondition import SqlCondition, Sql... | |
""" IGMP_STD_MIB
The MIB module for IGMP Management.
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.error... | |
from collections import defaultdict
from distutils.version import LooseVersion
from functools import partial
import numba
from numba.core import compiler, cgutils, types
from numba.core.errors import TypingError
from numba.core.extending import intrinsic
from numba.experimental import structref
from numba.core.typed_p... | |
srcFreq = int(Database.getSymbolValue("core", "GCLK_1_FREQ"))
# OSCULP32K
elif src == "OSCULP32K":
srcFreq = 32768
# XOSC32K
elif src == "XOSC32K":
srcFreq = int(Database.getSymbolValue("core", "XOSC32K_FREQ"))
# DFLL
elif src == "DFLL":
srcFreq = int(Database.getSymbolValue("core", "DFLL_CLOCK_FREQ"))
# ... | |
declared as
``global`` or ``nonlocal`` in a given lexical scope shadow names from the
``let`` environment *for the entirety of that lexical scope*. (This is
modeled after Python's standard scoping rules.)
**CAUTION**: assignment to the let environment is ``name << value``;
the regular syntax ``name = value`` crea... | |
slice as a TILE operation.
return _SliceOf.function(self, key)
@staticmethod
def for_op(shape, operation, output, name=None):
"""Builds an operation output Value.
Args:
shape (Shape): The symbolic shape of the operation output.
operation (Operation): The operation producing the output.
output (str): The name ... | |
from panda3d.core import *
from pirates.piratesbase import PiratesGlobals
from pirates.piratesbase import PLocalizer
from pirates.piratesgui import PiratesGuiGlobals
from pirates.reputation import ReputationGlobals
from direct.showbase import DirectObject
from direct.distributed.ClockDelta import *
from direct.directno... | |
) -> Union["Variable", Dict[Hashable, "Variable"]]:
"""Index or indices of the maximum of the Variable over one or more dimensions.
If a sequence is passed to 'dim', then result returned as dict of Variables,
which can be passed directly to isel(). If a single str is passed to 'dim' then
returns a Variable with dty... | |
<filename>tensorflow/contrib/tensor_forest/python/tensor_forest.py
# Copyright 2016 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... | |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozil... | |
self.total_ess = self.calculate_ess(self.sinf_logw)
return sigma
def init_weights_cleanup(self, logq_func=None, dlogq_func=None):
"""Finish initializing the first importance weights (including possible local exploration)."""
self.sinf_logw = np.copy(self.log_weight)
self.importance_weights = np.copy(self.weights... | |
<reponame>Radiian-Arts-Main/Radiian-Arts-BioSource
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Qt filechooser widget.
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehumancommunity.org/
**Github Code Home Page:** https://github.com/makehumancommunity/
**Authors:** <NAME>, <NAME>
**Copyrig... | |
df_alloy['star'][row]
alloy_mass = df_alloy['alloy mass'][row]
if star_name == star_name2:
feo_moles = feo_in / feo_molwt
na2o_moles = na2o_in / na2o_molwt
mgo_moles = mgo_in / mgo_molwt
al2o3_moles = al2o3_in / al2o3_molwt
sio2_moles = sio2_in / sio2_molwt
cao_moles = cao_in / cao_molwt
nio_moles = nio_in /... | |
<gh_stars>1-10
# Modifications, Copyright 2021 KitchenShift
# 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
#
# Unle... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Colony Framework
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Colony Framework.
#
# Hive Colony Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... | |
<gh_stars>10-100
# Copyright The IETF Trust 2015-2021, All Rights Reserved
# -*- coding: utf-8 -*-
import os
import time
from textwrap import dedent
from typing import List, Tuple # pyflakes:ignore
import debug # pyflakes:ignore
debug.debug = True
from django.conf import settings
from django.core import checks
from... | |
#!/usr/bin/env python3
# *******************************************************
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
# * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
# * WARRANTIES OR CO... | |
for plotting purposes #
###############################################################
###############################################################
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_bias_oversc... | |
import re
import sys
import six
# To use the assembler: python assembler.py inputfile.asm
class Assembler(object):
def __init__(self, address):
self.address = address
self.pseudo_ops = ['.ORIG', '.END', '.BLKW', '.FILL', '.STRINGZ']
self.op_instructions = {"ADD": 0b0001 << 12, "AND": 0b0101 << 12, "NOT": 0b10... | |
from torch.nn.functional import conv1d, conv2d, fold
import torch.nn as nn
import torch
import numpy as np
from time import time
from ..utils import *
from scipy.signal import get_window
class STFTBase(nn.Module):
"""
STFT and iSTFT share the same `inverse_stft` function
"""
def inverse_stft(
self, X, kernel_co... | |
"tableAlias": "dim_efficiency_inspection_item",
"layer": "dim",
"tableName": "<dim_efficiency_inspection_item_{now/d}>",
"buildIn": True,
"lifecycle": 7,
"name": "INSPECTION_ITEM",
"alias": "巡检项",
"partitionFormat": "d",
"domainId": 3
},
"fieldsReq": [{
"buildIn": True,
"field": "id",
"nullable": False,
"... | |
= apdev[0]['bssid']
params = hs20_ap_params()
params['hessid'] = bssid
params['anqp_3gpp_cell_net'] = "555,444"
hapd = hostapd.add_ap(apdev[0], params)
dev[0].hs20_enable()
dev[0].scan_for_bss(bssid, freq="2412")
id = dev[0].add_cred_values({'realm': "example.com",
'domain': "example.com",
'username': "test"... | |
<reponame>arfontalvoANU/srlife<filename>examples/gemasolar/verification/nashTubeStress.py
#!/usr/bin/env python3
# Copyright (C) 2021 <NAME>
# 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, eith... | |
<filename>DeepLearning UK Lottery -Euro-Hotpick-Latest.py
#!/usr/bin/env python
# coding: utf-8
# In[3]:
# -*- coding: utf-8 -*-
"""
Created on 10th Feb 2021
@author: <NAME>
"""
#importing libraries
import tensorflow as tf #tensorflow lib for defining the architecture of neural network
import pandas as pd #pandas ... | |
'OpShiftRightLogical' : 194,
'OpShiftRightArithmetic' : 195,
'OpShiftLeftLogical' : 196,
'OpBitwiseOr' : 197,
'OpBitwiseXor' : 198,
'OpBitwiseAnd' : 199,
'OpNot' : 200,
'OpBitFieldInsert' : 201,
'OpBitFieldSExtract' : 202,
'OpBitFieldUExtract' : 203,
'OpBitReverse' : 204,
'OpBitCount' : 205,
'OpDPdx' : 207,... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
import unittest
from collections import OrderedDict
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
# Create your tests here.
from pyexcel import Sheet, Book
from Grades.exceptions import GradeException
from Grades.models im... | |
Resource(object):
_swagger_client = None
_mapping_schema = None
_class_name = None
_api = None
def __new__(cls, **kwargs):
try:
resource, operation = cls._mapping_schema["methods"][
"create"
].split(".")
except:
raise ms_exp.MarketSightError("No 'create' endpoint")
callable_o = getattr(getattr(cls._swagge... | |
<gh_stars>10-100
#stuff on aerials: https://samuelpmish.github.io/notes/RocketLeague/aerial_control/, https://youtu.be/SmIuaXpSgBQ
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.messages.flat.QuickChatSelection import QuickChatSelection
from rlbot.utils.structures.game_data_struct im... | |
vessel_type='Floating roof',
vessel_material='Stainless steel')
T620.line = 'SAStorageTank'
T620_P = units.TALPump('T620_P', ins=T620-0, outs=SA)
# # 7-day storage time, similar to ethanol's in Humbird et al.
# T607 = units.TALStorageTank('T607', ins=D402_H-0, tau=7*24, V_wf=0.9,
# vessel_type='Floa... | |
a 3D array of shape (n_lons, n_lats, n_heights)
containing the TEC data.
- If an epoch is "None", no epoch was provided for that map.
rms_maps: dictionary, with the same specification as tec_maps except with RMS data.
height_maps: dictionary, with the same specification as tec_maps except with height map data.
sa... | |
<reponame>darobin/critic<filename>testing/virtualbox.py
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2013 <NAME>, Opera Software ASA
#
# 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
#... | |
metadata
MetadataPrinter(self)
def report_parse(self, sero_report):
"""
Parse an existing report, and extract the results
:param sero_report: type STR: Name and absolute path of the report
"""
with open(sero_report, 'r') as report:
next(report)
for line in report:
data = line.rstrip().split(',')
for sample ... | |
}
Attributes
----------
condition : anyOf(Conditional<MarkPropFieldDef>, Conditional<ValueDef>, list)
A field definition or one or more value definition(s) with a selection
predicate.
value : anyOf(float, string, boolean)
A constant value in visual domain.
"""
_schema = {'$ref': '#/definitions/MarkPropValueD... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
emha-koeln, SkyEmie, bbb0
"""
import time
#from flashbootlib import test
import os
from os import path
import math
import subprocess
from subprocess import PIPE, run
import platform
import configparser
import argparse
#import time
################################... | |
= setup()
trace('Finding blank node subjects...')
query = conn.prepareTupleQuery(QueryLanguage.SPARQL, 'SELECT * WHERE { ?subject %s _:object . }' %
(URIs.pointBlank))
results = query.evaluate()
# Pick one to use
result = next(results)['subject']
trace(str(result))
trace('Attempting to query using SPARQL wi... | |
each image
_data = []
data_sizes = []
data_types = []
model_opts_3d = model_opts.copy()
for d_type in model_opts['obs_input_type']:
if 'local' in d_type or 'context' in d_type or 'mask' in d_type:
if self._backbone == 'c3d':
model_opts_3d['target_dim'] = (112, 112)
model_opts_3d['process'] = False
features,... | |
#########################################################################
# Dicomifier - Copyright (C) Universite de Strasbourg
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for... | |
"""HTTP :mimetype:`multipart/*`-encoded file streaming.
"""
import abc
import collections.abc
import io
import os
import stat
import typing as ty
import urllib.parse
import uuid
from . import filescanner
from . import utils
if ty.TYPE_CHECKING: #COMPAT: Py3.7-
import typing_extensions as ty_ext
else:
from . impor... | |
== 'Failed':
warning_checks['#13:Check:vManage:Network Card type'] = [ check_analysis, check_action]
log_file_logger.error('#13: Check result: {}'.format(check_result))
log_file_logger.error('#13: Check Analysis: {}'.format(check_analysis))
log_file_logger.error('#13: Ethercardswith e1000 card type... | |
'mò',
0x25C7A: 'qiān',
0x25C7B: 'chì,tú',
0x25C7C: 'pái,pì',
0x25C7D: 'juàn',
0x25C80: 'cháo',
0x25C81: 'liè',
0x25C82: 'bīng',
0x25C83: 'kòu',
0x25C84: 'dàn',
0x25C85: 'chóu',
0x25C86: 'tōng',
0x25C87: 'dàn',
0x25C88: 'mǎn',
0x25C89: 'hù',
0x25C8A: 'liáo',
0x25C8B: 'xián',
0x25C8D: 'cáo',
0x25C8E: 'l... | |
# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | |
<gh_stars>1-10
"""This module contains the GeneFlow Definition class."""
import copy
import pprint
import cerberus
import yaml
from geneflow.log import Log
GF_VERSION = 'v1.0'
WORKFLOW_SCHEMA = {
'v1.0': {
'gfVersion': {
'type': 'string', 'default': GF_VERSION, 'allowed': [GF_VERSION]
},
'class': {
'type': '... | |
from __future__ import annotations
import asyncio
import base64
import datetime
from http import HTTPStatus
import json
import logging
import os
from pathlib import Path
try:
# Linux expects the latest package version of 3.35.4 (as of pysqlite-binary 0.4.6)
import pysqlite3 as sqlite3
except ModuleNotFoundError:
# M... | |
from itertools import product, chain
from csv import writer
from os import path
import re
class UtterMore:
def __init__(self, *utterance_templates):
"""
A class to create utterances for a custom skill for Amazon's Alexa. It
can be a tedious process if verbosity is desired because language is so
flexible. So thi... | |
== 'NEW':
status = _TreeShr._TreeOpenNew(_C.byref(self.ctx),
_C.c_char_p(_ver.tobytes(self.tree)),
_C.c_int32(self.shot))
else:
raise TypeError('Invalid mode specificed, use "normal","edit","new" or "readonly".')
_exc.checkStatus(status)
if status!=_exc.TreeALREADY_OPEN.status:
self.opened = True # only update ... | |
from __future__ import division, unicode_literals
import unittest
from itertools import chain
import serial
import pyfirmata
from pyfirmata import mockup
from pyfirmata.boards import BOARDS
from pyfirmata.util import (break_to_bytes, from_two_bytes,
str_to_two_byte_iter, to_two_bytes,
two_byte_iter_to_str)
# Mess... | |
1),
(9, 3, 3, 2): (0, 1),
(9, 3, 3, 3): (0, 1),
(9, 3, 3, 4): (0, 1),
(9, 3, 3, 5): (0, 1),
(9, 3, 4, -5): (0, 1),
(9, 3, 4, -4): (0, 1),
(9, 3, 4, -3): (0, 1),
(9, 3, 4, -2): (0, 1),
(9, 3, 4, -1): (0, 1),
(9, 3, 4, 0): (0, 1),
(9, 3, 4, 1): (0, 1),
(9, 3, 4, 2): (0, 1),
(9, 3, 4, 3): (0, 1),
(9, 3, 4, 4... | |
"""
Functions for processing/analysing ARNA campaign observations
"""
import os
import sys
import gc
import glob
import xarray as xr
import numpy as np
import AC_tools as AC
import pandas as pd
from netCDF4 import Dataset
from datetime import datetime as datetime_
import datetime as datetime
import time
from time impo... | |
# /.venv/bin/python
import os
import shutil
import sys
import time
import webbrowser
from random import randint
from libs import metadata
from libs.testloop import Test
from libs.testloop import langDict, show_dirs, log, now, nonsense
from libs.testloop import TestExistsError, CorruptedTestError
# gui utilities
import... | |
one2many is represented as a list of commands so we used res_model & res_id
displayed_image_id = fields.Many2one('ir.attachment', domain="[('res_model', '=', 'project.task'), ('res_id', '=', id), ('mimetype', 'ilike', 'image')]", string='Cover Image')
legend_blocked = fields.Char(related='stage_id.legend_blocked', st... | |
= read_string(self.conn)
if not expressions:
expressions = set('*')
handlers.append((line_start, line_end, expressions))
BREAK_ON.handler_cache[filename] = handlers
finally:
BREAK_ON.handler_lock.release()
def command_clear_stepping(self):
tid = read_int(self.conn)
thread = get_thread_from_id(tid)
if thr... | |
import cupy
from cupy.random import generator
from cupy import util
# TODO(beam2d): Implement many distributions
def beta(a, b, size=None, dtype=float):
"""Beta distribution.
Returns an array of samples drawn from the beta distribution. Its
probability density function is defined as
.. math::
f(x) = \\frac{x... | |
observed_sf_units = int(parcel_observed_du['single'])
else:
observed_sf_units = 0
#Look up observed MF DU
if 'multi' in parcel_observed_du.keys():
observed_mf_units = int(parcel_observed_du['multi'])
else:
observed_mf_units = 0
print ' Observed %s single-family DU.' % (observed_sf_units)
print ' Observed %... | |
<filename>backend/src/contaxy/managers/deployment/kubernetes.py
import os
import time
from datetime import datetime, timezone
from typing import Any, List, Literal, Optional
from kubernetes import client as kube_client
from kubernetes import config as kube_config
from kubernetes.client.models import (
V1Deployment,
... | |
"%(minute)d%(minute_label)s, %(second)d%(second_label)s"
>>> print(f.toString((2*86400 + 3*3600 + 5*60 + 2, "second", "group_deltatime"),
... useThisFormat=delta_format))
2 days, 3 hours, 5 minutes, 2 seconds
"""
def __init__(self, unit_format_dict = default_unit_format_dict,
unit_label_dict = default_unit_label... | |
for the SQLSession class
:param database_url: string with unique resource identifier to database
:param verbose: [optional] boolean to enable database logging to stdout
NOTE: to create a new database, use a tool SQL Workbench
https://data36.com/install-sql-workbench-postgresql/
SET AUTOCOMMIT = ON
create databa... | |
import torch
from transboost.weak_learner import *
from transboost.label_encoder import LabelEncoder, OneHotEncoder, AllPairsEncoder
from transboost.callbacks import CallbacksManagerIterator, Step, ModelCheckpoint, CSVLogger,\
Progression, BestRoundTrackerCallback,BreakOnMaxStepCallback, \
BreakOnPerfectTrainAccurac... | |
media types are selected, that it's just a normal form type and proceed
newFormType.type = 0;
#Update the form type's group
#If it's a new group
if post_data.get('ft_group') == 'NEW':
#Create a new formtype group
newFormTypeGroup = FormTypeGroup(name=post_data.get('ft_group_new'), project=PROJECT)
newFormT... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 11:54:36 2021
@author: Robert https://github.com/rdzudzar
"""
# Package imports
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import cmasher as cmr
import numpy as np
#from scipy import stats
import scipy.stats
import math
from bokeh.plott... | |
#*****************************************************************************
# inventory.py
#
# XML I/O for Inventory (new schema)
#
# (c) 2006 <NAME>, GFZ Potsdam
#
# 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
# Fre... | |
# -*- coding: utf-8 -*-
import os
import sys
import random
import time
import re
import json
import chardet
import operator
from io import BytesIO
import shutil
import hashlib
import threading
import fnmatch
import platform
import traceback
import multiprocessing
import tcfcli.common.base_infor as infor
from multiproc... | |
ms15-051 local priv
#
# v24 2015-01-30
# - added --sub/-s command in order to display output of msids as linked
# this aides in demonstrating what patches need to be applied precisely.
# this change was implemented in v23, but only followed the depth to level
# 1 instead of the entire way.
# - fixed a bug that know al... | |
layer**
# In[ ]:
# print("========randomize last layer")
# layer = model.layers[-4] # the last convolutional layer
# weights = layer.get_weights()
#
# new_kernel = np.random.normal(size=weights[0].shape)/(GRID_H*GRID_W)
# new_bias = np.random.normal(size=weights[1].shape)/(GRID_H*GRID_W)
#
# layer.set_weights([new_ke... | |
<filename>flexget/utils/imdb.py
from __future__ import unicode_literals, division, absolute_import
import difflib
import logging
import re
from bs4.element import Tag
from flexget.utils.soup import get_soup
from flexget.utils.requests import Session
from flexget.utils.tools import str_to_int
from flexget.plugin impor... | |
self.approximate_krr_regressions_['target'].kernel_(
self.approximate_krr_regressions_['source'].anchors(),
self.approximate_krr_regressions_['target'].anchors()
)
K_XY = torch.Tensor(K_XY)
return self.approximate_krr_regressions_['source'].sample_weights_.T.matmul(K_XY).matmul(self.approximate_krr_regressions_['t... | |
#!/usr/bin/env python
"""Parses MARC-format data. The MARC class has a constructor
which takes binary MARC data.
"""
# This file should be available from
# http://www.pobox.com/~asl2/software/PyZ3950/
# and is licensed under the X Consortium license:
# Copyright (c) 2001, <NAME>, <EMAIL>
# All rights reserved.
# Pe... | |
<reponame>EticaAI/HXL-Data-Science-file-formats
#!/usr/bin/env python3
# ==============================================================================
#
# FILE: hxlquickimport
#
# USAGE: hxlquickimport hxlated-data.csv my-exported-file.hxl
# cat hxlated-data.csv | hxlquickimport > my-exported-file.hxl
#
# ### To expos... | |
from collections import Counter
from tqdm import tqdm
import itertools
import pandas as pd
import numpy as np
from db import get_annotation_db
from journal import get_journal_text, get_journal_info, get_journal_text_representation
responsibility_labels = ["communicating", "info_filtering", "clinical_decisions", "prep... | |
<filename>depricated/km.py
from __future__ import division
import numpy as np
from collections import defaultdict
import json
import itertools
from sklearn import cluster, preprocessing, manifold
from datetime import datetime
import sys
class KeplerMapper(object):
def __init__(
self,
cluster_algorithm=cluster.DBSC... | |
from django.db.models.options import Options
autocreate_through_tables = hasattr(Options({}), 'auto_created')
add_field = {
'AddNonNullNonCallableColumnModel':
'\n'.join([
'ALTER TABLE "tests_testmodel" ADD COLUMN "added_field" integer ;',
'UPDATE "tests_testmodel" SET "added_field" = 1 WHERE "added_field" IS NU... | |
to true')
dev.updateStateOnServer('mapUpdateNeeded',value=True)
self.godoMapping(str(follow['location']['latitude']),str(follow['location']['longitude']),dev)
return
except Exception as e:
self.logger.debug(unicode('Exception in refreshDataforDev: ' + unicode(e)))
self.logger.debug('Exception:')
self.logger.ex... | |
{prediction}")
y_raw_predictions.append(prediction_raw)
y_predicted.append(prediction)
return y_predicted, y_raw_predictions
def accuracy(self, data_x: np.ndarray, data_y: np.ndarray,
debug: Dict) -> Tuple[int, np.ndarray]:
if debug['metrics']:
logger.nl()
logger.info('Accuracy', color='cyan')
predictions, _ ... | |
{vRK: Bipartite.KERNEL for vRK in set(self.RK.nodes)}, 'bipartite')
nx.set_node_attributes(self.RK, RK_types, 'type')
# define the arcs that go from the vertices of K to those of R\K, and viceversa
E_K2RK = {(K_node_IDs[0], RK_node_IDs[0])}
E_RK2K = {(RK_node_IDs[-1], K_node_IDs[-1])}
E_K2RK2K = E_K2RK | E_RK2K
... | |
from . import assert_match, ntorch
import torch
from collections import OrderedDict
import pytest
import torch.nn.functional as F
from hypothesis import given
from .strategies import (
named_tensor,
broadcast_named_tensor,
mask_named_tensor,
dim,
dims,
name,
names,
)
from hypothesis.strategies import (
sampled_... | |
to fill the root window
#Buttons
Stop_OP25 = tk.Button(master=back, text='Stop OP25 Instances', command=stopall, width=14, height=3)
Stop_OP25.grid(row=0, column=3, sticky=tk.W+tk.E+tk.N+tk.S, padx=9, pady=5)
GoToFavorites_OP25 = tk.Button(master=back, text='Go To Favorites', command=self.Favorites, width=14, heigh... | |
Team.
"""
pass
def test_teams_id_data_source_soaps_fk_delete(self):
"""
Test case for teams_id_data_source_soaps_fk_delete
Delete a related item by id for dataSourceSoaps.
"""
pass
def test_teams_id_data_source_soaps_fk_get(self):
"""
Test case for teams_id_data_source_soaps_fk_get
Find a related item b... | |
to
# raise this on the user if there is a problem ASAP.
key = self._relationship_key(inline)
# Add all existing items
if obj:
session = object_session(obj)
index = -1 # Needed in case there are no items yet
for index, item in enumerate(getattr(obj, key)):
delete_key = 'delete_%s_%d' % (inline.name, index)
if ... | |
<filename>ui/app/app.py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | |
pulumi.set(self, "sni_handlers", value)
@pulumi.input_type
class AlbLoadBalancerListenerTlsDefaultHandlerArgs:
def __init__(__self__, *,
certificate_ids: pulumi.Input[Sequence[pulumi.Input[str]]],
http_handler: Optional[pulumi.Input['AlbLoadBalancerListenerTlsDefaultHandlerHttpHandlerArgs']] = None):
"""
:param ... | |
<filename>easybase/table.py<gh_stars>0
"""
EasyBase table module.
"""
import time
import logging
from numbers import Integral
from operator import attrgetter
from struct import Struct
from hbase.ttypes import TScan, TGet, TColumnValue, TPut, TColumn, TTimeRange, TDelete
from .util import thrift_type_to_dict, str_incr... | |
dtype='double'
"""
if self._id is None:
self._show_error_not_initizalied()
if f.ndim != 3:
msg = "Force array has to be three dimensions."
raise RuntimeError(msg)
alm.set_f_train(self._id, np.array(f, dtype='double', order='C'))
def set_training_data(self, u, f):
"""Set displacements and respective forces... | |
{}
for request in requests:
message_id = self._queue_request(request[0], request[1])
self.unanswered_requests[message_id] = request
self._queue_request('server.banner', [])
self._queue_request('server.donation_address', [])
self._queue_request('server.peers.subscribe', [])
self._queue_request('blockchain.relayfe... | |
: 5, 8056048104805248435 : 2, 18446744073709551615 : 0, 12130603730978457510 : 6, 18446744073709551615 : 0, 18446744073709551615 : 0, 18446744073709551615 : 0, 18446744073709551615 : 0, 18446744073709551615 : 0, 18446744073709551615 : 0, 10789443546307262781 : 4, 18446744073709551615 : 0, 18446744073709551615 : 0},
ta... | |
<reponame>Geode-solutions/OpenGeode
# -*- coding: utf-8 -*-
# Copyright (c) 2019 - 2021 Geode-solutions
#
# 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 without restriction, including withou... | |
"21-1950294",
"21-1949457",
"21-1950269",
"21-1950277",
"21-1950304",
"20-1939262",
"21-1950447",
"21-1946987",
"21-1947511",
"19-1892768",
"21-1947479",
"20-1943443",
"21-1950377",
"21-1950378",
"19-1888392",
"21-1947180",
"18-1883358",
"21-1949234",
"21-1950421",
"21-1950418",
... | |
= f'''{("!" if expr.operator == "!=" else "")}Objects.equals({self.expr(expr.left)}, {self.expr(expr.right)})'''
else:
res = f'''{self.expr(expr.left)} {expr.operator} {self.expr(expr.right)}'''
else:
res = f'''{self.expr(expr.left)} {expr.operator} {self.mutated_expr(expr.right, expr.left if expr.operator == "=" e... | |
0, 0, 0],
[1, 0, 0, 0]]]
exp_cls_weights = [[[1, 1, 0.5, 0.5],
[0.5, 0.5, 0.5, 0.5],
[0.5, 0.5, 0.5, 0.5],
[0.5, 0.5, 0.5, 0.5]],
[[0.5, 0.5, 0.5, 0.5],
[1, 0.5, 0.5, 1],
[0.5, 0.5, 1, 0.5],
[0.5, 0.5, 0.5, 0.5]]]
exp_reg_targets = [[[0, 0, -0.5, -0.5],
[0, 0, 0, 0],
[0, 0, 0, 0,],
[0, 0, 0, 0,],],
[[0, 0... | |
with both a request object and flattened
# fields is an error.
with pytest.raises(ValueError):
await client.access_secret_version(
service.AccessSecretVersionRequest(), name="name_value",
)
@pytest.mark.parametrize("request_type", [service.DisableSecretVersionRequest, dict,])
def test_disable_secret_version(requ... | |
# TODO ML add all API functions that call into _command functions in the TincClient
import dis
from tinc import DataPool, ParameterSpace, DiskBuffer
bytecode = dis.Bytecode(f)
for instr in bytecode:
if instr.opname == 'LOAD_METHOD':
if instr.argval == 'get_slice':
print('''WARNING: calling certain Tinc functions... | |
from functools import reduce
from copy import copy
from time import time
import numpy as np
import numpy.random as npr
import numpy.linalg as la
import scipy.linalg as sla
from scipy.linalg import solve_discrete_lyapunov, solve_discrete_are
from utility.matrixmath import vec, mat, mdot, matmul_lr, specrad, dlyap, dar... | |
self.species_dict[label].rotors_dict.values():
if rotor['scan'] == job.scan:
used_trsh_methods = rotor['trsh_methods']
break
# A lower conformation was found
if 'change conformer' in methods:
# We will delete all of the jobs no matter we can successfully change to the conformer.
# If succeed, we have to cancel ... | |
the
array.
* [0] neg.precision aka Negative Predictive Value (NPV)
* [1] pos.precision aka Positive Predictive Value (PPV)
* [2] neg.recall aka True Negative Rate (TNR) aka Specificity
* [3] pos.recall aka True Positive Rate (TPR) aka Sensitivity
* [4] neg.f1 score
* [5] pos.f1 score
* [6] False Positive Rate ... | |
m.b3009 <= 0)
m.c875 = Constraint(expr= m.x874 - m.b3009 <= 0)
m.c876 = Constraint(expr= m.x875 - m.b3009 <= 0)
m.c877 = Constraint(expr= m.x876 - m.b3009 <= 0)
m.c878 = Constraint(expr= m.x877 - m.b3009 <= 0)
m.c879 = Constraint(expr= m.x878 - m.b3009 <= 0)
m.c880 = Constraint(expr= m.x879 - m.b3009 <= 0)
m.c88... | |
1.70, 1.75, 2.0, 2.5]
decs = [0.77, 0.76, 0.75, 0.74, 0.73, 0.66, 0.62, 0.61, 0.50, 0.48, 0.42, 0.38, 0.35, 0.28,0.25]
#decrease the size of Gaussian template, similar to the cfar_seg results.
# [cfar shrink the real target, when outside is lower than center]
wr = wr_lis[snr_lis.index(snr)]
hr = hr_lis[snr_lis.ind... | |
<reponame>BubuLK/sfepy
import sympy as sm
x, y, z = sm.symbols('x y z')
all_bfs = {
2 : {
1 : [
[
x*(y - 1.0) - y + 1.0 ,
x*(1.0 - y) ,
x*y ,
-x*y + y ,
],
[
[y - 1.0, x - 1.0] ,
[1.0 - y, -x] ,
[y, x] ,
[-y, 1.0 - x] ,
],
],
2 : [
[
x*(x*(2.0 - 2.0*y) + y*(5.0 - 2.0*y) - 3.0) + y*(2.0*y - 3.0) + 1.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.