input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
may be connected to in shared mode. If this bit is set, SCARD_STATE_PRESENT will also be set
SCARD_STATE_MUTE There is an unresponsive card in the reader
from smartcard.scard import *
hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER)
hresult, readers = SCardListReaders(hcontext, [])
readerstates = []
... | |
"""
This module provides ways of systematically combining operations, sets of
operations, etc., and executing such sequences of operations.
"""
import copy
from collections import Iterable
import functools
import itertools
import operator
import threading
import traceback
from six import string_types
from combtest.ac... | |
% 1 == 0, "1/azimuth_res must be an integer."
assert not 360 % match, "360/match must be an integer."
assert match / azimuth_res % 1 == 0, "match/azimuth_res must be an \
integer."
elevation = np.atleast_1d(np.asarray(elevation))
# calculate delta azimuth to meet the desired great circle distance.
# (according ... | |
"""
Filter rows by subject, predicate, object values.
"""
from argparse import Namespace, SUPPRESS
import typing
from kgtk.cli_argparse import KGTKArgumentParser, KGTKFiles
def parser():
return {
'help': 'Filter rows by subject, predicate, object values.',
'description': 'Filter KGTK file based on values in the no... | |
self.about:
background = pygame.Surface((self.bg_size_x, self.bg_size_y))
background.fill((0, 0, 0))
background.set_alpha(192)
ds.blit(background, (304, 16))
ds.blit(self.text_render, (320, 32))
ds.blit(self.text_2_render, (320, 96))
ds.blit(self.text_3_render, (320, 128))
def draw_select(self, ... | |
str or ~azure.mgmt.sql.models.OperationMode
:param storage_key_type: Storage key type. Possible values include: "SharedAccessKey",
"StorageAccessKey".
:type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType
:param storage_key: Storage key.
:type storage_key: str
:param storage_uri: Storage Uri.
:typ... | |
await msg.edit(embed=embed)
else:
print(self.scfield_emote)
self.sc_config.update_field(div, name, str(type), self.scfield_emote)
await msg.add_reaction("👍")
#await msg.channel.send(embed=utils.format_embed("Updated field " + name + "!", False))
await self.generate_scoreboard_message(ctx, False) # Update the sco... | |
default='new', required=True)
class IrActionsServer(models.Model):
""" Server actions model. Server action work on a base model and offer various
type of actions that can be executed automatically, for example using base
action rules, of manually, by adding the action in the 'More' contextual
menu.
Since Odoo 8... | |
'''
Functions that help visualize results
'''
import os
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import numpy as np
from . import config
__all__ = ['plotter',
'segment_plotter',
'plot_poincare',
'plot_breathing']
def plotter(working_data, measures, show=True, figsize=None,
title='... | |
<reponame>Vgr255/Lexive<filename>cmds.py
import argparse
import random
import os
from typing import List, Tuple, Optional, Iterable
import discord
from discord.ext.commands.context import Context
from loader import (
casefold,
load,
mechanics,
player_cards,
player_mats,
nemesis_cards,
nemesis_mats,
waves,
t... | |
#!/usr/bin/python
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions... | |
<reponame>WolfLink/qsearch<filename>qsearch/gatesets.py
"""
This module defines the Gateset class, which represents the allowed gates and topology for a specific quantum computer.
Several Implementations of Gateset are also defined here.
Several aliases are also defined, for the most common use cases.
Attributes:
ZX... | |
self.GetBoundaryFaces()
self.GetBoundaryEdges()
def RemoveElements(self, xyz_min_max=None, element_removal_criterion="all", keep_boundary_only=False, return_removed_mesh=False,
compute_edges=True, compute_faces=True, show_plot=False):
"""Removes elements from the mesh given some specified criteria
input:
(x_mi... | |
The URL can be used as a curl command or directly with S3. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_file_with_http_info(file_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execu... | |
activity_index = "authors_{}".format(search_type)
# Check the database first.
authors_data = database.activity_retrieve(subreddit_name, specific_month, activity_index)
# If we don't have local data, fetch it.
if authors_data is None:
authors_data = {}
api_search_query = (
"https://api.pushshift.io/red... | |
<filename>functions/DICTIONARIES_AGNfitter.py
"""%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DICTIONARIES_AGNFitter.py
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This script contains all functions which are needed to construct the total model of AGN.
##For constructing a new dictionary,
(in cases: 1)add a filter which is n... | |
' ' +\
'username: ' + repr(self.username) + ' ' +\
'password: ' + repr(self.password) + ' ' +\
'tls_required: ' + repr(self.tls_required) + ' ' +\
'>'
def to_dict(self):
return {
'id': self.id,
'name': self.name,
'healthy': self.healthy,
'tags': self.tags,
'secret_store_id': self.secret_store_id,
'egress_f... | |
<reponame>mynameistechno/aimet
# /usr/bin/env python3.6
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with... | |
<reponame>edawson/parliament2
"""
Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting).
"""
import numpy as np
import warnings
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from s... | |
res = 'ערך תקין עבור בדיקת %s בין %.2f ועד %.2f, ערך מתחת %.2f נחשב חריג' % (
bloodtest_entity, bloodtest_thr2, bloodtest_max, bloodtest_thr1)
elif bloodtest_type == 3:
res = 'ערך תקין עבור בדיקת %s בין %.2f ועד %.2f' % (
bloodtest_entity, bloodtest_thr1, bloodtest_thr2)
res = res_timer(res, tracker)
dispatche... | |
<filename>lib/biokbase/probabilistic_annotation/DataExtractor.py
#!/usr/bin/python
#
# Call the CDMI API to get data needed to run the autorecon algorithm
# Needed data includes:
#
# For likelihood computations:
# - List of substems and the sequences of their members
# - List of OTU organisms
# - Gene neighborhoods for... | |
is xr.core.dataarray.DataArray:
th_v.name = 'th_v_monc'
return th_v
def q_total(*args):
"""
Specfic Total Water Content.
Derived variable name: q_total
Parameters
----------
args : list of numpy array or xarray DataArrays
specific water variables (e.g.[ q_v, q_cl]).
Returns
-------
q_total : numpy array... | |
<reponame>Open-Earth-Foundation/traction
"""
Aries Cloud Agent
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0.7.2
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # ... | |
# MIT License
#
# Copyright (c) 2019 LABSS(<NAME>, <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, copy, modif... | |
value?"):
messagebox.showinfo("Done", "Success")
aai_upperRateLimitEntry = temp
self.aaiUpperRateLimitValue.config(text="Current Value: " + aai_upperRateLimitEntry)
db.execute("UPDATE aai SET aai_upperRateLimitEntry = ? WHERE (user = ?)", (aai_upperRateLimitEntry, currentuser))
db.commit()
except:
messagebox.sh... | |
from __future__ import print_function
import logging
from abc import ABCMeta, abstractmethod
import progressbar
from six import add_metaclass
from toolz import first
import re
logger = logging.getLogger(__name__)
def callback(func):
func._is_callback = True
return func
class TrainingExtension(object):
"""The ... | |
LEXICON_REF)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, lingType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if lingType.subclass:
return lingType.subclass(*args_, **kwargs_)
else:
return lingType(*args_, *... | |
op in [('__radd__', operator.__add__),
('__rsub__', operator.__sub__),
('__rmul__', operator.__mul__),
('__rpow__', operator.__pow__),
('__rtruediv__', operator.__truediv__)]:
setattr(Tensor, meth_name, _make_rhand_array_promote_func(op, meth_name))
# -------------------------------------------------------------... | |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""The variant module contains data structures that are needed to manage
variants both in packages and in specs.
"""
impo... | |
"""
Analyze spike shapes - pulled out of IVCurve 2/6/2016 pbm.
Allows routine to be used to analyze spike trains independent of acq4's data models.
Create instance, then call setup to define the "Clamps" object and the spike threshold.
The Clamps object must have the following variables defined:
commandLevels (curre... | |
"""
This is an example of using the k-nearest-neighbors (KNN) algorithm for face recognition.
When should I use this example?
This example is useful when you wish to recognize a large set of known people,
and make a prediction for an unknown person in a feasible computation time.
Algorithm Description:
The knn classi... | |
import argparse
import sys
import os
import sys
import time
import csv
import sys
def metadata(asset,mf,mfile,errorlog):
if asset == 'PSO': # PS OrthoTile Analytic
folder = mf
with open(mfile,'wb') as csvfile:
writer=csv.DictWriter(csvfile,fieldnames=["id_no", "system:time_start", "platform", "satType","satID", "t... | |
<reponame>fpga-open-speech-tools/utils
#!/usr/bin/python3
"""
Download files for an SoC FPGA project from AWS.
This script downloads the bitstream, device tree overlay, and device
drivers located in a user-supplied directory in a user-supplied S3 bucket.
Parameters
----------
s3bucket : str
Name of the S3 bucket
s3... | |
factor
tau1 = ToolBox.tauPoint(numDeps, tauRos, 1.0)
#outline = ("tau1 "+ str(tau1) + "\n")
#dbgHandle.write(outline)
#//System.out.println("LINEGRID: Tau1: " + tau1);
#//logA = 2.0 * logLam0 + logGamma - ln4pi - logC - logDopp;
#//a = Math.exp(logA);
#//System.out.println("LINEGRID: logA: " + logE * ... | |
else:
self.MathsRegion = MathsRegion
self.MathsRegion_nsprefix_ = None
if NoiseRegion is None:
self.NoiseRegion = []
else:
self.NoiseRegion = NoiseRegion
self.NoiseRegion_nsprefix_ = None
if FrameRegion is None:
self.FrameRegion = []
else:
self.FrameRegion = FrameRegion
self.FrameRegion_nsprefix_ = None
if... | |
4 * ksize):min(shape[0], max0 + 4 * ksize), max(0, min1 - 4 * ksize):min(shape[1], max1 + 4 * ksize)]
while subset.max() > maxt:
subset = ndimage.median_filter(subset, ksize)
ds[max(0, min0 - 4 * ksize):min(shape[0], max0 + 4 * ksize), max(0, min1 - 4 * ksize):min(shape[1], max1 + 4 * ksize)] = subset
return ds
d... | |
=18
simx_headeroffset_crc =0 # 1 simxUShort. Generated by the client or server. The CRC for the message
simx_headeroffset_version =2 # 1 byte. Generated by the client or server. The version of the remote API software
simx_headeroffset_message_id =3 # 1 simxInt. Generated by the client (and used in a reply by the serv... | |
<gh_stars>0
import unittest
import sys
from robot.variables import variables, is_list_var, is_scalar_var, is_var
from robot.errors import *
from robot import utils
from robot.utils.asserts import *
SCALARS = [ '${var}', '${ v A R }' ]
LISTS = [ '@{var}', '@{ v A R }' ]
NOKS = [ 'var', '$var', '${var', '${va}r', '@{... | |
admin_password,
injected_files)
if rescue:
# NOTE(johannes): Attach root disk to rescue VM now, before
# booting the VM, since we can't hotplug block devices
# on non-PV guests
@step
def attach_root_disk_step(undo_mgr, vm_ref):
orig_vm_ref = vm_utils.lookup(self._session, instance['name'])
vdi_ref = self._fin... | |
<filename>topi/tests/python_cpp/test_topi_transform.py
"""Test code for broadcasting operators."""
import numpy as np
import tvm
import topi
def verify_expand_dims(in_shape, out_shape, axis, num_newaxis):
A = tvm.placeholder(shape=in_shape, name="A")
B = topi.cpp.expand_dims(A, axis, num_newaxis)
def check_device(d... | |
<reponame>mdnls/tramp<filename>tramp/channels/linear/conv_channel.py
import numpy as np
from numpy.fft import fftn, ifftn
from ..base_channel import Channel
from tramp.utils.conv_filters import (
gaussian_filter, differential_filter, laplacian_filter
)
from tramp.channels import LinearChannel
from tramp.utils.misc imp... | |
#!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License 2.0;
# This module is used for version 2 of the Google Data APIs.
"""Provides classes and constants for the XML in the Google Spreadsheets API.
Documentation for the raw XML which these classes represent can be found he... | |
<filename>src/mlsquare/adapters/sklearn.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import ray
from ray import tune
from ..optmizers import get_best_model
from ..utils.functions import _parse_params
import pickle
import onnxmltools
import numpy as np
import matplotlib.pyplot as plt
impor... | |
<filename>toontown/ai/ToontownAIRepository.py
import time
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.PyDatagram import *
from panda3d.core import *
from panda3d.toontown import *
from otp.ai.AIZoneData import AIZoneDataStore
from otp.ai.TimeManagerAI import TimeManagerAI
from otp.distr... | |
<reponame>BobDenny/alpyca-client<filename>alpaca/switch.py
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# switch - Implements ASCOM Alpaca Switch device class
#
# Part of the Alpyca Client application interface package
#
# Author: <NAME> <<EMAIL>> (rbd)
#
# Pyt... | |
lactis",
"organellum": "prokaryotic cytosol",
"sequence_modomics": "GGGGCCU4AGCUCAGCUGGGAGAGCGCCUGCUU5GC6CGCAGGAG7UCAGCGGUUCGAUCCCGCUAGGCUCCA",
"sequence_bpforms": "GGGGCCU{74U}AGCUCAGCUGGGAGAGCGCCUGCUU{501U}GC{62A}CGCAGGAG{7G}UCAGCGGUUCGAUCCCGCUAGGCUCCA",
"sequence_iupac": "GGGGCCUUAGCUCAGCUGGGAGAGCGCCUGCUUUGCACGC... | |
128167,
-52755,
837509650,
129316,
-1,
837572577,
128042,
837759472,
837423424,
128009,
-1,
837681614,
128050,
-52751,
837716734,
129345,
-1,
837824871,
128087,
838021624,
837360951,
-1,
-52748,
837974050,
983161,
-52747,
838011779,
983090,
-52746,
838077130,
983088,
-52745,
838142450,
... | |
<reponame>jam1garner/msc-debugger
condition_table_true = ["lt", "gt", "eq"]
condition_table_false = ["ge", "le", "ne"]
trap_condition_table = {
1: "lgt",
2: "llt",
4: "eq",
5: "lge",
8: "gt",
12: "ge",
16: "lt",
20: "le",
31: "u"
}
spr_table = {
8: "lr",
9: "ctr"
}
def decodeI(value):
return (value >> 2)... | |
<reponame>lamsoa729/FoXlink<filename>foxlink/me_zrl_odes.py
#!/usr/bin/env python
"""@package docstring
File: me_zrl_odes.py
Author: <NAME>
Email: <EMAIL>
Description: Class that contains the all ODEs relevant to solving the moment
expansion formalism of the Fokker-Planck equation for bound crosslinking motors.
"""
fr... | |
<reponame>ArnavM1499/Hanabi-HumanAI
from common_game_functions import *
from Agents.common_player_functions import *
from Agents.player import *
import time
import copy
import random
def count_card_list(knowledge, ls):
for card in ls:
remove_card(card, knowledge)
def count_board(knowledge, board):
for i in range... | |
vectors in a document use the suffix (ends with) "_vector_" for the field name. e.g. "product_description_vector_".
- When inserting or specifying chunks in a document the suffix (ends with) "_chunk_" for the field name. e.g. "products_chunk_".
- When inserting or specifying chunk vectors in a document's chunks use... | |
<gh_stars>0
from .utils import *
class Filter(object):####TODO add logging
def __init__(self, measure, cutting_rule):
"""
Basic univariate filter class with chosen(even custom) measure and cutting rule
:param measure:
Examples
--------
>>> f=Filter("PearsonCorr", GLOB_CR["K best"](6))
"""
inter_class = 0.0... | |
design on sample whether fit_weight is same with measure_weight or not.For example,for reducing effect from large class sample,it`s a good way to improve weights of small class sample when trainning model but the weight between large class sample and small class sample returns back to original weight value when measuri... | |
<reponame>mariakesa/UdacityMachineLearningEngineerNanoDegree
"""
This work modifies code from the pl_bolts library.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions... | |
{
"city": "Chesterfield",
"growth_from_2000_to_2013": "1.9%",
"latitude": 38.6631083,
"longitude": -90.5770675,
"population": "47749",
"rank": "782",
"state": "Missouri",
},
{
"city": "Leesburg",
"growth_from_2000_to_2013": "66.0%",
"latitude": 39.1156615,
"longitude": -77.56360149999999,
"population": "4... | |
import requests
from requests.utils import quote
import re
import json
from articledownloader import scrapers
from autologging import logged, traced
from csv import reader
from time import sleep
@logged
class ArticleDownloader:
def __init__(self, els_api_key=None, sleep_sec=1, timeout_sec=30):
'''
Initialize and s... | |
'folder_index':
newIndexItem = menu.Append(wx.ID_ANY, "Create new index")
self.Bind(wx.EVT_MENU, lambda e: self.onNewIndex(e, dataSourceTreeNode=dataSourceTreeNode, node=item), newIndexItem)
elif dataSourceTreeNode.nodeType in ('folder_column', 'table'):
newColumnItem = menu.Append(wx.ID_ANY, "Add new column")
... | |
"""
Copyright (c) 2022 ZOOMi Technologies Inc.
all rights reserved.
This source code is licensed under the license found in the
LICENSE file in the root directory of this source tree.
maintainers : <EMAIL>, <EMAIL>
This file contain image to video converter.
"""
import os
import cv2
from PIL import Image
import ... | |
321.089, 6035.833, 0.000, 9761.111],
[348.015, 417.919, 0.000, 0.000, 555.556, 0.000, 321.089, 2165.905, 0.000, 9674.821],
[348.015, 417.919, 0.000, 0.000, 555.556, 0.000, 321.089, 2165.905, 0.000, 9712.587],
[348.015, 417.919, 0.000, 0.000, 154.388, 0.000, 321.089, 3762.551, 0.000, 9910.724],
[348.015, 417.919, 0.... | |
#!/usr/bin/env python
import ConfigParser
import sys, getopt, os
import numpy as np
import Nio
import time
import re
import json
import random
import asaptools.simplecomm as simplecomm
import fnmatch
import glob
#
# Parse header file of a netcdf to get the varaible 3d/2d/1d list
#
def parse_header_file(filename):
com... | |
k - 1) * (m + 1) / n)
)
/ (r ** 2 + 2 * r * s * x * cos(Pi * (2 * k - 1) / n) + s ** 2 * x ** 2),
x,
)
return Simp(
2
* (-1) ** (m / 2)
* r ** (m + 2)
* s ** (-m)
* Int(1 / (r ** 2 + s ** 2 * x ** 2), x)
/ (a * n)
+ Dist(
2 * r ** (m + 1) * s ** (-m) / (a * n),
Sum_doit(u, List(k, 1, n / 4 - 1 / 2)),
x,
... | |
<reponame>DerekRein/.nuke
INPUTS = HIDDEN_INPUTS = None
GUI = True
DISABLED = 0x00000080 # DISABLED Set by disable(), cleared by enable().
NO_ANIMATION = 0x00000100 # NO_ANIMATION Prevent the value from being animated. This removes any anymation or view buttons, and it stops tcl expressions from being evaluated in stri... | |
<reponame>shunchaowang/dbmi-annotator<filename>translation/mp-evidence-base-ETL/deprecated/mpEvidenceLoad.py<gh_stars>1-10
# Copyright 2016-2017 University of Pittsburgh
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""
X-Check Validation Filtering Module for Sparky
@author: <NAME>
"""
import sys
if sys.version_info[0] == 2:
import Tkinter as tk
import tkMessageBox
import tkFont
else:
import tkinter as tk
import tkinter.messagebox as tkMessageBox
import... | |
FigureCanvasTkAgg(fig, master=frame_Method_Plot)
toolbar1 = NavigationToolbar2Tk(canvas1, frame_Method_Plot)
Plot_Graph(X_time, Y_disp, ax1, canvas1)
#-------------------------------------------------------------------------------------------------------------------------
# Functions to start or stop the measuremen... | |
<reponame>Kortemme-Lab/covariation<filename>analysis/utils/pdb.py<gh_stars>1-10
#!/usr/bin/env python2
# encoding: utf-8
# The MIT License (MIT)
#
# Copyright (c) 2015 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Sof... | |
<filename>ichnaea/scripts/datamap.py
#!/usr/bin/env python3
"""
Generate datamap image tiles and upload them to Amazon S3.
The process is:
1. Export data from datamap tables to CSV.
The data is exported as pairs of latitude and longitude,
converted into 0 to 6 pairs randomly around that point.
2. Convert the data i... | |
<filename>JSONWireProtocol/skeletonAppiumRealGirishRout.py
####################################################################
# Skeleton for Appium tests on Sauce Labs RDC
####################################################################
###################################################################
# Impor... | |
add on the object
:type collaborator: get_user_model()
:param role: the role of the collaborator on the object
:type role: CollaboratorRole
:return: the newly created collaborator instance
:rtype: ObjectCollaboratorMixin
"""
user_is_collaborator = collaborator in self.collaborators.all()
user_is_author = colla... | |
<reponame>vmray/vmray-misp-feed<gh_stars>1-10
import base64
import json
import re
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from pathlib import PureWindowsPath
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
from pymisp import MISPAttribute, MISPEvent, MISPObjec... | |
import matplotlib
matplotlib.use("Agg")
from itertools import combinations
from collections import defaultdict
from enum import Enum
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial.ckdtree import cKDTree as KDTree
from scipy.optimize import shgo
from sklearn.covariance import MinCovDet
import g... | |
#!/usr/bin/python3
#-----------------------------------------------------------------------------
# IoT Communication Monitoring Tools ( IoTCMT ) Create 2021.06
# for Raspberry Pi
# このツールは、Raspberry Pi でWi-Fi接続を行う場合にネットワークの通信状態を
# 監視し、状態変化があった場合に通知と修復処理を行うプログラムです。
# ツールの動作設定は、IoTCNTconfig.json(json形式)にて定義できます。 ... | |
import os
import posixpath
from enum import Enum
from pystac.errors import RequiredPropertyMissing
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, cast
from urllib.parse import urljoin, urlparse, urlunparse, ParseResult as URLParseResult
from datetime import datetime, timezone
import dateutil.pa... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: <NAME>
# Date: 2021/1/31 9:47 PM
"""
Lightweight class to record training and dataset file info for later retrieval.
Experiment ID is generated from the exp_ID_config.csv file; 1 if file not exist.
Also includes data FalsePositiveCategorizer class for categorizin... | |
SequenceSet: ' + str(e))
header_id = input_many_sequenceSet['sequences'][0]['sequence_id']
target_fasta_file_path = os.path.join(self.scratch, header_id+'.fasta')
target_fasta_file_handle = open(target_fasta_file_path, 'w')
self.log(console, 'writing reads file: '+str(target_fasta_file_path))
for seq_obj in inpu... | |
"""
Original Author: SilentSpike (https://github.com/SilentSpike)
Modified: Dorbedo for TFAR
The functions searches all functions headers and creates an documentation for public functions
Supported header sections:
- Name (the function name)
- Author(s) (with description below)
- Arguments
- Return Value
- Examp... | |
case for kill-to-end-of-line after last visible char"""
before_b = """\
line 1
# The next line contains two trailing blanks.
line 3
line 4
"""
after_b = """\
line 1
# The next line contains two trailing blanks.
line 3line 4
"""
self.run_test(
before_b=before_b,
after_b=after_b,
before_sel=("3.6", "3.6")... | |
- sublist[j + 1])
if difference_of_ele > 1:
num_of_splits = num_of_splits + 1
pos_to_split = []
# Find the position where the split should take place
for k, n in enumerate(ele_diff):
if n > 1:
pos_to_split.append(k)
# Split the sublist into further subist based on different identified position bound... | |
# -*- encoding: utf-8 -*-
__version__ = "0.9"
__author__ = "fcFn"
from tkinter.constants import N,E,W,S
from tkinter import messagebox
from tkinter import ttk
import tkinter
class App:
def __init__(self, name):
self.MESSAGES = ['Duplicate item!', 'Enter item name', 'No name provided!']
self.projectname = ''
... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Define basic states
This includes notably the fixed, functional, and counter states.
"""
import numpy as np
from pyrobolearn.states.state import State
from pyrobolearn.actions import Action
__author__ = "<NAME>"
__copyright__ = "Copyright 2018, PyRobo... | |
business_workspace = workspace_api.get_one(1)
tool_folder = content_api.get_one(1, content_type=content_type_list.Any_SLUG)
test_file = content_api.create(
content_type_slug=content_type_list.File.slug,
workspace=business_workspace,
parent=tool_folder,
label="Test file",
do_save=False,
do_notify=False,
)
with... | |
##
# @file NonLinearPlace.py
# @author <NAME>
# @date Jul 2018
# @brief Nonlinear placement engine to be called with parameters and placement database
#
import os
import sys
import time
import pickle
import numpy as np
import logging
logger = logging.getLogger(__name__)
import torch
import gzip
import copy
import matp... | |
<filename>detector.py
"""
detector
Copyright (c) 2020 <NAME>
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
"""
import os
import sys
import json
# import datetime # not really useful so remove soon pls
import numpy as np
import skimage.draw
from skimage.filters import unsharp_mask
import im... | |
<reponame>Unathi-Skosana/ptycho
"""
File: simulator.py
Author: <NAME>
Email: <EMAIL>
Github: https://github.com/<NAME>
Description:
"""
import numpy as np
from skimage.restoration import unwrap_phase
from skimage.exposure import rescale_intensity
from joblib import Parallel, delayed
from scipy.fft import fft2, ifft2... | |
"target_lane": 1,
"distance_reward": -0.1,
"distance_merged_vehicle_reward": 0,
"distance_reward_type": "min",
"successful_merging_reward": 5,
"continuous_mission_reward": True,
"cooperative_flag": True,
"sympathy_flag": True,
"cooperative_reward": 0.9,
# True : after merging will keep receiving the reward, Fa... | |
elif term['QCODE'] == '1': newQuery = (formtype.form_set.all().filter(ref_to_parent_form__record_reference__form_name__icontains=term['TVAL'], ref_to_parent_form__record_reference_type__pk=rtypePK))#ICONTAINS
elif term['QCODE'] == '2': newQuery = (formtype.form_set.all().filter(ref_to_parent_form__record_reference_... | |
in games.iteritems():
if game[0] != 'R':
round = 'play in'
continue
else:
round = game[0:2]
selected_winner = info['selected_0'] if ranking[info['selected_0']] < ranking[info['selected_1']] else info['selected_1']
if info['winner'] == selected_winner:
p = points[round]
else:
p = 0
score += p
possible += po... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*
# Copyright: [CUP] - See LICENSE for details.
# Authors: <NAME> (@mythmgn),
"""
:description:
Object related storage
"""
import os
import sys
import abc
import shutil
import ftplib
import logging
from cup import log
from cup import err
__all__ = [
'AFSObjectSystem', 'S... | |
until you delete them. '
'You can delete functions from memory by selecting it in the jumps window and '
'pressing the delete key. '
'Adding a comment to the very top of the function (or the jump to the function) using the comments text box will '
'cause it to become labeled as such within the jumps window. '
... | |
0.00000000004 * math.cos(4.09092913231 + 103498.66000202828 * self.t)
Y1 += 0.00000000005 * math.cos(0.06895267430 + 52396.4627430707 * self.t)
Y1 += 0.00000000004 * math.cos(2.56354623790 + 104505.63519426509 * self.t)
Y1 += 0.00000000005 * math.cos(5.58769879303 + 23754.46293121869 * self.t)
Y1 += 0.00000000005 *... | |
<reponame>cafealternativo/cpython
import winrt, struct, binascii
ELEMENT_TYPE_VOID = 1
ELEMENT_TYPE_BOOLEAN = 2
ELEMENT_TYPE_CHAR = 3
ELEMENT_TYPE_I1 = 4
ELEMENT_TYPE_U1 = 5
ELEMENT_TYPE_I2 = 6
ELEMENT_TYPE_U2 = 7
ELEMENT_TYPE_I4 = 8
ELEMENT_TYPE_U4 = 9
ELEMENT_TYPE_I8 = 0xa
ELEMENT_TYPE_U8 = 0xb
ELEMENT_TYPE_R4 = 0xc... | |
merging
return_expr(ctx)
hdr.valid = z3.If(index == 0, hdr.valid, prev_valid)
return_expr = lval.locals["0"]
for hdr_idx in range(1, max_idx):
cond = index == hdr_idx
hdr = lval.locals[str(hdr_idx)]
# preserve the valid value before the method call
prev_valid = hdr.valid
# get the method
caller = hdr.locals[t... | |
#!/usr/bin/env python3
import time
from tkinter import *
from PIL import ImageTk, Image
import csv
from subprocess import Popen
import RPi.GPIO as GPIO
from subprocess import call
from datetime import datetime
from crontab import CronTab
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(22, GPIO... | |
<reponame>QuESt-Calculator/pyscf
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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.o... | |
pft.public = getattr(lang, 'public', None)
pft.meta_title = getattr(lang, 'meta_title', None)
pft.meta_description = getattr(lang, 'meta_description', None)
pft.meta_keywords = getattr(lang, 'meta_keywords', None)
pft.tags = getattr(lang, 'tags', None)
pft.save()
except IntegrityError as e:
raise IntegrityError(... | |
def test_put_gpu_resources_search_resources_11(self, args):
if self.get_mode(args) == 'CPU':
pytest.skip('this API do not support CPU version')
if self.get_mode(args) == 'CPU':
pytest.skip('this API do not support CPU version')
base_url = 'http://%s:%s/' % (args['ip'], args['port'])
res = requests.get(base_url ... | |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
from argparse import Action, ArgumentTypeError, Namespace, _ActionsContainer
from pex import pex_warnings
from pex.argparse import HandleBoolAction... | |
<gh_stars>0
#!/usr/bin/python3
# Copyright 2022. FastyBird s.r.o.
#
# 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 applic... | |
= local_analyses(E, HMM.Obs(E, t), HMM.Obs.noise.C, yy[ko],
batch, taper, pool.map, self.xN, self.g)
self.stats.write(stats, k, ko, "a")
E = post_process(E, self.infl, self.rot)
self.stats.assess(k, ko, E=E)
def effective_N(YR, dyR, xN, g):
"""Effective ensemble size N.
As measured by the finite-size EnKF-N
... | |
#!/usr/bin/env python
# Copyright (c) 2011-2013 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.