input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
mx :
logger.error ("Both ``low'' and ``high'' (%s/%s) are greater ``max''/%s" % ( value , self.high.value , mx ) )
self.__low.setVal ( value )
models.append ( Argus_pdf )
# =============================================================================
## @class TwoExpos_pdf
# simple difference of two exponents
... | |
the pixel center intersects with the
bounding box or any of the polygons (as defined in the Simple Features standard by the OGC). The GeoJSON
can be one of the following GeoJSON types: * A `Polygon` geometry, * a `GeometryCollection` containing
Polygons, * a `Feature` with a `Polygon` geometry or * a `FeatureCollect... | |
"""Implements SeismicBatch class for processing a small subset of seismic gathers"""
from string import Formatter
from functools import partial
import numpy as np
import matplotlib.pyplot as plt
from .gather import Gather
from .cropped_gather import CroppedGather
from .semblance import Semblance, ResidualSemblance
f... | |
# -*- coding: utf-8 -*-
"""
Created on Thur June 18, 2015
Last modified: April, 2016
@author: pauliuk
"""
"""
# Script MaTrace_Global_Main.py
# Standalone script for global multiregional version of MaTrace model (Nakamura et al. 2014)
# Import required libraries:
#%%
"""
# import os
import loggin... | |
}''' % locals())
makeCountsTable(so)
if tpm:
makeTPMTable = r('''
function(so){
library('reshape')
df = cast(so$obs_raw, target_id~sample, value = "tpm")
colnames(df)[1] <- "transcript_id"
write.table(df, "%(tpm)s", sep="\t", row.names=F, quote=F)
}''' % locals())
makeTPMTable(so)
if dummy_run:
retu... | |
"""Class for generating pronunciations from G2P models"""
from __future__ import annotations
import csv
import functools
import multiprocessing as mp
import os
import queue
import statistics
import time
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, Union
import tqdm
from montreal_forced_aligner... | |
& Kauffeld's proposed network representation of a conversation) network of the conversation.
Ref: Sauer & Kauffeld (2013)
"""
data = data[data['pID'].isin(pIDs)]
#data.sort_values(by = 'begin', inplace = True, ignore_index = True)
interruptions = interruptive_simultaneous_speech(data, pIDs)
interjections = non_... | |
Return the storage data path
@return: storage path
@rtype: string
"""
pathData = TestSettings.get('Paths', 'tmp')
# remove slash in testcase name, fix issue #7
tc = self.getTestname()
tc = tc.replace('/', '')
tc = tc.replace('\\', '')
# end of fix
tmp_path = "%s/TC-%s-#%s/" % (pathData, tc, self.__id)
if ... | |
"""Functions related to reading and writing data."""
import logging
import io
# import argparse
from collections import Counter
from pathlib import Path
from sys import path as sys_path
import requests
from . import psize
from . import inputgen
from . import cif
from . import pdb
from . import definitions as defns
fro... | |
#Imporations de divers modules
from urllib import request
import urllib.request
from operator import itemgetter
import matplotlib.pyplot as plt
import numpy as np
import os
#Paramètres du graphique
limite_date_debut = "2020-12-29" #Indique la première date des données (0 pour conserver la liste)
limite_date_fin = "20... | |
it
i = -1
while (abs(i) <= len(crawl_hists[w]) and crawl_hists[w][i] > curr_time + horizon):
i -= 1
if (abs(i) > len(crawl_hists[w]) or crawl_hists[w][i] <= curr_time):
# No crawls happened during time interval [curr_time, curr_time + horizon], so no new observations
continue;
i_last_crawl_in_interval = i
#... | |
<filename>fitting/external_functions.py<gh_stars>0
# coding: utf-8
# Author: <NAME>, NBI, 2018
import numpy as np
def plot_hist_of_exp_data(tau=1 / np.e):
# General input:
Nbins = 100
xmin, xmax = 0, 10
binwidth = (xmax - xmin) / Nbins
Nbkg = 5000 # Number of random Exponential points
x_bkg = r.exponential(t... | |
# Copyright (c) 2020, Build-A-Cell. All rights reserved.
# See LICENSE file in the project root directory for details.
import copy
from typing import List, Union
from warnings import resetwarnings, warn
from .chemical_reaction_network import ChemicalReactionNetwork
from .component import Component
from .global_mecha... | |
<gh_stars>1-10
from __future__ import division
import re
import datetime
from decimal import Decimal
from django.utils import six
STRFDATETIME = re.compile('([dgGhHis])')
STRFDATETIME_REPL = lambda x: '%%(%s)s' % x.group()
def nice_repr(timedelta, display="long", sep=", "):
"""
Turns a datetime.timedelta object i... | |
<= 0)
m.c1144 = Constraint(expr= m.x832 - 9*m.b1018 <= 0)
m.c1145 = Constraint(expr= m.x833 + 9*m.b1016 <= 9)
m.c1146 = Constraint(expr= m.x834 + 9*m.b1017 <= 9)
m.c1147 = Constraint(expr= m.x835 + 9*m.b1018 <= 9)
m.c1148 = Constraint(expr= m.x884 - 9*m.b1016 <= 0)
m.c1149 = Constraint(expr= m.x885 - 9*m.b1017 <=... | |
TileGroup must be "Land" or "Static"')
group = _tile_groups[TileGroup]
return _get_tile_flags(group, Tile)
_uint_to_flags = _ScriptMethod(350) # ConvertIntegerToFlags
_uint_to_flags.restype = _str
_uint_to_flags.argtypes = [_ubyte, # Group
_uint] # Flags
def ConvertIntegerToFlags(Group, Flags):
if Group not in ... | |
<filename>mindhome_alpha/erpnext/setup/setup_wizard/operations/install_fixtures.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, os, json
from frappe import _
from frappe.desk.page.... | |
<filename>src/oci/oda/models/work_request.py
# 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://ww... | |
attribute
# noinspection PyUnresolvedReferences
cf = importlib.util.module_from_spec(spec)
spec.loader.exec_module(cf) # type: ignore
compact_mbias_plot_config_dict = getattr(cf, config_dict_name)
mbias_plot_configs = get_plot_configs(compact_mbias_plot_config_dict,
dataset_name_to_fp=dataset_name_to_fp)
aggre... | |
<filename>tools/binary_size/run_binary_size_analysis.py
#!/usr/bin/python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generate a spatial analysis against an arbitrary library.
To use, build the 'bi... | |
',' + value
else:
r_headers[key] = value
#handle any http redirect... recursive call here...
if ("location" in r_headers.keys()) and (r_headers['location'] != resource_uri and r_response.status>= 300 and r_response.status < 400):
redirected_resource_uri = urlparse(r_headers['location'])
return(http__req_common(... | |
<gh_stars>0
# Copyright (c) 2016 Cisco Systems 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 b... | |
from datetime import datetime, timezone
import re
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button, Div, Field, Layout, Submit
from django import forms
from django.contrib.auth.models import Permission
from django.contrib.sites.models import Site
from django.core.exceptions impor... | |
psi=None
):
# Docstring
"""
Plastic design resistance of a plate.
Calculates the resistance of a plate according to EN1993-1-1 and
EN1993-1-5. The plate is assumed simply supported.
Parameters
----------
thickness : float
[mm] Plate thickness
width : float
[mm] Plate width
f_yield : float
[MPa] Yield str... | |
from datetime import datetime
from flask import Flask, render_template, request, session
from flask_session import Session
from riotwatcher import LolWatcher, ApiError
from unicodedata import normalize
import flask_app
import json
import pandas as pd
def add_mastery_chest(champion_mastery_list, champion_mastery):
fo... | |
"""
Designed to be used via portable-python CLI.
Can be used programmatically too, example usage:
from portable_python import BuildSetup
setup = BuildSetup("cpython:3.9.6")
setup.compile()
"""
import contextlib
import enum
import logging
import multiprocessing
import os
import re
from typing import List
import r... | |
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
"""Wrapper class for making detection_metrics easier to interpret."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import OrderedDict
import functools
import logging
i... | |
ENABLE_MULTIPROCESSING = True
from dsl import cpp_trace_param_automata
def generate_public_submission():
import numpy as np
import pandas as pd
import os
import json
from pathlib import Path
import matplotlib.pyplot as plt
from matplotlib import colors
import numpy as np
from xgboost import XGBClassifier
... | |
<filename>mne_bids/write.py<gh_stars>0
"""Make BIDS compatible directory structures and infer meta data from MNE."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os
import os.path as op
from datetime import ... | |
#!/usr/bin/python3
# coding=utf-8
# -------------------------------------------------------------------------------
# This file is part of Phobos, a Blender Add-On to edit robot models.
# Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center
#
# You should have received a copy of the 3-Clause ... | |
from __future__ import unicode_literals
from __future__ import absolute_import
import copy
import datetime
import json
import time
import django
from django.test import TestCase, TransactionTestCase
from django.utils.timezone import utc, now
from mock import patch
from rest_framework import status
import batch.test.... | |
<filename>PLP_Output/Embalses.py
class Embalses():
def __init__(self):
return
def cota(self,nombre,Volumen):
if nombre=='HID.Guaiquivilo' or nombre=='GUAIQUIVILO':
a0 = 1112.76569214446
a1 = 0.204122891451908
a2 = -2.08202656471027E-04
a3 = 1.0379630226835E-07
cota = a0 + (a1 * Volumen) + (a2 * Volumen ** 2)... | |
<gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. impo... | |
notifications.
"""
# Invite
group = yield self.addressbookObjectUnderTest(home="user01", addressbook_name="addressbook", name="group1.vcf")
invites = yield group.sharingInvites()
self.assertEqual(len(invites), 0)
self.assertFalse(group.isSharedByOwner())
shareeView = yield group.inviteUIDToShare("user02", _BIN... | |
#!/usr/local/bin/python3.4
"""
## Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO [, ANY ADDITIONAL AFFILIATION]
## 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
##
## ... | |
<reponame>gabriel-cr/discord.py
import asyncio
import enum
import logging
import concurrent.futures
logger = logging.getLogger("cloudbot")
@enum.unique
class EventType(enum.Enum):
message = 0
action = 1
# TODO: Do we actually want to have a 'notice' event type? Should the NOTICE command be a 'message' type?
noti... | |
"salty",
"salubrious",
"salutary",
"salutation",
"salutatorian",
"salutatory",
"salute",
"salvage",
"salvageable",
"salvation",
"salve",
"salver",
"salvo",
"samarium",
"samba",
"sameness",
"samovar",
"sampan",
"sample",
"sampler",
"samurai",
"sanatoria",
"sanatorium",
"sanctification",
"sanctify... | |
<gh_stars>0
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------... | |
import os, re, time, shutil, inspect, magic
from tarfile import TarFile
from PIL import Image
from elfinder.exceptions import ElfinderErrorMessages, NotAnImageError
from elfinder.utils.archivers import ZipFileArchiver
from base import ElfinderVolumeDriver
class ElfinderVolumeLocalFileSystem(ElfinderVolumeDriver):
"""... | |
# coding: utf-8
import matplotlib.pyplot as plt
import numpy as np
from .operation import *
from .data import *
from .plot import *
from .theory import *
def hamiltonian_tomography_exp(directory, file_name, file_list, init_list, include_individual=False, save=False):
# print('0')
label = ["II", "IX", "IY", "IZ", "X... | |
DN_Moments(y[getWindow(i)],4)
elif windowStat == 'mom5':
for i in range(numSteps):
qs[i] = DN_Moments(y[getWindow(i)],5)
elif windowStat == 'AC1':
for i in range(numSteps):
qs[i] = CO_AutoCorr(y[getWindow(i)],1,'Fourier')
if acrossWinStat == 'std':
out = np.std(qs) / np.std(y)
elif acrossWinStat == '... | |
zero-one loss
is a smooth but non-convex approximation of zero-one loss. The preference
probability of each pair is computed as the sigmoid function: P(l_i > l_j) = 1
/ (1 + exp(s_j - s_i)). Then 1 - P(l_i > l_j) is directly used as the loss.
So a correctly ordered pair has a loss close to 0, while an incorrectly
... | |
<reponame>rochisha0/addons-server<gh_stars>0
# -*- coding: utf-8 -*-
# Django settings for addons-server project.
import environ
import json
import logging
import os
import socket
from datetime import datetime
import sentry_sdk
from kombu import Queue
from sentry_sdk.integrations.celery import CeleryIntegration
from... | |
# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | |
"""html2text: Turn HTML into equivalent Markdown-structured text."""
import html.entities
import html.parser
import re
import urllib.parse as urlparse
from textwrap import wrap
from typing import Dict, List, Optional, Tuple, Union
from . import config
from .elements import AnchorElement, ListElement
from .typing impo... | |
<reponame>inkyusa/Open3D-ML<filename>ml3d/tf/models/kpconv.py
import time
import sys
import tensorflow as tf
import numpy as np
import random
from os.path import exists, join, isfile, dirname, abspath, split
from os import makedirs
from pathlib import Path
from sklearn.neighbors import KDTree
from tqdm import tqdm
# ... | |
#
#
# LICENSE_MAP = {}
# LICENSE_MAP["SPDX:Apache-2.0"] = ["Apache","public_domain"]
# LICENSE_MAP["SPDX:BSD-1-Clause"] = ["BSDlike", "BSD-like"]
# LICENSE_MAP["SPDX:BSD-3-Clause"] = ["BSD-3-clause", "BSD-3-Clause", "three-clause BSD license", "BSD-3-Clause"]
# LICENSE_MAP["SPDX:LGPL-3.0-only"]=["LGPL-3.0-only"]
# LICE... | |
Dict[str, torch.Tensor],
strict: bool,
missing_keys: List[str],
unexpected_keys: List[str],
error_msgs: List[str],
):
self._load_from_state_dict(
state_dict,
prefix,
local_metadata,
strict,
missing_keys,
unexpected_keys,
error_msgs,
)
@torch.jit.export
def reset_min_max_vals(self):
"""Resets the min/... | |
<gh_stars>1-10
from abc import ABC, abstractmethod
import requests
import datetime
import dateutil
import json
import aiohttp
import asyncio
import logging
import random
import pandas as pd
from queue import Queue
import pytz
import numpy as np
from serial.serialutil import SerialException
from tools.factory_tools im... | |
(vat[0],vat[1]) for vat in found_vat])
attr_msg = " and attributes: %s" % vat_list if vat_list else ""
print("** NWB files exactly match ** (only %s%s differ)" % (
vds_list, attr_msg))
#
# elif num_val_match_attributes == num_paired_attributes:
# if num_matching_attributes == num_paired_attributes:
# attr_msg = ... | |
m.b148 - m.b153 + m.b169 <= 1)
m.c1490 = Constraint(expr= m.b148 - m.b154 + m.b170 <= 1)
m.c1491 = Constraint(expr= m.b148 - m.b155 + m.b171 <= 1)
m.c1492 = Constraint(expr= m.b148 - m.b156 + m.b172 <= 1)
m.c1493 = Constraint(expr= m.b148 - m.b157 + m.b173 <= 1)
m.c1494 = Constraint(expr= m.b148 - m.b158 + m.b174 ... | |
int i, unsigned char sendmsg)")
del_items(0x80051FA4)
SetType(0x80051FA4, "void OperateMushPatch__Fii(int pnum, int i)")
del_items(0x80052168)
SetType(0x80052168, "void OperateInnSignChest__Fii(int pnum, int i)")
del_items(0x80052300)
SetType(0x80052300, "void OperateSlainHero__FiiUc(int pnum, int i, unsigned char send... | |
if description is not None:
pulumi.set(__self__, "description", description)
if enable_end_time is not None:
pulumi.set(__self__, "enable_end_time", enable_end_time)
if enable_start_time is not None:
pulumi.set(__self__, "enable_start_time", enable_start_time)
if group_id is not None:
pulumi.set(__self__, "group... | |
## Create and compare lists of files/objects
## Author: <NAME> <<EMAIL>>
## http://www.logix.cz/michal
## License: GPL Version 2
from S3 import S3
from Config import Config
from S3Uri import S3Uri
from SortedDict import SortedDict
from Utils import *
from Exceptions import ParameterError
from logging import debug, in... | |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
class conv2DBatchNorm(nn.Module):
def __init__(
self,
in_channels,
n_filters,
k_size,
stride,
padding,
bias=True,
dilation=1,
with_bn=True,
):
super(conv2DBatchNorm, self).__init__()
... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
idi.py
======
Abstract classes for python Header-Data unit object. This is similar
to the HDU in FITS. Each HDU has a header dictionary and a data
dictionary. The data dictionary can be converted into a pandas
DataFrame object, and there are a few view / verify items also.
... | |
<reponame>thesteau/Portfolio-Janggi<filename>reference/tests.py
import unittest
from game_files.game import JanggiGame
#from JanggiGame import JanggiGame
class TestJanggiGame(unittest.TestCase):
def setUp(self):
self.unfinished = 'UNFINISHED'
self.red_won = 'RED_WON'
self.blue_won = 'BLUE_WON'
self.invalid_move =... | |
# -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20150605175037.1: * @file leoCheck.py
#@@first
'''Experimental code checking for Leo.'''
# To do:
# - Option to ignore defs without args if all calls have no args.
# * explain typical entries
import imp
import leo.core.leoGlobals as g
import leo.core.leoAst as leoAs... | |
#Dictionaries to store hurricane names
#2019
h_2019 = { "Andrea" : ["al01", "Atlantic"],
"Barry" : ["al02", "Atlantic"],
"Three" : ["al03", "Atlantic"],
"Chantal" : ["al04", "Atlantic"],
"Dorian" : ["al05", "Atlantic"],
"Erin" : ["al06", "Atlantic"],
"Fernand" : ["al07", "Atlantic"],
"Gabrielle" : ["al08", "Atl... | |
#-----------------------------------------------------------------------
#
global LOAD_MODULES_RUN_TASK_FP
LOAD_MODULES_RUN_TASK_FP = os.path.join(USHDIR, "load_modules_run_task.sh")
#
#-----------------------------------------------------------------------
#
# Define the various work subdirectories under the ma... | |
<gh_stars>1-10
from enum import Enum
from display import embeds, views
from .classes import Message, ContextWrapper
class AllStrings(Enum):
""" List of different message strings available
"""
REG_NOT_REGISTERED = Message("You are not registered!", embed=embeds.register_help)
REG_STATUS = Message(None, embed=embe... | |
== b:
pass
else:
return False
return True
def _preprocess_inputs(self, time, target=None, grid_times_targets=False):
"""
Preprocess time and target inputs
This routine takes the inputs for time and target and attempts to
return a single `~astropy.time.Time` and `~astropy.coordinates.SkyCoord`
for each argum... | |
is dict:
lids = sorted(dsig.keys())
else:
if type(ids) not in [str,list]:
msg = "If dsig not provided => provide an ids to load Plasma2D!\n"
msg += " => Available ids for Plasma2D include:\n"
msg += " ['equilibrium',\n"
msg += " 'core_profiles', 'core_sources'\n,"
msg += " 'edge_profiles', edge_sources]"
raise... | |
(машинисты)": 1.94 нормо-часа
'_-Работа строительной бригады (нормо-часов)':90,
'Доски обрезные хвойные 25x100x6000 мм (кубометр)':2.5,
'Бруски обрезные хвойные 50x100x6000 мм (кубометр)':0.14,
'Гвозди строительные (килограмм)':3.25,
'Поковки из квадратных заготовок 1.8 кг (килограмм)':26,
'Паста антисептическая ... | |
"CALLABLE_AUTOSOMAL_FRACTION", "type": "double"}, {"name":
"NONSYNONYMOUSDEL", "type": "double"}, {"name": "FRAMESHIFTSNVS", "type": "double"}, {"name":
"SVSTATISTICSFLAG", "type": "string"}, {"name": "CNVCOUNT", "type": "double"}, {"name":
"NONSYNONYMOUSSNVS", "type": "double"}, {"name": "DELETIONCOUNT", "type": "doub... | |
aspect_ratio)
self.patch.height = (h0+dy)
elif abs(y0-h2-ypress)<bt*h0:
# resize from bottom of ellip
self.patch.height = h0-dy
if fixed_ar:
# bottom side grab with fixed_aspect
dx = dy*aspect_ratio
self.patch.width = (w0-dx)
elif abs(y0+h2-ypress)<bt*h0:
# resize from top of ellip
self.patch.height = (h... | |
= self.app.get("/tenders/{}/bids/{}?acc_token={}".format(tender_id, bid_id, bid_token))
self.assertEqual(
response.json["data"]["lotValues"][0]["participationUrl"],
"https://tender.auction.url/for_bid/{}".format(bid_id),
)
# posting auction results
self.app.authorization = ("Basic", ("auction", ""))
self.app.pos... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2020-2021 by SCICO Developers
# All rights reserved. BSD 3-clause License.
# This file is part of the SCICO package. Details of the copyright and
# user license can be found in the 'LICENSE' file distributed with the
# package.
"""Proximal Gradient Method classes."""
from __fut... | |
the routing network with our BasinMaker GIS toolbox
(for example by defining new lake area thresholds and/or a new catchment
minimum drainage area threshold)
river_without_merging_lakes.shp : shapefile
The GIS layer containing river polylines of an incomplete hydrologic
routing network. In this incomplete hydro... | |
is set.
@param f: Flag.
@return: True if set, False otherwise.
"""
pass
def setEnabled(self, enabled):
"""self.setEnabled(enabled) -> None.
Enable or disable the knob.
@param enabled: True to enable the knob, False to disable it."""
pass
def removeKeyAt(self):
"""Remove key at time 't' for channel 'c'. Re... | |
########################################################################
# Copyright 2021, UChicago Argonne, LLC
#
# Licensed under the BSD-3 License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a
# copy of the License at
#
# https://opensource.org/licenses/BSD-3-Cl... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Arduino lock-in amplifier
"""
__author__ = "<NAME>"
__authoremail__ = "<EMAIL>"
__url__ = "https://github.com/Dennis-van-Gils/DvG_Arduino_lock-in_amp"
__date__ = "31-08-2021"
__version__ = "2.0.0"
# pylint: disable=invalid-name
import os
import sys
import time as Time... | |
({0}),\n".format("{0}_{1}_pushbit".format(prefix_tx,llink['NAME'])))
if llink['HASREADY']:
if configuration['REPLICATED_STRUCT']:
file_name.write(" .{0:30} ({0}{1}),\n".format("{0}_{1}_credit".format(prefix_rx,llink['NAME']), gen_index_msb(4)))
else:
file_name.write(" .{0:30} ({0}{1}),\n".format("{0}_{1}_credit".f... | |
861, 141, 785, 332, 279, 918, 48, 43, 685, 240, 476,
677, 30, 653, 350, 500, 837, 871, 723, 277, 232, 913,
969, 363, 209, 806, 50, 395, 424, 294, 891, 116, 657,
310, 944, 42, 692, 284, 54, 246, 285, 65, 117, 765,
398, 255, 479, 280, 344, 738, 382, 798, 397, 621, 399,
383, 769, 991, 736, 304, 350, 108, 801, 746, 92... | |
is None and node.right is None:
leaf_nodes.append(node)
continue
else:
for child in [node.left, node.right]:
if child:
child.parent = node
to_process.append(child)
to_process = leaf_nodes
while to_process:
node = to_process.pop()
parent = node.parent
if parent is not None: # for root.
parent.cpath.append(... | |
"""
This program contains code adapted from: Lyre Midi Player (https://github.com/3096/genshin_scripts/blob/main/midi.py)
which is under the GNU General Public License.
Application.py:
Contains:
- the base application class
- file parsing code
- definition of commonly used variables & tkinter objects
... | |
> 1 else x.value
yv = y if order > 1 else y.value
z = Var(x.value * y.value)
x.children.append((yv, z))
y.children.append((xv, z))
return z
def sin(x, order=Var.order): # Var.order default is 1
'''
sin for Var objects only
'''
checkerr(isinstance(x, (Var, int, float, np.ndarray)), "Var sin function has to be... | |
'time'
var_list[1].name = 'vel3d_c_eastward_turbulent_velocity'
var_list[2].name = 'vel3d_c_northward_turbulent_velocity'
var_list[3].name = 'vel3d_c_upward_turbulent_velocity'
var_list[4].name = 'seawater_pressure_mbar'
var_list[0].data = np.array([])
var_list[1].data = np.array([])
var_list[2].data = np... | |
:Input:
- *num_ghost* - (int) Number of ghost cell layers
"""
index = np.indices(n+2*num_ghost+1 for n in self.num_cells)
nodes = []
for i,dim in enumerate(self.dimensions):
edge_array = dim.nodes_with_ghost(num_ghost)
nodes.append(edge_array[index[i,...]])
return nodes
def p_centers_with_ghost(self,num_ghost... | |
actuals_df.index = actuals_df.index.tz_localize(None)
###### fix "over" problem
# max actual power can not go above GenMWMax
# note that, it does not go "under" - WTK takes care of that
max_gen_capacity = self.wind_generators.set_index("GenUID")["GenMWMax"]
actuals_df = actuals_df[actuals_df < max_gen_capacity].f... | |
fout.write("#PBS -q %s\n" %self.run_params["queue"])
fout.write("\n")
fout.write("cd $PBS_O_WORKDIR\n")
fout.write("NP=`cat $PBS_NODEFILE | wc -l`\n")
#fout.write("mpirun -np $NP -machinefile $PBS_NODEFILE %s < %s > %s\n" % (cmd, inpname, output))
a = np.sqrt(self.arts.xyz.cell[0][0]**2+self.arts.xyz.cell[... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import struct
from pcc.compiler.assembler import Assembler, ProcessorRegister, ShiftMode
# http://ref.x86asm.net/coder64.html
# https://www.amd.com/system/files/TechDocs/24594.pdf
# page 74 for
# integer calling register order:
# rdi - rsi - rdx - rcx - r8 - r9 - rest ... | |
<filename>sdk/python/pulumi_azure_native/media/v20180330preview/outputs.py<gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing i... | |
#!/usr/bin/env python
import os
import sys
import re
import getopt
import subprocess
opt_name_resolution = False
data_dir = False
max_results = 50
ip_to_hostname_cache = {}
# global regex to compile
re_tcp = re.compile(r"^tcp")
re_ip_port = re.compile(r"^(.*)[\.:](.*?)$")
re_trim_ip = re.compile(r"^.*:")
def get_... | |
deepcopy(global_better)
def print_epoch(self, epoch, runtime):
"""
Print out the detailed information of training process
Args:
epoch (int): current iteration
runtime (float): the runtime for current iteration
"""
if self.verbose:
print(f"> Epoch: {epoch}, Current best: {self.history.list_current_best[-1][sel... | |
the complex leg')
_logger.info(f"setting up complex phase...")
self._setup_complex_phase(protein_pdb_filename,receptor_mol2_filename,mol_list)
self._complex_topology_old_solvated, self._complex_positions_old_solvated, self._complex_system_old_solvated = self._solvate_system(
self._complex_topology_old, self._comple... | |
1 bit
self.ttl = self._val_exp_s_ttl & 0x000000ff # time to live, 8 bits
self.data = b''
def pack_hdr(self):
self._val_exp_s_ttl = (
((self.val & 0xfffff) << 12) |
((self.exp & 7) << 9) |
((self.s & 1) << 8) |
((self.ttl & 0xff))
)
return dpkt.Packet.pack_hdr(self)
def as_tuple(self): # backward-compatible... | |
<reponame>hirnimeshrampuresoftware/python-tcod
"""Tileset and font related functions.
Tilesets can be loaded as a whole from tile-sheets or True-Type fonts, or they
can be put together from multiple tile images by loading them separately
using :any:`Tileset.set_tile`.
A major restriction with libtcod is that all tile... | |
<filename>numba/core/base.py<gh_stars>0
from collections import namedtuple, defaultdict
import copy
import os
import sys
from itertools import permutations, takewhile
from contextlib import contextmanager
import numpy as np
from llvmlite import ir as llvmir
import llvmlite.llvmpy.core as lc
from llvmlite.llvmpy.core ... | |
<reponame>fantamodeman/hielen2<gh_stars>0
#!/usr/bin/env python
# coding=utf-8
import hug
import tempfile
import falcon
import os
import time
import json
from hielen2 import db, conf
import hielen2.source as sourceman
from streaming_form_data import StreamingFormDataParser
from streaming_form_data.targets import FileTa... | |
[]
for pig in possible_pig_positions:
left = []
right = []
above = []
for block in complete_locations:
if block[1] < pig[0]:
if ((block[2] - (blocks[str(block[0])][1]/2.0)) < pig[1]) and ((block[2] + (blocks[str(block[0])][1]/2.0)) > pig[1]) :
left.append(block)
if block[1] > pig[0]:
if ((block[2] - (blocks... | |
the dataset originates from.
"""
if map_ is not None:
self.map = map_
if parent is not None:
self.set_parent(parent=parent)
elif map_ is not None:
self._parents = self.map.parents
if name is not None:
self.set_name(name=name)
elif map_ is not None:
self._name_ = self.map.name
if file is not None:
self.s... | |
import sys
# import fncs
import matlab.engine
from matlab import double as MATRIX
import csv
import numpy as np
import re
import random as rand
from random import gauss
from random import uniform
# import numpy as np
from math import sqrt
# for archiving cosim output - especially PFO output
import cosim_archiver as ... | |
from collections import OrderedDict
from contextlib import contextmanager
from functools import partial, wraps
import os
import signal
import subprocess
import sys
import types
from typing import Callable, Iterable, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union
import humanize
from more_itertools import fla... | |
if something breaks.
self._out(irc, msg, "ERROR fetching Google quote for: {0}".format(index))
intlindices = wrap(intlindices)
def indices(self, irc, msg, args):
"""
Displays the three major indices for the US Stock Market:
Dow Jones Industrial Average, NASDAQ, and S&P500
"""
indices = ['.DJI', '.IXIC', '.IN... | |
<gh_stars>1-10
import numpy as np
import joblib
from rv_helper_functions import get_RV_ref_spectrum, plot_rv_perorder_scatter, add_rv_to_metadata
from disentangle_spectra_functions import plot_combined_spectrum_using_RV, show_spectra_heliocentric, run_complete_RV_and_template_discovery_procedure, get_spectral_data, cr... | |
target.FindFirstType('PyFrameObject')
internal_frame_type = target.FindFirstType('_frame')
frame_type = (public_frame_type
if public_frame_type.members
else internal_frame_type)
found_frames = []
for register in general_purpose_registers(frame):
sbvalue = frame.register[register]
# ignore unavailable register... | |
import sys
import numpy as np
import h5py
import matplotlib.pyplot as plt
question = sys.argv[1]
def berkan_ozdamar_21602353_hw2(question):
if question == '1':
import numpy as np
import h5py
import matplotlib.pyplot as plt
# Part A
f = h5py.File('assign2_data1.h5', 'r')
dataKeys = list(f.keys())
print('Th... | |
"""Base class copy from sklearn.base."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
import time
import numbers
from ..parallel import parallel_func
from ..fixes import BaseEstimator
from ..utils import check_version, logger, warn
... | |
import argparse
import json
import re
import sys
import xml.etree.ElementTree as ET
from datetime import datetime, timedelta
from io import BytesIO
tcx_time_format = '%Y-%m-%dT%H:%M:%S.%fZ'
def get_elems_of_name(tree, name):
'''
Recursively find Elements of the given ElementTree or Element
whose tag contains the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.