input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Functionality to build extensible variable spaces into ReFrame tests.
#
import math
import copy
import reframe.core.fiel... | |
<reponame>ZiUNO/LegalJudgment
# coding=utf-8
# Copyright 2019 HuggingFace 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 requir... | |
<filename>UI/EMGGeming.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'emg.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt... | |
<reponame>HyperSuprime-Cam/fgcm
from __future__ import division, absolute_import, print_function
from builtins import range
import numpy as np
import os
import sys
import esutil
import time
import scipy.optimize
import matplotlib.pyplot as plt
from .fgcmUtilities import gaussFunction
from .fgcmUtilities import hist... | |
(20, 256)
stat_values = loaddata.non_legendary_fighting_types['hp']
stat_stats = loaddata.non_legendary_fighting_types['hp'].describe()
unit = ''
elif stat_set == "3": # speed
stat_name = "Speed"
test_bounds = (20, 256)
stat_values = loaddata.non_legendary_fighting_types['speed']
stat_stats = loaddata.non_legen... | |
<filename>src/test.py
from torch.utils.data import DataLoader
import torch
import argparse
import time
from data import *
from model import *
from utils import *
from config import parse_config
from keras.utils import generic_utils
def retrieve_features_frcnn(feature_loader, config):
"""
retrieve features for meas... | |
<= 0)
m.c6431 = Constraint(expr= - m.b289 + m.b311 - m.b427 <= 0)
m.c6432 = Constraint(expr= - m.b289 + m.b313 - m.b428 <= 0)
m.c6433 = Constraint(expr= - m.b289 + m.b315 - m.b429 <= 0)
m.c6434 = Constraint(expr= - m.b289 + m.b317 - m.b430 <= 0)
m.c6435 = Constraint(expr= - m.b289 + m.b319 - m.b431 <= 0)
m.c6436 ... | |
<gh_stars>1-10
"""
A custom Keras layer to generate anchor boxes.
Copyright (C) 2018 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requ... | |
in zip(df[x_label], df[y_label], marker_shapes, marker_colors):
ax.scatter(_x, _y, marker=_s, c=_c, lw=0.25, s=marker_size)
# Fix the x and y axis limits
if np.isscalar(x_max) and np.isscalar(x_min):
ax.set_xlim((x_min, x_max))
if np.isscalar(y_max) and np.isscalar(y_min):
ax.set_ylim((y_min, y_max))
ax.tickla... | |
targets from target_funds', con).targets.to_list()
except DatabaseError:
target_funds = []
print('downloading new daily reports from the CVM website...\n')
# downloads the daily cvm repport for each month between the last update and today
for m in range(num_months+1):
data_alvo = last_quota + relativedelta(mon... | |
import argparse
import json
import os
import sys
from io import StringIO
import pytest
import yaml
from bootstrap.lib.options import Options
from bootstrap.lib.options import OptionsDict
from bootstrap.lib.utils import merge_dictionaries
def reset_options_instance():
Options._Options__instance = None
sys.argv = [... | |
import numpy as np
import re
import pandas as pd
import networkx as nx
from cloudvolume import CloudVolume, Skeleton
from io import StringIO
import os
from brainlit.utils.util import (
check_type,
check_size,
)
from sklearn.metrics import pairwise_distances_argmin_min
import warnings
class NeuronTrace:
"""Neuron T... | |
# _________________________________________________________________________
#
# PyUtilib: A Python utility library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the BSD License.
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certai... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
import os
import re
import sys
import glob
import codecs
import shutil
import signal
import zipfile
import tarfile
import itertools
import subproce... | |
import datetime
import re
from django import forms
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django_countries import Countries
from django_countries.fields import LazyTypedChoiceField
from django_countries.widgets import CountrySelectWidget
from crispy_forms.helper i... | |
import os
import time
import torch
import numpy as np
import torch.nn.functional as F
# from torch_geometric.nn import GCNConv, DataParallel, GATConv, SAGEConv
from torch.nn import Linear, Sequential, ReLU, BatchNorm1d as BN
from torch_geometric.nn import DataParallel, global_mean_pool
from torch_geometric.utils import... | |
#!/usr/bin/env python3
import os.path
from glob import glob
import sys
from illuminatus.RunInfoXMLParser import RunInfoXMLParser, instrument_types
class RunStatus:
"""This Class provides information about a sequencing run, given a run folder.
It will parse information from the following sources:
RunInfo.xml file -... | |
from typing import Dict, Any
from pyNastran.op2.op2_interface.random_results import (
RADCONS, RAECONS, RASCONS, RAPCONS, RAFCONS, RAGCONS, RANCONS,
RADEATC, RAEEATC, RASEATC, RAPEATC, RAFEATC, RAGEATC, RANEATC,
ROUGV1, RADEFFM, SRSS, ABS, NRL,
AutoCorrelationObjects, PowerSpectralDensityObjects, RootMeansSquareOb... | |
& set(cls.allowed_methods)
else:
self.allowed_methods = set(cls.allowed_methods)
return self.dispatch(request, *args, **kwargs)
view.csrf_exempt = cls.csrf_exempt
# take name and docstring from class
update_wrapper(view, cls, updated=())
# and possible attributes set by decorators
# like csrf_exempt from dis... | |
of splices: GC/AG | 0
Number of splices: AT/AC | 0
Number of splices: Non-canonical | 2
Mismatch rate per base, % | 2.14%
Deletion rate per base | 0.04%
Deletion average length | 1.00
Insertion rate per base | 0.00%
Insertion average length | 0.00
MULTI-MAPPING READS:
Number of reads mapped to multiple loci | ... | |
<reponame>Masado/django-app-api-3
import os
import zipfile
import tarfile
import pandas as pd
import numpy as np
from time import time
from datetime import datetime, time, date, timedelta
from django.shortcuts import render, redirect
from django.conf import settings
from django.views import generic
from django.views.ge... | |
# coding=utf-8
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
# Modifications Copyright 2022 Amazon.com, Inc. or its affiliates. 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 ... | |
"""
Module implementing various uncertainty based query strategies.
"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import numpy as np
from sklearn.utils.validation import check_array
from ..base import SingleAnnotPoolBasedQueryStrategy, SkactivemlClassifier
from ..utils import check_cost_matrix, simple_batch, ch... | |
<reponame>Matrixeigs/EnergyManagementSourceCodes<gh_stars>1-10
"""
Optimal power flow for hybrid AC/DC micro-grids
Two versions of optimal power flow models are proposed.
1) Single period
2) Multiple periods
@author: <NAME>
@email: <EMAIL>
"""
from numpy import power, array, zeros, ones, vstack, shape, concatenate
# ... | |
<gh_stars>1-10
# -*- encoding: utf-8 -*-
import csv
from urlparse import urlparse
from twisted.internet import defer
from twisted.internet import reactor
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.names import client
from twisted.python import usage
from twisted.web.client import GzipDecod... | |
<filename>imaging.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# by TR
from matplotlib import cbook
from matplotlib.mlab import psd
from matplotlib.ticker import AutoMinorLocator, MaxNLocator
from mpl_toolkits.axes_grid1 import make_axes_locatable
from obspy.core import UTCDateTime
from obspy.core.util import dep... | |
day=1,
hour=0, minute=0)
ival_D_to_T_end = Period(freq='Min', year=2007, month=1, day=1,
hour=23, minute=59)
ival_D_to_S_start = Period(freq='S', year=2007, month=1, day=1,
hour=0, minute=0, second=0)
ival_D_to_S_end = Period(freq='S', year=2007, month=1, day=1,
hour=23, minute=59, second=59)
assert_equal(ival... | |
<filename>dabbiew/dabbiew.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
import curses
import curses.textpad
import locale
import numpy as np
import pandas as pd
from collections import deque
from sys import argv
from time import sle... | |
<reponame>Valerokai/discord_message_analytics
import json
import subprocess
import sys
import discord
import emoji
import mysql
from discord.ext import commands
from ags_experiments.checks import is_owner_or_admin, is_server_allowed
from ags_experiments.client_tools import ClientTools, add_message
from ags_experiment... | |
in wait_for_states]
wait_for_resource_id = operation_result.headers['opc-work-request-id']
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_work_request(wait_for_resource_id),
evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states,
... | |
- invalid column types
self.assertFalse(
_ClipboardAlgo.canPasteCells( data, [ [ s["rows"][r]["cells"][c] for c in range( 3 + 1 ) ] for r in range( 1, 3 ) ] )
)
# - valid column subset
self.assertTrue(
_ClipboardAlgo.canPasteCells( data, [ [ s["rows"][r]["cells"][0] ] for r in range( 1, 3 ) ] )
)
... | |
(dict)`: This dictionary contains the results of an analysis set. The
keys are the string names of the analysis and the values stored are
6x1 np.array[float] vectors containing the 3 internal forces and
3 moments at the first node.
- `F2 (dict)`: This dictionary contains the results of an analysis set. The
keys ar... | |
1] if it was stored in our data structure in the
the main navigation map n=0 and at time t=0 and using 2D thus z=0
-'visual' thus topologically must be mapped c=20...29 possible locations
-let's assume this is the second *visual* feature we are mapping to that particular hypercube, thus previous
feature counter... | |
assert self.mode == "DECODE"
output_seq = sess.run(self.output_ids, {self.encoded_seq: embedding,
self.maximum_iterations: maximum_iterations})
return [[self.idx_to_char(seq[:, i]) for i in range(num_top)] for seq in output_seq]
def initilize(self, sess, overwrite_saves=False):
"""Function to initialize variables... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 22 08:24:59 2020
Performs intra-run analysis that compares multiple
benchmarks' data for a single run. This allows the user
to visualize the performance across multiple benchmarks
for a single run.
This script can be run as a standalone script to generate the intra-run
a... | |
############################################################################
# Copyright ESIEE Paris (2018) #
# #
# Contributor(s) : <NAME> #
# #
# Distributed under the terms of the CECILL-B License. #
# #
# The full license is in the file LICENSE, distributed with this software. #
####################################... | |
<gh_stars>0
"""
Created on Feb 17 2018
@author: MCC
"""
from ctypes import c_longlong, c_double, byref, create_string_buffer
from .ul_exception import ULException
from .ul_c_interface import lib, AiConfigItem, AiConfigItemDbl, AiConfigItemStr
from .ul_enums import (AiChanType, TcType, AutoZeroMode, AdcTimingMode,
Ie... | |
<reponame>vietbt/ViTextnormASR<gh_stars>0
import tools
import importlib
class Numb2Text:
def reset():
importlib.reload(tools)
def read(text: str, allow_alphabet: bool = False):
text = Numb2Text.process_space(text)
text = Numb2Text.read_date(text)
text = Numb2Text.read_time(text)
data = Numb2Text.read_number... | |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-07-17 16:42
from __future__ import unicode_literals
import colorful.fields
import danceschool.core.models
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import djangocm... | |
_x = val1.value
buff.write(_get_struct_i().pack(_x))
length = len(self.min.strs)
buff.write(_struct_I.pack(length))
for val1 in self.min.strs:
_x = val1.name
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
... | |
<reponame>mkelley/calviacat
# Licensed with the MIT License, see LICENSE for details
__all__ = [
'Catalog'
]
import logging
import sqlite3
from abc import ABC, abstractmethod
import numpy as np
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.stats import sigma_clipped_stats, sigma_cl... | |
"""
Communicate with a SuperK Fianium laser from NKT Photonics.
"""
from ctypes import c_ubyte
from enum import IntEnum
from msl.equipment.resources.nkt import PortStatusTypes
from msl.equipment.resources import NKT
from . import (
logger,
BaseEquipment,
)
class ID60(IntEnum):
"""The register ID's for a SuperK F... | |
<filename>pyteomics/pepxml.py
"""
pepxml - pepXML file reader
===========================
Summary
-------
`pepXML <http://tools.proteomecenter.org/wiki/index.php?title=Formats:pepXML>`_
was the first widely accepted format for proteomics search engines' output.
Even though it is to be replaced by a community standard... | |
"""
Copyright 2018-2019 CS Systèmes d'Information
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 writ... | |
"leggiest",
"leghorns",
"legrooms",
"legumins",
"legworks",
"lehayims",
"leisters",
"leisured",
"leisures",
"lekythoi",
"lekythos",
"lekythus",
"lemnisci",
"lemonish",
"lempiras",
"lemurine",
"lemuroid",
"lendable",
"lenience",
"lenities",
"leniting",
"lenition",
"lenitive",
"lensless",
"lentand... | |
<gh_stars>0
"""Collection of utilities for visualization."""
from itertools import cycle
from matplotlib import cm
from matplotlib.animation import FuncAnimation
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import torch
from .benchmarks import Benchmark
from .data impo... | |
<filename>cybox/__init__.py
# Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
__version__ = "2.1.0.7"
import collections
import inspect
import json
from StringIO import StringIO
import cybox.utils.idgen
from cybox.utils import Namespace, META
def get_xmlns_strin... | |
<filename>src/toil_vg/vg_map.py
#!/usr/bin/env python
"""
vg_map.py: map to vg graph producing gam for each chrom
"""
import argparse, sys, os, os.path, errno, random, subprocess, shutil, itertools, glob, tarfile
import doctest, re, json, collections, time, timeit
import logging, logging.handlers, struct, socket, thr... | |
profile)
client._sdkVersion += ("_CLI_" + __version__)
models = MODELS_MAP[g_param[OptionsDefine.Version]]
model = models.DisableRsgAsGroupRequest()
model.from_json_string(json.dumps(args))
start_time = time.time()
while True:
rsp = client.DisableRsgAsGroup(model)
result = rsp.to_json_string()
try:
json_obj =... | |
# -*- coding: utf-8 -*-
"""Master Controller Service.
This version polls REDIS Events rather than the database directly.
"""
import argparse
import random
import time
from typing import List
import urllib
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
from sip_config_db._events.event import E... | |
couplings = {(0,0):C.GC_482})
V_363 = Vertex(name = 'V_363',
particles = [ P.sl3__plus__, P.sl3__minus__, P.sl5__plus__, P.sl5__minus__ ],
color = [ '1' ],
lorentz = [ L.SSSS1 ],
couplings = {(0,0):C.GC_483})
V_364 = Vertex(name = 'V_364',
particles = [ P.sl4__plus__, P.sl4__minus__, P.sl5__plus__, P.sl5__minus_... | |
<reponame>takahashi-tsc/tacker<filename>tacker/tests/unit/vnfm/infra_drivers/kubernetes/test_kubernetes_driver.py
# Copyright (C) 2020 FUJITSU
# 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 ... | |
the avatar is logged in.
@type loggedIn: C{bool}
@ivar loggedOut: set to C{True} when the avatar is logged out.
@type loggedOut: C{bool}
"""
loggedIn = loggedOut = False
def __init__(self, avatarId):
self.avatarId = avatarId
def perspective_getAvatarId(self):
"""
Return the avatar identifier which was use... | |
491 1 0 251
1 492 1 0 250
1 503 1 0 249
1 504 1 0 248
1 505 1 0 247
1 506 1 0 246
1 507 1 0 245
1 508 1 0 244
1 509 1 0 243
1 510 1 0 242
1 511 1 0 241
1 512 1 0 240
1 513 1 0 239
1 514 1 0 238
1 515 1 0 237
1 516 1 0 236
1 493 1 0 233
1 494 1 0 232
1 495 1 0 231
1 498 1 0 228
1 499 1 0 227
1 500 1 0 226
1 517 1 0 225
... | |
from Queue import Queue # Threadsafe queue for threads to use
from collections import Counter # To count stuff for us
import datetime # Because datetime printing is hard
from pprint import pprint
import time # Should be obvious
import subprocess # Used to send notifications on mac
import sys # Get system info
... | |
<filename>backend/ReMu/accounts/views.py
from django.shortcuts import render
from django.http.response import JsonResponse
from rest_framework.parsers import JSONParser
from rest_framework import status
from .models import User, WavFile
from .serializers import UserSerializer, SignUpSerializer, changeSangSongSerial... | |
<reponame>benyaboy/sage-graphics
#if 0
# $Id: riffinfo.py,v 1.33 2005/03/15 17:50:45 dischi Exp $
# $Log: riffinfo.py,v $
# Revision 1.33 2005/03/15 17:50:45 dischi
# check for corrupt avi
#
# Revision 1.32 2005/03/04 17:41:29 dischi
# handle broken avi files
#
# Revision 1.31 2004/12/13 10:19:07 dischi
# more debug, s... | |
Offset is a zero based index.
:param str sort: The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
:return: ScreenRecordingQueryResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_da... | |
, ALIGNMENT = alignment
-- , STORAGE = storage
-- , LIKE = like_type
-- , CATEGORY = category
-- , PREFERRED = preferred
-- , DEFAULT = default
-- , ELEMENT = element
-- , DELIMITER = delimiter
-- , COLLATABLE = collatable
-- )
''')
def TemplateAlterType(self):
return Template('''ALTER TYPE #type_name#
--ADD ATTRIB... | |
"""
All constraint cards are defined in this file. This includes:
* sets
* SET1, SET3, RADSET # ??? RADSET
* asets - aset, aset1
* bsets - bset, bset1
* csets - cset, cset1
* qsets - qset, qset1
* usets - uset, uset1 # USET 1 is not supported
The superelement sets start with SE:
* se_bsets - sebset, sebset1
* se_cse... | |
SIGN AB013': 67083,
'LINEAR A SIGN AB016': 67084,
'LINEAR A SIGN AB017': 67085,
'LINEAR A SIGN AB020': 67086,
'LINEAR A SIGN AB021': 67087,
'LINEAR A SIGN AB021F': 67088,
'LINEAR A SIGN AB021M': 67089,
'LINEAR A SIGN AB022': 67090,
'LINEAR A SIGN AB022F': 67091,
'LINEAR A SIGN AB022M': 67092,
'LINEAR A SIGN AB023': 670... | |
I started using this rather than alignment.uncertainties
# b/c the latter relies on converting a DenseAlignment to an Alignment --
# need to check into this.
positional_entropies = [Freqs(p).Uncertainty for p in alignment.Positions]
# Calculate pairwise MI between position_number and all alignment
# positions, ... | |
for EVENT_HOMEASSISTANT_START listener
self.async_stop_track_tasks()
with timeout(15):
await self.async_block_till_done()
except asyncio.TimeoutError:
# TODO warning
pass
# _LOGGER.warning(
# 'Something is blocking Home Assistant from wrapping up the '
# 'start up phase. We\'re going to continue anyway. Please... | |
= (operator_, parts[0])
term = self.create_term(path_1, new_value, modifier)
terms.append(term)
if parts[1]:
path_2 = path_ / "unit"
new_value = (operator_eq, parts[1])
term = self.create_term(path_2, new_value, modifier)
terms.append(term)
else:
# may be validation error
raise NotImplementedError
if len(t... | |
""" Abstract implementation of a blockchain
"""
import hashlib
import math
import os
from collections import OrderedDict, namedtuple
from pathlib import Path
from pprint import pprint
from queue import Queue
from time import time
from typing import Any, Callable, List, Optional, Tuple
from utils import print_debug_inf... | |
<gh_stars>1-10
from urllib import urlencode
import logging
import json
from pylons import config
from ckan.plugins import toolkit as tk
import ckan.model as model
import ckan.lib.helpers as h
import ckan.lib.navl.dictization_functions as dict_fns
import ckan.logic as logic
import ckan.plugins as p
from ckan.common im... | |
k])
if affine is not None:
aff = vtk.vtkMatrix4x4()
aff.DeepCopy((affine[0, 0], affine[0, 1], affine[0, 2],
affine[0, 3], affine[1, 0], affine[1, 1],
affine[1, 2], affine[1, 3], affine[2, 0],
affine[2, 1], affine[2, 2], affine[2, 3],
affine[3, 0], affine[3, 1], affine[3, 2],
affine[3, 3]))
# aff.DeepCopy((af... | |
axis=0)
# mean = np.mean(whole_dataset, axis=0)
# rf_ds_lon = RFprec_to_ClusterLabels_dataset.lon
# rf_ds_lat = RFprec_to_ClusterLabels_dataset.lat
std = get_RF_calculations(model, criteria="gt1mm", calculation="std")
mean = get_RF_calculations(model, criteria="gt1mm", calculation="mean")
rf_ds_lon = get_RF_calcu... | |
x
return result
class groupby(dict):
"""
A simple groupby different from the one in itertools.
Does not require the sequence elements to be sorted by keys,
however it is slower.
"""
def __init__(self, seq, key=lambda x: x):
for value in seq:
k = key(value)
self.setdefault(k, []).append(value)
try:
__it... | |
dadi.Spectrum.from_phi(phiE, (n1,n2), (xx,xx))
### Calculate the genomic island spectrum
# phi for the equilibrium ancestral population
phiI = dadi.PhiManip.phi_1D(xx)
# Now do the divergence event
phiI = dadi.PhiManip.phi_1D_to_2D(xx, phiI)
# We set the population sizes after the split to nu1 and nu2 and the mi... | |
is stopped (such as when using
# 'salt.utils.async.SyncWrapper'). Ensure that
# _stream_return() completes by restarting the IO Loop.
# This will prevent potential errors on shutdown.
orig_loop = tornado.ioloop.IOLoop.current()
self.io_loop.make_current()
try:
self.io_loop.add_future(
self._stream_return_future... | |
%s.xyz P,C" % (self.name), stdin="ALL")
## Parse the output of analyze.
mode = 0
self.AtomMask = []
self.AtomLists = defaultdict(list)
ptype_dict = {'atom': 'A', 'vsite': 'D'}
G = nx.Graph()
for line in o:
s = line.split()
if len(s) == 0: continue
# TINKER 8.2.1 -> 8.7.1 changed printout to "Atom Definition ... | |
(write) a tree dictionary to a fdt
This routine takes an input dictionary, and writes the details to
the passed fdt.
The dictionary contains a set of internal properties, as well as
a list of standand properties to the node. Internal properties have
a __ suffix and __ prefix.
Child nodes are indexed by their a... | |
/>
</hintset>
<hintset pointTag="hintSet0016">
<hstem pos="0" width="28" />
<hstem pos="338" width="28" />
<hstem pos="632" width="28" />
<vstem pos="100" width="32" />
<vstem pos="496" width="32" />
</hintset>
</hintSetList>
</data>
"""
_hintFormat2_ = """
A <dict> element in the hintSetList array identifie... | |
in_file = File(
desc='Original anatomical volume (+orig).'
'The skull is removed by this script'
'unless instructed otherwise (-no_ss).',
argstr='-input %s',
mandatory=True,
exists=True,
copyfile=False)
base = traits.Str(
desc=' Reference anatomical volume'
' Usually this volume is in some standard space like... | |
<gh_stars>1-10
# coding: utf-8
"""
videoapi
The video APIs help you convert, encode, and transcode videos. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compati... | |
'nExceptions': 0,
'nFailures': 0,
'nTasksComputed': 0,
'nTimeouts': 0
} )
if nExceptions:
logger.warning( 'instance %s previously had %d exceptions', iid, nExceptions )
state = 'checked'
nCurTasks = 0
for event in events:
#logger.info( 'event %s', event )
if 'exception' in event:
nExceptions += 1
if event... | |
type_recast(self):
'''
'''
pass
def values(self):
'''
'''
pass
class VIEW3D_PT_snapping(bpy_types.Panel, bpy_types._GenericUI):
bl_label = None
''' '''
bl_region_type = None
''' '''
bl_rna = None
''' '''
bl_space_type = None
''' '''
id_data = None
''' '''
def append(self, draw_func):
''' ... | |
# -*- coding: utf-8 -*-
from grafo import Grafo
from grupo import Grupo
import time
# método de ordenação quick-sort, utilizado para ordenar as arestas em forma decrescente
def quickSortAux(vetor, esquerda, direita):
i = esquerda
j = direita
pivo = vetor[int((j + i) / 2)][2]
while i <= j:
while vetor[i][2] > piv... | |
transactions"
Ary['MOSEN12118'] = "Changing practical use status"
Ary['MOSEN12119'] = "Year"
Ary['MOSEN12120'] = "Month"
Ary['MOSEN12121'] = "Day"
Ary['MOSEN12122'] = " Rule name:"
Ary['MOSEN12123'] = " Order to commit action:"
Ary['MOSEN12124'] = " Action classification:"
Ary['MOSEN12125'] = " Action parameter... | |
import smbus
import time
import math
RELAY_VAL_ADD = 0
RELAY_SET_ADD = 1
RELAY_CLR_ADD = 2
OC_VAL_ADD = 3
OC_SET_ADD = 4
OC_CLR_ADD = 5
OPTO_VAL_ADD = 6
I4_20_OUT_VAL1_ADD = 7
I4_20_OUT_VAL2_ADD = 9
I4_20_OUT_VAL3_ADD = 11
I4_20_OUT_VAL4_ADD = 13
I4_20_IN_VAL1_ADD = 15
I4_20_IN_VAL2_ADD = 17
I4_20_IN_VAL3_ADD = 19
I4_... | |
OoOo00o0OO . input_stats . increment ( len ( packet ) )
if 67 - 67: oO0o + II111iiii - O0 . oO0o * II111iiii * I11i
if 90 - 90: Ii1I . IiII
if 81 - 81: OOooOOo - I11i % ooOoO0o - OoO0O00 / Oo0Ooo
if 4 - 4: OoooooooOO - i1IIi % Ii1I - OOooOOo * o0oOOo0O0Ooo
if 85 - 85: OoooooooOO * iIii1I11I1II1 . iII111i / Ooooooo... | |
import py
from rpython.memory.gc.minimarkpage import ArenaCollection
from rpython.memory.gc.minimarkpage import PAGE_HEADER, PAGE_PTR
from rpython.memory.gc.minimarkpage import PAGE_NULL, WORD
from rpython.memory.gc.minimarkpage import _dummy_size
from rpython.rtyper.lltypesystem import lltype, llmemory, llarena
from r... | |
<filename>notifier/parcon/static.py
"""
A static typing library for Python. That may sound at first as if this module
was designed to simply decorate methods specifying the type of objects that
must be passed to them, and it can definitely do that. However, it's quite a
bit more powerful than that. It has a collection... | |
<gh_stars>0
#python imports
import re
import sys
import time
import random
import argparse
import itertools
from re import S
import numpy as np
import pandas as pd
from pprint import pprint
from subprocess import call
from datetime import datetime
from sklearn.datasets import make_blobs
from numpy.lib.arraysetops impor... | |
<reponame>Korijn/wgpu-py
"""
WGPU backend implementation based on the wgpu library.
The Rust wgpu project (https://github.com/gfx-rs/wgpu) is a Rust library
based on gfx-hal, which wraps Metal, Vulkan, DX12 and more in the
future. It can compile into a dynamic library exposing a C-API,
accomanied by a C header file. W... | |
pos in sorted (Fwig.keys()):
print >>FWO, "%d\t%.2f" % (pos,Fwig[pos])
else:
for pos in sorted (Fwig.keys()):
print >>FWO, "%d\t%.2f" % (pos,Fwig[pos])
for pos in sorted (Rwig.keys()):
print >>RVO, "%d\t%.2f" % (pos,Rwig[pos])
else: #normalize wig signal to WigSumFactor
if le... | |
<gh_stars>0
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, time
from odoo import api, fields, models, _
from odoo.addons import decimal_precision as dp
from odoo.exceptions import UserError
PURCHASE_REQUISITION_STATES = [
('draft',... | |
value: bool) -> None:
if self._shield != value:
self._shield = value
if not value:
self._deliver_cancellation_to_parent()
async def checkpoint() -> None:
await sleep(0)
async def checkpoint_if_cancelled() -> None:
task = current_task()
if task is None:
return
try:
cancel_scope = _task_states[task].cancel... | |
not folder or not os.path.isdir(folder):
LOGGER.warning('Impossible to remove "{}"'.format(folder))
return
for the_file in os.listdir(folder):
file_path = os.path.join(folder, the_file)
try:
if os.path.isfile(file_path):
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exce... | |
are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
:vartype id: str
:ivar name: The name of... | |
# Copyright (c) 2016 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
two's complement.
if binary[0] == '1':
sign = -1
binary = binary.replace('1', 'i')
binary = binary.replace('0', '1')
binary = binary.replace('i', '0')
pivot = binary.rfind('0')
binary = binary[0:pivot] + '1' + ('0' * len(binary[pivot + 1:]))
# Convert the value back to an integer and reapply the sign.
self.v... | |
h=18):
fw = w/100*percent
px = QPixmap(w, h)
px.fill(qApp.palette().color(QPalette.Active, QColorGroup.Background))
pp = QPainter(px)
pp.setPen(Qt.black)
pp.setBackgroundColor(qApp.palette().color(QPalette.Active, QColorGroup.Base))
map = self.TYPE_TO_PIX_MAP[agent_type]
map_len = len(map)
if map_len == 1 o... | |
gds_collector_=None):
if nodeName_ == 'accountNumber':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'accountNumber')
value_ = self.gds_validate_string(value_, node, 'accountNumber')
self.accountNumber = value_
self.accountNumber_nsprefix_ = child_.prefix
# validate type stringMaxLength10
se... | |
# -*- coding: utf-8 -*-
'''
FanFilm Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | |
<filename>misc_code/cov_matrix_old.py<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Created on Wed May 21 17:38:31 2014
@author: brian
"""
from numpy import concatenate, cov, var, matrix, diag, transpose, zeros, mean, trace
from numpy.linalg import inv, det, eig
from math import log, pi, sqrt, exp
from random import ran... | |
<reponame>kdschlosser/ClimateTalk
# -*- coding: utf-8 -*-
# Copyright 2020 <NAME>
import datetime
from .packet import SetControlCommandRequest
from .utils import (
TwosCompliment,
get_bit as _get_bit,
set_bit as _set_bit
)
HEAT_SET_POINT_TEMPERATURE_MODIFY = 0x01
COOL_SET_POINT_TEMPERATURE_MODIFY = 0x02
HEAT_PROF... | |
"""The RiveScript coverage plugin."""
# Written by @snoopyjc 2020-01-16
# Based on Coverage Plugin by nedbat with changes by PamelaM
VERSION="1.1.0"
# It's not pretty in places but it works!!
import datetime
import os.path
import re
import sys
import inspect
import importlib
import shutil
import coverage.plugin
f... | |
<filename>ColDoc/blob_inator.py
#!/usr/bin/env python3
""" the Blob Inator
splits the input into blobs
(this version is not integrated with Django)
"""
default_metadata = [ 'label', 'uuid', 'index', 'author', 'date',
'title', 'ref', 'eqref', 'pageref', 'cite' ]
# these keys are parameters used when first calling b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.