input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>alburke/doineann
import matplotlib.pyplot as plt
from os.path import exists
from glob import glob
import pandas as pd
import numpy as np
import h5py
import random
#Parallelization packages
from multiprocessing import Pool
import multiprocessing as mp
class DLDataEngineering(object):
def __init__(self,mode... | |
the CLDR supplemental data, and are
based on the likelihood of people using the language to transmit
information on the Internet. (This is why the overall default is English,
not Chinese.)
>>> str(LanguageData.get('zh-Hant').fill_likely_values())
'zh-Hant-TW'
>>> str(LanguageData.get('zh-TW').fill_likely_values(... | |
#coding=utf-8
# This file is licensed under MIT license.
# See the LICENSE file in the project root for more information.
import sys
import numpy as np
import tf
import tf.transformations
from car_msgs.msg import MotionPlanningTarget, CarState
from car_core.common import msgs_helpers, geom_helpers
from frenet import ... | |
<reponame>bihealth/atlatl<filename>atlatl/helpers.py<gh_stars>0
import pathlib
import subprocess
import shlex
from collections import defaultdict
from typing import Tuple
import pandas as pd
import numpy as np
import tempfile
import io
import os
from scipy.stats import binom
import plotly.graph_objects as go
import pl... | |
self.client.sendcmd, 'appe x')
def test_rest_on_stor(self):
# Test STOR preceded by REST.
data = b'abcde12345' * 100000
self.dummy_sendfile.write(data)
self.dummy_sendfile.seek(0)
self.client.voidcmd('TYPE I')
with contextlib.closing(
self.client.transfercmd('stor ' + self.testfn)) as conn:
bytes_sent = 0
w... | |
<reponame>rahulvenkk/physics-benchmarking-neurips2021
from argparse import ArgumentParser
from tdw_physics.target_controllers.dominoes import Dominoes, MultiDominoes, get_args, none_or_str, none_or_int
from tdw.output_data import OutputData, Transforms, Images, CameraMatrices
import h5py
import json
import copy
import ... | |
if (
self.outlet or
self.javascriptCode is not None or
super(FlowCode, self).hasContent_()
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='', name_='FlowCode', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('FlowCode')
if imported_ns_... | |
<reponame>Vicky123wzy/retro<filename>bin/retroscan.py<gh_stars>1-10
#!/usr/bin/env python
from __future__ import print_function
import sys
import argparse
import os
import subprocess
import re
import zipfile
import tarfile
import logging
from logging import handlers
import matplotlib.pyplot as plt
import numpy as np
im... | |
sys.platform == 'win32':
decorated = '"%s"' % sys.executable
tester = '"%s"' % tester
else:
decorated = sys.executable
retval = os.spawnl(os.P_WAIT, sys.executable, decorated, tester, v, fd)
self.assertFalse(retval < 0,
"child process caught fatal signal %d" % -retval)
self.assertFalse(retval > 0, "child proce... | |
starts '''
''' #15 <gmd:title> '''
titleText = str(row['Name of Information asset or collection (Asset Name/Title)']).replace('&', 'and').strip()
ds_title_x = title_start + titleText + title_end
''' #16 gmd:alternateTitle> '''
''' #17 <gmd:date> '''
# Could be more than one, but assuming one here
# ... | |
<gh_stars>1-10
"""
Utility functions to construct Morton encodings from a set of points distributed
in 3D.
Conventions:
------------
1. Morton keys are stored as type np.int64
2. Anchor index coordinates are stored as type np.int32
3. By convention, we take anchor indices to have a maximum of 16 bits.
4. By convention... | |
"""
Models for processed RMP data.
"""
import os
from django.conf import settings
from django.db import models
from django.db.models import (
F, Func, Max, OuterRef, Subquery, Sum, Count, Case, When, Value, Q
)
from django.db.models.functions import Cast, Coalesce
from rmp.fields import (
CopyFromBigIntegerField,
Co... | |
from collections.abc import Iterable
from functools import partial
from math import sqrt
from numbers import Real
from operator import attrgetter
from warnings import warn
from openmc import (
XPlane, YPlane, Plane, ZCylinder, Cylinder, XCylinder,
YCylinder, Universe, Cell)
from ..checkvalue import (
check_type, ch... | |
# Copyright (c) Facebook, Inc. and its affiliates.
"""
The processors exist in Pythia to make data processing pipelines in various
datasets as similar as possible while allowing code reuse.
The processors also help maintain proper abstractions to keep only what matters
inside the dataset's code. This allows us to keep... | |
# -*- coding: utf-8 -*-
# Copyright 2016 Resonai Ltd. 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... | |
want the intermolecular coevolution and don't care
## about the intramolecular coevolution.
# Get the appropriate method (need the pair method,
# not the alignment method)
try:
method = coevolve_alignment_to_coevolve_pair[method]
except KeyError:
# may have passed in the coevolve_pair function, so just
# co... | |
ensure it is deterministic
sorted_tags = self.tags.copy()
sorted_tags.sort()
for tag in sorted_tags:
hash_value = hash_value ^ hash(tag)
return hash_value
def __str__(self):
return "<{}, {}, {}>".format(self.symbol.name, self.value, self.tags)
def __repr__(self):
return self.__str__()
def __bool__(self):
... | |
<gh_stars>100-1000
# global
import os
import queue
import pytest
import random
import numpy as np
import multiprocessing
import pickle
# local
import ivy
from ivy.container import Container
import ivy_tests.test_ivy.helpers as helpers
def test_container_list_join(device, call):
container_0 = Container(
{
"a": [iv... | |
<reponame>LIV4D/JuNNo<filename>lib/junno/datasets/dataset.py
"""This module is used to build **Dataset**
which are a convenient way to deal with database. Each dataset contains a primary key identifying a row,
and one or many columns. A column is an instance of :class:`DataSetColumn`.
In the general idea, a dataset ne... | |
<filename>textdata_MT.py
import numpy as np
import nltk # For tokenize
from tqdm import tqdm # Progress bar
import pickle # Saving the data
import math # For float comparison
import os # Checking file existance
import random
import string, copy
from nltk.tokenize import word_tokenize
from Hyperparameters import args
i... | |
''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='TEmp... | |
from uuid import uuid4
import hashlib
import sqlite3
import time
import numpy as np
from flask import Markup
from collections import defaultdict
import json
from cocoa.systems.human_system import HumanSystem
from cocoa.web.views.utils import format_message
from core.controller import Controller
from states import Fin... | |
except TypeError:
if isinstance(data, collections.abc.Iterable):
for d in data:
self.sock.sendall(d)
else:
raise TypeError("data should be a bytes-like object "
"or an iterable, got %r" % type(data))
def _output(self, s):
"""Add a line of output to the current request buffer.
Assumes that the line... | |
<reponame>zztcok/SNAC_PSNAC
import os
import sys
import networkx
import pdb
import matplotlib
import matplotlib.pyplot as plt
import itertools
import copy
class Multistage_PYSP_Object:
def __init__(self,Fixed_Variables, ModelData):
if Fixed_Variables == {('Drug2', 1, 0, 1): [set()], ('Drug3', 1, 0, 0): [set()], ... | |
if tradingAction is "sell" then
click button "确定卖出" of window 1 of application process "同花顺" of application "System Events"
end if
-- gem 创业版盘后特殊
-- static text "提示信息" of sheet 1 of window 1 of application process "同花顺" of application "System Events"
-- static text "股东账号:0277525271
-- 证券代码:30... | |
<filename>GeneratorInterface/Pythia8Interface/test/inlineSlhaFragment.py
FLAVOR = 'stop'
COM_ENERGY = 13000. # GeV
MASS_POINT = 1000 # GeV
CROSS_SECTION = 0.00615134 # pb
CTAU_POINT = 1000. # mm
SLHA_TABLE="""## Important note!
## This file has been modified by hand to give the gluino and the
## stop_1 a very narrow w... | |
# MINLP written by GAMS Convert at 04/21/18 13:54:12
#
# Equation counts
# Total E G L N X C B
# 610 106 84 420 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 477 393 84 0 0 0 0 0
# FX 0 0 0 0 0 0 0 0
#
# Nonzero counts
# Total const NL DLL
# 1737 1723 14 0
#
# ... | |
argDesc.keys()
for arg in argZip:
for argKey in argKeys:
if argKey not in retArgDescs and str(arg) == str(argKey):
retArgDescs.append(argKey)
retArgDescVals.append(argDesc[argKey])
break
else:
for argKey in argKeys:
if argKey not in retArgDescs and\
len(re.findall("{0}(?=[\,\s\*])".format(arg),
argKey)) > 0:... | |
"""
utilities
=========
Collection of classes and functions for components and services of ApBsInT:
- Potential manager
- Model (PM and B factor)
- Representation
"""
import numpy as np
import scipy.sparse as ssp
import scipy.linalg as sla
import numbers
import time # For profiling
import apbsint.helpers as helpers... | |
<gh_stars>1-10
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Genera... | |
sent. (default="0.0.0.0")
- receiver_port -- Optional. The port the receiver is bound on - to which packets will be sent. (default=0)
"""
def __init__(self, receiver_addr="0.0.0.0", receiver_port=0):
"""
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
"""
super(UDPSender, self).__init__()
... | |
4.2450,
2.7967,
3.0689,
3.4445,
3.6581,
3.4717,
3.4951,
3.2694,
3.3397,
3.1147,
2.9661,
3.5898,
3.8468,
3.7358,
3.9014,
3.6129,
3.8443,
3.6054,
3.4396,
3.9683,
4.1656,
4.0394,
4.0158,
3.9498,
3.3677,
3.8718,
3.8164,
3.8005,
3.7662,
3.7500,
3.7181,
3.6863,
3.9170,
3.6637,
3.9641,
3.750... | |
<reponame>jwilliams0496/CMSC-461
########################################################################################
# File: student_module.py
# Author: <NAME>
# Description: Provides the command line interface for the student users of Book Fetch
# Inc. to use when preforming actions and use cases associated with ... | |
else:
return exclusao(*args_, **kwargs_)
factory = staticmethod(factory)
def get_idePeriodo(self): return self.idePeriodo
def set_idePeriodo(self, idePeriodo): self.idePeriodo = idePeriodo
def hasContent_(self):
if (
self.idePeriodo is not None
):
return True
else:
return False
def export(self, outfile, lev... | |
<filename>conceptnet5/uri.py
"""
URIs are Unicode strings that represent the canonical name for any object in
ConceptNet. These can be used with the ConceptNet Web API, or referred to in a
Semantic Web application, by attaching the prefix:
http://api.conceptnet.io
For example, the English concept "book" has the URI ... | |
<filename>theanompi/models/alex_net.py
# This version of alex_net.py is modified based on the theano_alexnet project. See the original project here:
# https://github.com/uoguelph-mlrg/theano_alexnet, and its copy right:
# Copyright (c) 2014, <NAME>, <NAME>, <NAME> and <NAME>
# All rights reserved.
import numpy as np
... | |
representing the collected message
#
return length - HEADER_LEN, msg_type, print_msg
# In case of any exception, dump the hex of the message to help
# debug what's wrong with the message, and re-raise the exception.
#
except Exception, esc:
if verbose:
print str(esc)
print DumpHexString(header, 0, HEADER_LEN)... | |
<filename>gtin/__init__.py
"""
A library for parsing GTINs ("Global Trade Item Numbers"--also known as UPC/EAN/JAN/ISBN).
Author: <NAME> <<EMAIL>>
License: MIT
"""
# Python 2 compatibility
from __future__ import division
from future.standard_library import install_aliases
install_aliases()
from future.utils import py... | |
<filename>helpscout/client.py<gh_stars>1-10
import logging
import time
from functools import partial
try: # Python 3
from urllib.parse import urljoin
except ImportError: # Python 2
from urlparse import urljoin
import requests
from helpscout.exceptions import (HelpScoutException,
HelpScoutAuthenticationException,
... | |
70 - 70: i11iIiiIii % iII111i
if 11 - 11: IiII % I1ii11iIi11i % Ii1I / II111iiii % I1Ii111 - Oo0Ooo
if 96 - 96: I1ii11iIi11i / II111iiii . Ii1I - iII111i * I11i * oO0o
if 76 - 76: Ii1I - II111iiii * OOooOOo / OoooooooOO
if 18 - 18: OoO0O00 + iIii1I11I1II1 - II111iiii - I1IiiI
lisp_hostname = socket . gethostname (... | |
<gh_stars>1-10
import argparse
import numpy as np
import torch
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence
from lib.sepsis_simulator.utils import run_policy
from lib.random_search import RandomSearch
# from .common import wrappers
from lib.sepsis_simulator.policy import Seps... | |
Thermal Conductivity`
| The base temperature is 20C.
| This is the thermal conductivity change per degree excursion from 20C.
| This variable conductivity function is overridden by the VariableThermalConductivity object, if present.
| Units: W/m-K2
Args:
value (float): value for IDD Field `Temperature Coefficie... | |
:param should_split: boolean
"""
self.reviewer = reviewer
self.review = review
self.should_split = should_split
self.timestamp = get_now()
def __eq__(self, other):
return self.uid == other.uid
class LastReviewerMerge(AbstractLastReviewerCase):
"""
Inits a row in current last reviewer merge table
"""
__tab... | |
<reponame>christensonb/Seaborn
__author__ = '<NAME>'
__date__ = "9/22/15"
# try: from sanic.response import json
# except: import json
import json
import inspect
import ast
import traceback
from werkzeug.local import LocalProxy
from flask import request, render_template
from flask import redirect as flask_redirect
fro... | |
"""
Precisely APIs
Enhance & enrich your data, applications, business processes, and workflows with rich location, information, and identify APIs. # noqa: E501
The version of the OpenAPI document: 11.9.3
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from com.pr... | |
from autoarray.layout import layout as lo, layout_util
from autoarray.layout import region as reg
from autoarray.structures.arrays.two_d import array_2d
def roe_corner_from(ccd_id, quadrant_id):
row_index = ccd_id[-1]
if (row_index in "123") and (quadrant_id == "E"):
return (1, 0)
elif (row_index in ... | |
import builtins
import os
import pytest
import shutil
import sys
import time
import subprocess
from configobj import ConfigObj
from unittest import mock
sys.path.append('..')
from streamrecorder import stream
from streamrecorder import dvrutils
def get_schedule_mock(schedStr='', durationMinutes=60):
def new_check_s... | |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# # Clifford Alegrba Generators
# This code create the matrix representations of Clifford algebras.
# The aim of this code to provide everything you need for a Clifford module, given just its type.
#
# So far, only the simple cases are coded in, with the procedure t... | |
_set_delay(self):
raise NotImplementedError
def _include(self):
win_text = ""
return f"ahk_id {self.id or 0}", win_text
class BaseWindow(WindowHandle):
"""Base window class that is inherited by :class:`~ahkpy.Window` and
:class:`~ahkpy.Control` classes.
To get a window instance, use :meth:`~ahkpy.Windows.fir... | |
<reponame>JoJo2nd/lua-protobuf
# Copyright 2011 <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 required by applicable law or ... | |
from django.utils.translation import ugettext as _
import uuid
from dateutil.parser import parser
import simplejson
from casexml.apps.case.models import CommCareCase
from corehq.apps.users.models import CommCareUser
from couchforms.models import XFormInstance
from dimagi.utils.decorators.memoized import memoized
from p... | |
<filename>modules/visualization/visualization.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import xgboost as xgb
from sklearn.metrics import roc_curve
from sklearn.metrics import auc
from sklearn.model_selection import learning_curve
from IPython.display import display, H... | |
<filename>tests/test_interface_ats.py
# -*- coding: utf-8 -*-
import pytest
from pynetworking.Device import Device
ats_supported_sw_version = '3.0.0.44'
ats_supported_boot_version = '1.0.1.07'
ats_basic_supported_model = 'AT-8000S'
ats_supported_model = [ats_basic_supported_model + '/' + '24', ats_basic_supported_mod... | |
= self.con.cursor()
q = f"""Select
Object.id,
Object.objtype_id,
Object.name as Description,
Object.label as Name,
Object.asset_no as Asset,
Attribute.name as Name,
Dictionary.dict_value as Type,
Object.comment as Comment,
RackSpace.rack_id as RackID,
Rack.name as rack_name,
Rack.row_name,
Rack.location_id... | |
# -*- encoding: utf-8 -*-
'''Game manager module.'''
# pylint: disable=fixme, line-too-long, invalid-name, undefined-variable
# pylint: disable=too-many-branches, too-many-statements, too-many-arguments
from random import randint
import pygame
from pygame.locals import * # pylint: disable=wildcard-import, unused-wildca... | |
<reponame>ni-ldp/nixnet-python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import collections
import typing # NOQA: F401
import six
from nixnet import _cconsts
from nixnet import _errors
from nixnet import _py2
from nixnet import constants
... | |
DTS, which allows assignments like
x = "foo", < 0x12345678 >, [ 9A ];
This gives x the value b"foo\0\x12\x34\x56\x78\x9A". Numbers in DTS are
stored in big-endian format.
nodes:
A collections.OrderedDict containing the subnodes of the node, indexed by
name.
labels:
A list with all labels pointing to the nod... | |
self.buffstate_shape, self.buffstate_shape, self.movemap_shape,
# self.op_shape, self.band_shape], self.cnn_kernel_size)
new_agent_critic = agent_critic([self.state_map_shape, self.buffstate_shape, self.buffstate_shape,
self.movemap_shape, self.op_shape, self.band_shape], self.cnn_kernel_size)
t_agent_critic = agen... | |
<reponame>downneck/mothership
# Copyright 2011 Gilt Groupe, INC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | |
#!usr/bin/env python3.6
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2020 Westwood Robotics Corp."
__date__ = "Feb 14, 2020"
__version__ = "0.1.0"
__status__ = "Beta"
'''
This module is used to communicate with the Dynamixel X series actuator on the DAnTE platform
'''
from dynamixel_sdk impo... | |
message associated with the error
code.
"""
def __init__(self,
*,
code: str = None,
message: str = None) -> None:
"""
Initialize a ImageBulkDeleteError object.
:param str code: (optional) An API error code.
:param str message: (optional) The English text message associated with the
error code.
"""
self.c... | |
Solve the range equation for arbitrary transmittance vs range.
This function solve for the range :math:`R` in the range equation
.. math::
E = \\frac{I\\tau_a(R)}{R^n}
where :math:`E` is the threshold irradiance in [W/m2],
and :math:`I` is the intensity in [W/sr]. This range equation holds for
the case where ... | |
# Based on https://github.com/StalkR/misc/commit/ba67f5e94d1b1c2cd550cf310b716c0a8101d7a0#diff-78a5f46979e1e7a85d116872e2c865d4 # noqa: E501
import functools
import itertools
from typing import Any, Callable, Iterable, Tuple, TypeVar
from .constants import TAG_LITERAL, TAG_COPY1, TAG_COPY2, TAG_COPY4
from .exceptions ... | |
import numpy as np
from cs231n.layers import *
from cs231n.rnn_layers import *
class CaptioningRNN(object):
"""
A CaptioningRNN produces captions from image features using a recurrent
neural network.
The RNN receives input vectors of size D, has a vocab size of V, works on
sequences of length T, has an RNN hid... | |
0x62, 0x48, 0x80,
0xa2, 0x44, 0x80, 0x85, 0xa2, 0x44, 0x68, 0x42,
0x42, 0x42, 0x3f, 0x42, 0x08, 0x00, 0x20, 0x02,
0x00, 0x22, 0x00, 0x48, 0x00, 0x20, 0x81, 0x02,
0x00, 0x20, 0x81, 0x02, 0x28, 0x00, 0x80, 0x02,
0x80, 0x21, 0x84, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x24, 0x02, 0x00, 0x00, 0x00, 0x00,
0x42, 0... | |
<gh_stars>1-10
import bpy
import mathutils as mut
import numpy as np
import operator
from collections import deque
from constants import C, ORIGIN, CustomError, D, EASE_IN_OUT, PI, WHITE,\
OBJECT_COUNTER, BLACK
from externals.blender_utils import selectOnly, computeQuaternion
from externals.bezier_interpolation import... | |
<reponame>burmist-git/cta-lstchain
import h5py
import numpy as np
from astropy.table import Table, vstack
import tables
from tables import open_file
import os
import pandas as pd
import astropy.units as u
import ctapipe
import lstchain
from ctapipe.io import HDF5TableReader
from ctapipe.io.containers import MCHeaderCon... | |
self.all_edge_positions.append((pos1, pos2))
# F and D
for (pos1, pos2) in zip(self.sideF.edge_south_pos, self.sideD.edge_north_pos):
self.all_edge_positions.append((pos1, pos2))
# L and B
for (pos1, pos2) in zip(self.sideL.edge_west_pos, self.sideB.edge_east_pos):
self.all_edge_positions.append((pos1, pos2))
... | |
'int' , None, None,
[('1', '255')], [],
''' Priority of the Candidate BSR
''',
'priority',
'Cisco-IOS-XR-ipv4-pim-cfg', False),
],
'Cisco-IOS-XR-ipv4-pim-cfg',
'candidate-bsr',
_yang_ns._namespaces['Cisco-IOS-XR-ipv4-pim-cfg'],
'ydk.models.cisco_ios_xr.Cisco_IOS_XR_ipv4_pim_cfg'
),
},
'Pim.DefaultContext... | |
= [prec.name for prec in self.dominators]
domin.sort()
return "[%%%s %s ={%s} <{%s}]" % (self.assoc, self.name, \
",".join(equiv), ",".join(domin))
# Important for pickling/unpickling.
def __eq__(self, other):
return self is other
class SymbolSpec(object):
seq = 0
def __init__(self, name, prec):
assert typ... | |
(best * (best > thresh)).mean() # fitness
@staticmethod
def _print_results(objects, anchors, thresh, num_anchors, img_size):
# SORT SMALL TO LARGE (BY AREA)
anchors = anchors[np.argsort(anchors.prod(1))]
x, best = AnchorGenerator._metric(objects, anchors)
best_possible_recall = (best > thresh).mean()
anchors_ab... | |
fat red tail
bounds['hostr_v'] = (2.0,4.0)
def rvprior( rv ) :
return( gauss( rv, 3.1, 0.3, range=bounds['host_rv'] ) )
# TODO : include a proper Av or E(B-V) prior for CC models
if zhost and zhosterr>0.01:
priorfn = {'z':zprior, 'rv':rvprior }
else :
priorfn = { 'rv':rvprior }
model.set(z=np.mean(zminmax))
... | |
result = dict()
result['file_id'] = file_id
result['file_path'] = file_path
result['file_dir'] = file_dir
result['file_basename'] = file_basename
result['file_basename_noext'] = file_basename_noext
result['hawkeye_dir'] = hawkeye_dir
result['scanvid_basename'] = scanvid_basename
result['scanvid_path'] = scanvid... | |
import warnings
import numpy as np
import numpy.linalg as la
from numpy.random import Generator, PCG64
from modpy.optimize._optim_util import OptimizeResult, OptimizePath, _function, _chk_callable
from modpy.optimize._constraints import _prepare_constraints
ID_INFEASIBLE = -12
ID_MAX_SIGMA = -11
ID_TOL_... | |
outparts[:nparts]:
global_abs_in2out[abs_in] = abs_out
# if connection is contained in a subgroup, add to conns
# to pass down to subsystems.
if inparts[:nparts + 1] == outparts[:nparts + 1]:
new_conns[inparts[nparts]][abs_in] = abs_out
# Add implicit connections (only ones owned by this group)
for prom_name i... | |
data=json.dumps({"cfsid": configset}))
return self.client.get(url)
def upload_node_config(
self, path: str, node_id: str, config: str, configset: str = "default"
) -> Dict:
"""Upload node's startup config.
:param path: path to lab file (include parent folder)
:type path: str
:param node_id: node ID to upload ... | |
ntuniprot(RecName_Full='Probable ATP-dependent RNA helicase DHR2'),
'P36010' : ntuniprot(RecName_Full='Nucleoside diphosphate kinase {ECO:0000303|PubMed:5793714}'),
'P36012' : ntuniprot(RecName_Full='Histone H3-like centromeric protein CSE4'),
'P36013' : ntuniprot(RecName_Full='NAD-dependent malic enzyme, mitochondr... | |
<gh_stars>0
# Copyright 2021 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softw... | |
and len(pairedLensSorted) > 0:
id1 = 0
while not reads[id1][1] == j:
id1 += 1
startRead = reads[id1]
starts[reads[id1][0]] -= 1
ends[j] -= 1
del reads[id1]
foundRead = False
for r in range(len(pairedLensSorted)):
l = pairedLensSorted[r]
if j-l >= 0 and starts[j-l] > 0:
pairedLens[l] -= 1
if pairedLens[l... | |
<filename>bitmovin_api_sdk/models/muxing_information_video_track.py
# coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
import pprint
import six
class MuxingInformationVideoTrack(object):
@poscheck_model
def __init__(self,
index... | |
log tables used by the replica.
If the source is already present a warning is issued and no other action is performed.
"""
self.logger.debug("Checking if the source %s already exists" % self.source)
self.connect_db()
num_sources = self.check_source()
if num_sources == 0:
check_mappings = self.check_s... | |
msg = "error while retrieving NSR. " + error
send_response(msg, serv_id)
return
nsr = req['content']
if nsr['status'] == 'terminated':
error = 'nsr already terminated'
send_response(error, serv_id)
return
LOG.info("Termination request received for service " + str(serv_id))
self.terminate_workflow(serv_id,
... | |
"seclabel",
"gid=5",
"mode=620",
"ptmxmode=000"
]
},
"cgroup,/sys/fs/cgroup/systemd": {
"device": "cgroup",
"mount": "/sys/fs/cgroup/systemd",
"fs_type": "cgroup",
"mount_options": [
"rw",
"nosuid",
"nodev",
"noexec",
"relatime",
"xattr",
"release_agent=/usr/lib/systemd/systemd-cgroups-agent",
"name=s... | |
<filename>utlvce/test/test_score.py
# Copyright 2020 <NAME>
# 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... | |
node, 'WorkingDays')
self.WorkingDays = value_
self.WorkingDays_nsprefix_ = child_.prefix
elif nodeName_ == 'WorkingHours':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'WorkingHours')
value_ = self.gds_validate_string(value_, node, 'WorkingHours')
self.WorkingHours = value_
self.WorkingHou... | |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -----------------------------------------------------------------------... | |
from collections import Counter
from datetime import datetime
from operator import itemgetter
import re
from typing import List
from django.db import models
from django.conf import settings
from iteration_utilities import flatten
from django.utils.translation import gettext_lazy as _
from bills.templatetags.bill_filt... | |
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.397223,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 4.40769,
'S... | |
= vec_complex(np.random.normal(scale=std,
size=n),
np.random.normal(scale=std,
size=n))
noise_to_add = np.reshape(noise_to_add,
baseline_uvdata.shape)
baseline_uvdata += noise_to_add
self.uvdata[sl] = baseline_uvdata
self.sync()
# TODO: Optionally calculate noise by scans.
def error(self, average_freq=False,... | |
import sublime
import sublime_plugin
import datetime
import re
from pathlib import Path
import os
import fnmatch
import OrgExtended.orgparse.loader as loader
import OrgExtended.orgparse.node as node
import OrgExtended.orgparse.date as orgdate
from OrgExtended.orgparse.sublimenode import *
import OrgExtended.orgutil.ut... | |
<reponame>cwitkowitz/sporco
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2018 by <NAME> <<EMAIL>>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""Dictionary lear... | |
import copy
from igraph import Graph, plot
import numpy as np
from collections import Counter
class NetworkGraph:
"""
Class wrapping igraph functionality for the planning and debugging of source sink flow models. It strictly differs
between source and sink vertices which may be important for further analysis. It ... | |
#encoding=utf8
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless ... | |
from __future__ import annotations
from collections import Counter, deque
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from functools import partial
import hashlib
import json
import os
import os.path as op
from pathlib import Path
import random
from shutil import rmtree... | |
i in range(int(dims[0])):
for j in range(int(dims[2])):
sfs[i, :, j, :] = slv[4](sfs[i, :, j, :].reshape(dims[1] * dims[3])).reshape(dims[1], dims[3])
return sfs
def _ud2_4pop_6(sfs, slv, dims):
for i in range(int(dims[0])):
for j in range(int(dims[1])):
sfs[i, j, :, :] = slv[5](sfs[i, j, :, :].reshape(dims[2] *... | |
# -*- coding: utf-8 -*-
"""
A collection of function that are used to parse the output of Quantum Espresso PW.
The function that needs to be called from outside is parse_raw_output().
The functions mostly work without aiida specific functionalities.
The parsing will try to convert whatever it can in some dictionary, wh... | |
= {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(create_update_gremlin_graph_p... | |
= 2 * (prec + 4*bitcount(n) + 4)
_, pm, pe, pbc = fone
while 1:
if n & 1:
pm = pm*y
pe = pe+exp
pbc += bc - 2
pbc = pbc + bctable[int(pm >> pbc)]
if pbc > workprec:
pm = pm >> (pbc-workprec)
pe += pbc - workprec
pbc = workprec
n -= 1
if not n:
break
y = y*y
exp = exp+exp
bc = bc + bc - 2
bc = bc + bct... | |
error case
return False
@ida_entry_point
def ev_out_insn(self, ctx):
"""
must not change the database.
args:
ctx (object): has a `.insn` field.
"""
insn = ctx.insn
ea = insn.ea
# if this is the start of a function, render the function prototype.
# like::
#
# code:082E $func8:
# code:... | |
<reponame>NeCTAR-RC/gnocchi<filename>gnocchi/rest/__init__.py<gh_stars>0
# -*- encoding: utf-8 -*-
#
# Copyright © 2014-2015 eNovance
#
# 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:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.