input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>src/microstructpy/meshing/trimesh.py
"""Triangle/Tetrahedron Meshing
This module contains the class definition for the TriMesh class.
"""
# --------------------------------------------------------------------------- #
# #
# Import Modules #
# #
# -------------------------------------------------------------... | |
qty, uom_id in lines:
prod = get_model("product").browse(prod_id)
line_vals = {
"product_id": prod_id,
"description": prod.description or "/",
"qty": qty,
"uom_id": uom_id,
"unit_price": prod.purchase_price or 0,
"tax_id": prod.purchase_tax_id.id,
"sale_id": obj.id,
}
purch_vals["lines"].append(("create", li... | |
from __future__ import absolute_import, division, print_function
# LIBTBX_SET_DISPATCHER_NAME phenix.model_idealization
import sys, os
import datetime
from time import time
from libtbx.utils import Sorry, multi_out, null_out
from libtbx import easy_pickle, group_args
import libtbx.load_env
from scitbx.array_family imp... | |
# -*- coding:utf-8 -*-
#
# Tencent is pleased to support the open source community by making QTA available.
# Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may not use this
# file except in compliance with the License. You may ... | |
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
_tout.stream(tl)
#######################################
TestContext.TraceStream.TraceStream(std.ostream o, TraceLevel tl):
_traceLevel(tl),
_outputStreamPtr(o),
#if defined(WIN32) and not (defined(__CYGWIN__) or defined(__MINGW32__))
_nullStream("nul")
#else:
_nullStream("/dev/null")
#endif
TestContext.TraceSt... | |
set to true, it also
calls the 'clean_up_ramdisk' method of boot interface to clean up
the environment that was set for booting agent ramdisk.
3. Deletes the cleaning ports which were setup as part
of cleaning.
:param task: a TaskManager object containing the node
:param manage_boot: If this is set to True, this... | |
<reponame>ArdanaCLM/storevirtual-installer
#!/usr/bin/python
#
# (c) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Datasets
==================
Classes for dataset handling
Dataset - Base class
^^^^^^^^^^^^^^^^^^^^
This is the base class, and all the specialized datasets are inherited from it. One should never use base class itself.
Usage examples:
.. code-block:: python
:lineno... | |
#!/usr/bin/env python
'''
This file is part of the PyMSRPC project and is licensed under the
project license.
ndr.py
This are the functions that provide all the NDR data types. It handles
serialization and everything. I have spent a shit load of time on this and
yet they are not 100%. This is usually due to s... | |
True)
if not outs:
return
for out in outs:
if not core.is_a_shape(out):
shapes = core.get_shapes(out)
if shapes:
out = shapes[0]
if cmds.nodeType(out) == 'nRigid':
slot = attr.get_available_slot('%s.inputPassive' % nucleus)
cmds.connectAttr('%s.currentState' % out, '%s.inputPassive[%s... | |
*unknown*\*unknown* (8)
S-1-5-82-3006700770-424185619-1745488364-794895919-528 *unknown*\*unknown* (8)
S-1-5-82-3006700770-424185619-1745488364-794895919-529 *unknown*\*unknown* (8)
S-1-5-82-3006700770-424185619-1745488364-794895919-530 *unknown*\*unknown* (8)
S-1-5-82-3006700770-424185619-1745488364-794895919-531 *unk... | |
<gh_stars>0
from __future__ import print_function
from __future__ import absolute_import
import functools
import numpy as np
import pandas as pds
from pysat import Series, DataFrame
class Orbits(object):
"""Determines orbits on the fly and provides orbital data in .data.
Determines the locations of orbit breaks ... | |
60)
(a *in_* Pair(a, a)) @ (21, BY_THEOREM, "left_in_pair", 0)
(a *in_* Pair(c, c)) @ (22, REPLACE, 21, 20)
((a *in_* Pair(c, c)) == (a == c)) @ (23, BY_THEOREM, "element_of_singleton", 0)
(a == c) @ (24, TAUTOLOGY, 23, 22)
with (d == a) @ 58:
(a *in_* Pair(a, a)) @ (59, BY_THEOREM, "left_in_pair", 0)
(d *in_*... | |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
import abc
from threading import Lock
from typing import cast, Dict, Iterable, Optional, TYPE_CHECKING
from cdm.enums import CdmObjectType
if TYPE_CHECKING:
fro... | |
على خريطة). أدخل بعض الحروف للبحث من المواقع المتوفرة.',
"The Donor(s) for this project. Multiple values can be selected by holding down the 'Control' key.": "المانحون لهذا المشروع. يمكن تحديد قيم متعددة بضغط مفتاح 'المراقبةl' .",
'The Email Address to which approval requests are sent (normally this would be a Group ... | |
variable each.
# So a line parameter is incompatible.
if lines is not None:
if panel_type == Panel.TYPE_TIMEHEIGHT:
logToFile('Warning. Panel type is time-height but a lines argument was found in for variable ' +
str(all_model_var_names[model_name]) + '. Those are not compatible. Ignoring lines.')
else:
for line... | |
<filename>py3avi2bdnxml.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Description:
py3avi2bdnxml.py converts the imageTimings.srt produced by AVISubDetector
to a BDN XML file that can be read by BDSup2Sub++.
[AVISubDetector URL]
[BDSup2Sub++URL]
The idea is to rip hardsubs into BD PGS (.sup) fi... | |
= 0x49A3
MediaGaugeD164 = 0x49A4
MediaGaugeD165 = 0x49A5
MediaGaugeD166 = 0x49A6
MediaGaugeD167 = 0x49A7
MediaGaugeD168 = 0x49A8
MediaGaugeD169 = 0x49A9
MediaGaugeD170 = 0x49AA
MediaGaugeD171 = 0x49AB
MediaGaugeD172 = 0x49AC
MediaGaugeD173 = 0x49AD
MediaGaugeD174 = 0x49AE
MediaGaugeD175 = 0x49AF
MediaGauge... | |
IRIs.
:return: Server response that is a nested dictionary format
>>> self.update_entity( \
ilx_id='ilx_0101431', \
label='Brain', \
type='term', # options: term, pde, fde, cde, annotation, or relationship \
definition='Official definition for entity.', \
comment='Additional casual notes for the next person.', ... | |
<reponame>albertlee0622/AddHansModelToFRE
import os
import sys
import csv
import time
import numpy as np
import pandas as pd
import random
import json
from system.utility.config import ClientConfig
from system.sim_trading.network import PacketTypes, Packet
from system.market_data.fre_market_data import EODMarketData
fr... | |
<reponame>joaomcm/Klampt
"""Klampt kinematics AD functions:
==================== ============= ======================================
Function Derivative Notes
==================== ============= ======================================
WorldPosition 1,2 wp[link,localPos](q) -> R^3
WorldDirection 1,2 wd[link,localDi... | |
#!/usr/bin/python
import math
import sys
import os
import re
import subprocess
import numpy as np
import pandas as pd
import argparse
import operator
import mxnet as mx
import struct
import cv2
from collections import namedtuple
import scipy.io
import matplotlib.pyplot as plt
import matplotlib as mpl
import pylab
impo... | |
annotation_meta=None):
image.data = cv2.flip(image.data, self.mode)
image.metadata.setdefault(
'geometric_operations', []).append(GeometricOperationMetadata('flip', {'mode': self.mode}))
return image
class Crop(Preprocessor):
__provider__ = 'crop'
@classmethod
def parameters(cls):
parameters = super().parame... | |
<filename>pybluez/macos/_obexcommon.py
# Copyright (c) 2009 <NAME>. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 th... | |
+ "..."
cbdebug(_msg, True)
self.get_network_list(vmc_name, vm_defaults)
_prov_netname_found = False
_run_netname_found = False
if _prov_netname in self.networks_attr_list :
_net_model = self.networks_attr_list[_prov_netname]["model"]
_net_type = self.networks_attr_list[_prov_netname]["model"]
if _net_mod... | |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# LightNet++: Boosted Light-weighted Networks for Real-time Semantic Segmentation
# ---------------------------------------------------------------------------------------------------------------- #
# Co... | |
Optional[bool]:
pass
@mark_no_op
def visit_BitAnd_whitespace_before(self, node: "BitAnd") -> None:
pass
@mark_no_op
def leave_BitAnd_whitespace_before(self, node: "BitAnd") -> None:
pass
@mark_no_op
def visit_BitAnd_whitespace_after(self, node: "BitAnd") -> None:
pass
@mark_no_op
def leave_BitAnd_whites... | |
<gh_stars>1-10
import math
from enum import Enum
from numpy.random.mtrand import randint
from pydesim import Model, Statistic, Trace
from pycsmaca.simulations.modules import NetworkPacket
class PDUBase:
class Type(Enum):
DATA = 0
ACK = 1
@property
def size(self):
raise NotImplementedError
@property
def ty... | |
* (x - x0) ** 2 / sigma_x ** 3
dydy0 = value * (y - y0) / sigma_x ** 2
return np.vstack((dydamp, dydx0, dydy0, dydsigmax, np.ones_like(value))).T
# new_params = np.insert(params, 4, 0)
# new_params = np.insert(new_params, 4, params[3])
# return np.delete(cls.gauss2D_jac(new_params, xdata), (4, 5), axis=0)
@class... | |
"""EnrollmentTerms API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from .base import BaseCanvasAPI
from .base import BaseModel
class EnrollmentTermsAPI(BaseCanvasAPI):
"""EnrollmentTerms API Version... | |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import functools
import imp
import importlib
import inspect
import itertools
import logging
import os
import pkg_resources
import re
import sys
import time
import types
import unittest
import threading
from op... | |
rest))
return base, symlink, rest
if index == len(relfile):
break
index += 1
return relfile, None, None
def kill_children_processes(root):
"""Not yet implemented on posix."""
# pylint: disable=unused-argument
return False
def relpath(path, root):
"""os.path.relpath() that keeps trailing os.path.sep."""
o... | |
i64.trunc_f32_u
"""
# TODO: in theory this should be solvable in ir-code.
opcode = instruction.opcode
self._runtime_call(opcode)
def gen_const_instruction(self, instruction):
""" Generate code for i32.const and friends. """
opcode = instruction.opcode
value = self.emit(
ir.Const(instruction.args[0], "const", ... | |
<filename>moto/route53/responses.py
"""Handles Route53 API requests, invokes method and returns response."""
from functools import wraps
from urllib.parse import parse_qs, urlparse
from jinja2 import Template
import xmltodict
from moto.core.responses import BaseResponse
from moto.route53.exceptions import Route53Clie... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Data61, CSIRO
#
# 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 o... | |
import numpy
def assign2D(C, maximize=False):
# ASSIGN2D:
# Solve the two-dimensional assignment problem with a rectangular
# cost matrix C, scanning row-wise. The problem being solved can
# be formulated as minimize (or maximize):
# \sum_{i=1}^{numRow}\sum_{j=1}^{numCol}C_{i,j}*x_{i,j}
# subject to:
# \sum_{j... | |
<reponame>dperl-sol/cctbx_project<gh_stars>0
from __future__ import absolute_import, division, print_function
import cctbx.array_family.flex # import dependency
import boost_adaptbx.boost.python as bp
from six.moves import zip
from six.moves import range
ext = bp.import_ext("mmtbx_ncs_ext")
from scitbx.array_family imp... | |
from swsscommon import swsscommon
import os
import sys
import time
import json
import pytest
from distutils.version import StrictVersion
def create_entry(tbl, key, pairs):
fvs = swsscommon.FieldValuePairs(pairs)
tbl.set(key, fvs)
# FIXME: better to wait until DB create them
time.sleep(1)
def remove_entry_tbl(db,... | |
* level + '{\n'
text += '\t' * (level + 1)
text += '"caption": "%s",\n' % index_letter
text += '\t' * (level + 1)
text += '"id": "stino_example_cat_%s_%s",\n' % (level,
index_letter)
text += '\t' * (level + 1)
text += '"children":\n'
text += '\t' * (level + 1)
text += '[\n'
text += '\t' * (level + 2)
text +=... | |
<filename>ros_model_extractor.py
#!/usr/bin/env python
#
# Copyright 2019 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# <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 t... | |
the default subnetpool for ``ip_version`` to obtain a CIDR. It
is required to pass ``None`` to the ``cidr`` argument when enabling
this option.
:param kwargs: Key value pairs to be passed to the Neutron API.
:returns: The new subnet object.
:raises: OpenStackCloudException on operation error.
"""
if tenant_id ... | |
tensor's elements across a specified axis or a list of specified axes.
Args:
x (Tensor): input tensor.
axis (int,list): axis along which the reduction will be performed
keepdims (bool): Keep the reduced dimension or not, default True mean keep reduced dimension
**kwargs ():
Returns:
The sum of the input tensor... | |
# Certainly prime or not prime.
return (method.__name__, flag)
assert flag == 2 # Unsure.
return (method.__name__, flag)
def is_probable_prime(self, n):
"""xxx
"""
return self._check_primality(n)[1]
def __call__(self, n):
"""Instrumented version of the ``is_probable_prime`` method."""
name, flag = self._che... | |
<reponame>oraclecode-moonsun/bmcs-cli<filename>tests/test_object_storage.py<gh_stars>0
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
import click
from datetime import datetime, timedelta
import json
import math
import os
import pytest
import re
import oraclebmc_cli
from... | |
<gh_stars>1-10
import click
import pandas as pd
import numpy as np
import os
import cv2
import skvideo.io
import sys
import time
import tempfile
import tensorflow as tf
import xlsxwriter
import json
from PIL import Image
from luminoth.tools.checkpoint import get_checkpoint_config
from luminoth.utils.config import get_... | |
intervals of the ordering.
INPUT FORMAT (file bcount.in):
The first line of input contains N and Q (1≤N≤100,000, 1≤Q≤100,000).
The next N lines contain an integer that is either 1, 2, or 3, giving the breed ID of a single cow in the ordering.
The next Q lines describe a query in the form of two integers a,b (a≤b).
OU... | |
40, 40], dtype=np.float64),
avg_color + np.array([20, 30, 50], dtype=np.float64))
for i in range(maskHSV.shape[0]):
t = maskHSV[i].nonzero()[0].flatten()
if t.size > 1:
maskHSV[i, t[0]:t[-1]] = 255
masked_HSV = cv2.bitwise_and(img_HSV, img_HSV, mask=maskHSV)
# set img
new_img = masked_HSV.copy().astype(np.float... | |
1
final_argument_whitespace = True
option_spec = {
'scale' : rst.directives.unchanged,
'label' : rst.directives.unchanged,
'position' : rst.directives.unchanged,
'offset' : rst.directives.unchanged,
}
has_content = True
def run(self):
node_list = []
# Unlike a normal image, our reference will come from th... | |
files','Please load images to process')
return
file=self.file
path=self.exportpath
suggsize=8
smallfont=ImageFont.truetype('cmb10.ttf',size=suggsize)
# kernersizes={}
# for file in batch_filenames:
labeldict=self.batch_results[file][0]
itervalue='iter0'
labels=labeldict[itervalue]['labels']
counts=labeldict[... | |
from __future__ import print_function
from romspline.__init__ import state
if state._MATPLOTLIB:
import matplotlib.pyplot as plt
if state._PARALLEL:
from concurrent.futures import ProcessPoolExecutor, wait, as_completed
from multiprocessing import cpu_count
import numpy as np
import romspline.greedy as greedy
... | |
mil habitantes"
):
# Ver metodologia do SimulaCovid: a capacidade hospitalar é projetada com os dados mais recentes da doença no município, regional ou estado.
st.write(
"""<div class="base-wrapper">Desde final de 2020 notamos que o modelo
passou a calcular valores muito abaixo do que observamos na realidade -
... | |
[c_uint32, c_uint16]
api.ScpChTrSetLevelMode.restype = c_uint32
api.ScpChTrSetLevelMode.argtypes = [c_uint32, c_uint16, c_uint32]
api.ScpChTrGetLevelCount.restype = c_uint32
api.ScpChTrGetLevelCount.argtypes = [c_uint32, c_uint16]
api.ScpChTrGetLevel.restype = c_double
api.ScpChTrGetLevel.argtypes = [c_uint32, c_... | |
import json
import logging
import math
import os
import pathlib
import subprocess
import numpy as np
import shapely.geometry
import shapely.affinity
import venn7.bezier
ROOT = pathlib.Path(os.path.realpath(__file__)).parent
class VennDiagram:
"""A simple symmetric monotone Venn diagram. The diagram is encoded dis... | |
MagicWordConfig.EXEC_LOC_SERVER
accessLevel = 'MODERATOR'
def handleWord(self, invoker, avId, toon, *args):
boss = None
from toontown.suit.DistributedLawbotBossAI import DistributedLawbotBossAI
for do in simbase.air.doId2do.values():
if isinstance(do, DistributedLawbotBossAI):
if invoker.doId in do.involvedToon... | |
if the table already exists, returns it."""
where_node = self._hdf5file.get_node(where)
if not tablename in where_node:
if not expectedrows is None:
table = self._hdf5file.create_table(where=where_node, name=tablename,
description=description, title=tablename,
expectedrows=expectedrows,
filters=self._all_get_fi... | |
"""
The MIT License (MIT)
Copyright © 2018 <NAME> & HC² (www.hc2.fr)
"""
from ustruct import pack, unpack
from ubinascii import hexlify
class BLEAdvReader :
# ============================================================================
# ===( Constants )===========================================================... | |
# coding: utf-8
from __future__ import unicode_literals
from datetime import datetime
import json
import hashlib
from inspect import getsource
import random
import re
import time
from .common import InfoExtractor, SearchInfoExtractor
from ..compat import (
compat_chr,
compat_kwargs,
compat_parse_qs,
compat_urllib... | |
import re
import os
import pandas as pd
import numpy as np
from .extract_tools import default_tokenizer as _default_tokenizer
def _getDictionnaryKeys(dictionnary):
"""
Function that get keys from a dict object and flatten sub dict.
"""
keys_array = []
for key in dictionnary.keys():
keys_array.append(key)
if (... | |
<reponame>foo-dogsquared/texture-notes<filename>scripts/manager.py
# native packages
from datetime import date
from functools import reduce
import logging
from multiprocessing import cpu_count
from os import chdir, getcwd
from os.path import relpath
from shutil import copy, copytree, rmtree
from pathlib import Path
fro... | |
<gh_stars>0
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
import base64,time,random,hashlib,json,re,django,platform
from . import server_helper,match,view,web_socket,search_process,GlobalVar,anticheatz
from www.index import player... | |
an element to the mesh
:param element:
:return:
"""
self.elements.append( element )
lg.info( 'add_element: %s element added, node ids are %s', element.element_type( ), element.node_ids )
def add_elements( self, element_list ):
""" Add a list of elements to the mesh
:param element_list:
:return:
"""
for e... | |
self.common_headers is not None:
result['commonHeaders'] = self.common_headers
if self.x_acs_dingtalk_access_token is not None:
result['x-acs-dingtalk-access-token'] = self.x_acs_dingtalk_access_token
return result
def from_map(self, m: dict = None):
m = m or dict()
if m.get('commonHeaders') is not None:
self.... | |
# Copyright 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""
Common infrastructure fo... | |
# 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, software
# distributed under the Li... | |
noinspection PyPep8Naming
class BinaryThresholdEncoder(BaseTransformer):
"""Implements binary encoding using a threshold function.
Parameters
----------
threshold_enc : int or str
Threshold for the binary encoder. Default 0.
'auto' will set threshold_enc to feature-wise median of the data passed to the fit funct... | |
"reversed"
if eucl["axis_y"]["o_arrow"]["tip"] == 'none':
return_string += '\\tikzset{yaxe style/.style={-}}\n'
else:
if eucl["axis_y"]["o_arrow"]["direction"]:
return_string += '\\tikzset{yaxe style/.style={arrows={-%s[%s]}}}\n' % (o_arrow_name, o_arrow_options)
else:
return_string += '\\tikzset{yaxe style/.st... | |
<reponame>unmonoqueteclea/python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2021 BigML
#
# 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
#
# Unles... | |
If ``n`` is an integer rather than a multi-index, then the
total degree is used in that case as well.
EXAMPLES::
sage: A.<a,b,c> = GradedCommutativeAlgebra(QQ, degrees=((1,0), (0, 1), (0,2)))
sage: B = A.cdg_algebra(differential={a: c})
sage: B.cohomology_raw((0,2))
Vector space quotient V/W of dimension 0 over... | |
+= "neighbor {} route-map {} in \n".format(kwargs['peer_grp_name'], kwargs['routemap'])
command += "exit\n"
command += "exit\n"
st.config(dut, command, type='vtysh')
elif cli_type == 'klish':
cmd = "peer-group {} \n".format(kwargs['peer_grp_name'])
cmd += "remote-as {} \n".format(kwargs['remote_asn'])
if 'keep_a... | |
<gh_stars>1-10
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program ... | |
piE_N
params['q'] = q
params['sep'] = sep
params['phi'] = phi
params['b_sff'] = b_sff1
params['mag_src'] = mag_src1
out_name = outdir + outroot + '_movie.gif'
if animate:
ani = plot_models.animate_PSBL(psbl, outfile=out_name)
else:
ani = None
return data, params, psbl, ani
def fake_data_multiphot_parallax... | |
dwell_time = self.ovm[ov_index].dwell_time
pixel_size = self.ovm[ov_index].pixel_size
dose = utils.calculate_electron_dose(
current, dwell_time, pixel_size)
if (min_dose is None) or (dose < min_dose):
min_dose = dose
if (max_dose is None) or (dose > max_dose):
max_dose = dose
total_z = (self.number_slices * se... | |
as reference
ind_idiff_epiref_v_bn[i] = sum(sub_rho_v_bn[0:ns_t1,(ns_t1):(2*ns_t1)][i,i]>sub_rho_v_bn[0:ns_t1,(ns_t1):(2*ns_t1)][i,np.setdiff1d(range(ns_t1),i)])/(ns_t1-1)
ind_idiff_epiref_v_gm[i] = sum(sub_rho_v_gm[0:ns_t1,(ns_t1):(2*ns_t1)][i,i]>sub_rho_v_gm[0:ns_t1,(ns_t1):(2*ns_t1)][i,np.setdiff1d(range(ns_t1),i)... | |
0xbf3d, 0x3f17, 0xbefd,
0xbe88, 0x3e98, 0x3ea3, 0x3f22, 0xbca7, 0xbd31, 0x3de3, 0xbf39, 0x3ede, 0xbf3d,
0x3eb2, 0x3d86, 0x3e12, 0xbbbc, 0x3c4e, 0x3d9e, 0x3e17, 0xbf27, 0x3e75, 0xbebf,
0x3cda, 0xbf10, 0x3e95, 0x3f0f, 0xbe83, 0x3f4e, 0xbe35, 0xbf06, 0x3e6d, 0xbecd,
0x3dfd, 0x3ed1, 0xbe01, 0xbd75, 0x3ed1, 0x3ebb, 0xbd... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/frames/frames.py
# Module with decoration of TDataFrame objects for efficient use in python
# @author <NAME> <EMAIL>
# @date 2018-06-16
# =========================================... | |
_agent, False
]
assert agree[0:5] == [_issuer, _amount_take, _price, True, False]
assert balance_maker == 0
assert balance_taker == deploy_args[2]
assert commitment == 0
# エラー系1
# 入力値の型誤り(_orderId)
def test_cancelAgreement_error_1(users, bond_exchange):
_agent = users['agent']
# 決済非承認:決済業者
with pytest.raise... | |
The details used to update alert status.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.data_safe.models.Alert.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.data_safe.DataSafeClient.updat... | |
A dataset consisting of sub-datasets, to be indexed together. """
def __init__(self, datasets):
""" datasets to index together, result will be concatenated in one list """
for xe in datasets:
assert(len(xe) == len(datasets[0]))
super(MultiDatasets, self).__init__()
self.datasets = datasets
def __getitem__(self,... | |
<filename>baseline/src/module/train.py<gh_stars>0
import numpy as np
import torch
from torch.cuda.amp import GradScaler
from transformers.optimization import AdamW
from transformers.optimization import get_linear_schedule_with_warmup, get_constant_schedule_with_warmup, get_constant_schedule
import os
import sys
import ... | |
<gh_stars>100-1000
"""pypyr context class. Dictionary ahoy."""
from collections import namedtuple
from collections.abc import Mapping, Set
from pypyr.dsl import SpecialTagDirective
from pypyr.errors import KeyInContextHasNoValueError, KeyNotInContextError
from pypyr.formatting import RecursiveFormatter
from pypyr.modu... | |
in dc_map:
device_capability_ids.append(dc_map[dc])
else:
raise BadSettingException("Invalid Device Capability: {} ".format(dc))
# Get (or potentially create) the advertiser.
advertiser_id = dfp.get_advertisers.get_advertiser_id_by_name(
advertiser_name, advertiser_type)
# Create the order.
order_id = dfp.cr... | |
dist_record['price'] = order.price
dist_record['operation'] = 'sell-part'
self.save_dist(dist_record)
del self.uncompletedOrders[orderkey]
self.entrust = 0
# ----------------------------------------------------------------------
def onStopOrder(self, orderRef):
"""停止单更新"""
self.writeCtaLog(u'{0},停... | |
<gh_stars>0
# -*- coding: UTF-8 -*-
from django.http import HttpResponse, HttpResponseBadRequest
from .myparser import *
from xml.etree.ElementTree import Element, tostring, fromstring
from django.utils import timezone
from django.db.models import Q
from django.db.models.query import QuerySet
from django.db import tran... | |
# Copyright (c) 2021, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but no... | |
#!/usr/bin/python
import os
import sys
gem5home = os.getcwd()
specint_dir = "benchmarks/spec2k6bin/specint"
scriptgen_dir = gem5home + "/scriptgen"
results_dir = gem5home + "/results"
stdout_dir = gem5home + "/stdout"
stderr_dir = gem5home + "/stderr"
specint = ['bzip2', 'gcc', 'mcf', 'gobmk', 'hmmer', 'sjeng', 'lib... | |
<filename>distance_matching.py
# Personalized Regression with Distance Matching Regularization
import numpy as np
np.set_printoptions(precision=4)
import time
from utils import *
from sklearn.preprocessing import normalize
from multiprocessing.pool import ThreadPool
class DistanceMatching():
def __init__(self, init... | |
depth, index, req, perform_checks):
assert self.kind == SINGLE_TASK_KIND
if req.is_no_access():
return True
mappings = self.find_mapping(index, req.parent)
for field in req.fields:
assert field.fid in mappings
inst = mappings[field.fid]
# skip any virtual mappings
if inst.is_virtual():
continue
if not req.lo... | |
and color_table != None:
print(('Updating color table for:',image))
# b.SetRasterColorInterpretation(gdal.GCI_PaletteIndex)
b.SetRasterColorTable(color_table)
if names != '' and names != None:
print(('Updating names for:',image))
b.SetRasterCategoryNames(names)
rast = None
b = None
###########################... | |
<filename>iob2DynaML.py
from math import sqrt
import math
import numpy
from numpy import matmul
from math import sin, cos, radians
import sys,datetime, os
class DnaStation:
def __init__(self):
self.name = ''
self.Constraint=''
self.Type=''
self.XAxis=''
self.YAxis=''
self.Height=''
self.Descript... | |
# Copyright 2006 <NAME> and contributors
#
# 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 w... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
# import numpy as np
from number_objects.primitives.polycalc_numbers import Rational, Integer
from number_objects.primitives.vector import Vector
# Todo: Cholesky decomposition, singlular value decomposition, eigen values
class Matrix(list):
def __float__(self):
assert self.shape == (1, 1)
return float(self[0][0... | |
| Id | Type | Description |
+=======+=========+====================================================+
| fopts | OT_DICT | Options to be passed to generated function objects |
+-------+---------+----------------------------------------------------+
--------------------------------------------------------------------... | |
<gh_stars>1000+
# Cast column to f64 before convert it to pandas
# This is a hack, use the assert_equal comparator when nulls is
# fully supported on cudf.sort_values
import json
import logging
import os
import re
import time
import yaml
import numpy as np
import pandas as pd
import blazingsql
from blazingsql import ... | |
performance I'm going to assume that the only
# field that needs *updating* would be the joined_at field.
# If there is no Member object (for some strange reason), then we can upgrade
# ourselves to a more "partial" member object.
author = self.author
try:
# Update member reference
author._update_from_message(me... | |
bool
macaroon : Macaroon
url : str
Returns -> None
'''
if channel is not None and not isinstance(channel, (bytes, str)):
raise Exception("Expected channel to be a str, received: {}".format(type(channel)))
if force is not None and not isinstance(force, bool):
raise Exception("Expected force to be a bool, receiv... | |
<reponame>redfrexx/osm_association_rules<filename>src/nb_utils/association_rules.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functions used for association rule mining
"""
__author__ = "<NAME>, GIScience Research Group, Heidelberg University"
__email__ = "<EMAIL>"
import numpy as np
import pandas a... | |
IQBRIMSPath(
'/sharing/editable_gdoc',
_ids=['1', '2', metadata_body['id']]
)
revision_body = sharing_fixtures['editable_gdoc']['revision']
revision_url = provider.build_url('files', metadata_body['id'],
'revisions', self.GDOC_GOOD_REVISION)
aiohttpretty.register_json_uri('GET', revision_url, body=revision_body... | |
import irc3
import shelve
import time
import os
#import psycopg2
from random import randint
from random import choice
from irc3.plugins.command import command
@irc3.plugin
class Henk:
def __init__(self, bot):
self.bot = bot
self.directory = './data/deks/'
if not os.path.exists(self.directory):
os.makedirs(se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.