input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import os
import sys
from time import time as timer
import gym
import numpy as np
import numpy.random as rd
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
"""
2019-07-01 Zen4Jia1Hao2, GitHub: Yonv1943
2019-08-01 soft_update
2019-10-10 spectral normalization (should... | |
<gh_stars>1-10
"""
Helpers for Artifactory or local big data handling.
"""
import copy
from datetime import datetime
import json
import os
import re
import shutil
from difflib import unified_diff
from io import StringIO
try:
from astropy.io import fits
from astropy.io.fits import FITSDiff, HDUDiff
from astropy.util... | |
'permitted-object-type': 'object-class',
'include-members': False,
'view-only-mode': True,
},
),
]
for input_permission, removed_permission in testcases:
self._test_remove_one(input_permission, removed_permission)
def _test_remove_one(self, input_permission, removed_permission):
# Add a user-defined User Rol... | |
init_scratchpad_ints, init_p1_pos, init_p2_pos, init_p3_pos, init_stack, init_temp_vars, counter = init_state
init_scratchpad_ints, init_p1_pos, init_p2_pos, init_p3_pos, init_stack, init_temp_vars, counter \
= partition_update(init_scratchpad_ints.copy(), init_p1_pos, init_p2_pos, init_p3_pos, init_stack.copy(), in... | |
SIGN AB029',
67101: 'LINEAR A SIGN AB030',
67102: 'LINEAR A SIGN AB031',
67103: 'LINEAR A SIGN AB034',
67104: 'LINEAR A SIGN AB037',
67105: 'LINEAR A SIGN AB038',
67106: 'LINEAR A SIGN AB039',
67107: 'LINEAR A SIGN AB040',
67108: 'LINEAR A SIGN AB041',
67109: 'LINEAR A SIGN AB044',
67110: 'LINEAR A SIGN AB045',
67111: ... | |
@staticmethod
def execute(parser, args):
client = etast.GoogleDriveStorageClient(chunk_size=args.chunk_size)
client.download_files_in_folder(
args.folder_id,
args.local_dir,
skip_failures=args.skip_failures,
skip_existing_files=args.skip_existing,
recursive=args.recursive,
)
class GoogleDriveDeleteCommand(C... | |
Publisher.
# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's H... | |
by Gene class instance at first occurance
of a mutation (for any sample) in a particular location.
The mutations are contained in mismatch_dict and
keyed by sample name.
"""
def __init__(self, mutation, genome, gene_instance):
self.genome = genome
self.position = mutation.position
self.chr_num = mutation.chr_n... | |
group is invalid. The file has uploaded without property
groups.
"""
_catch_all = 'other'
# Attribute is overwritten below the class definition
other = None
@classmethod
def path(cls, val):
"""
Create an instance of this class set to the ``path`` tag with value
``val``.
:param UploadWriteFailed val:
:rty... | |
# -*- coding: utf-8 -*-
# Copyright 2018 Whitestack, 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 of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | |
torch.Tensor: The 3D tensor of connections that coordinates the layer-to-layer
transformation.
"""
device = DEV if device is None else device
hw = width*width
if connections == Connections.FULLY_CONNECTED:
ell = (branches.width-1)//2
else:
ell = (int(math.sqrt(connections.value))-1)//2
ells = range(-ell,ell+1)... | |
<reponame>cs17resch01003/gpurepair
"""Module for parsing GPUVerify command line arguments"""
import argparse
import os
import subprocess
from .constants import AnalysisMode, SourceLanguage, SolverType
from .error_codes import ErrorCodes
from .util import is_hex_string, is_positive_string, GlobalSizeError, \
get_num_... | |
for
the MultiIndex
"""
@property
def items(self):
return self.columns
@property
def _constructor(self):
return LongPanel
def __len__(self):
return len(self.index)
def __repr__(self):
return DataFrame.__repr__(self)
@classmethod
def fromRecords(cls, data, major_field, minor_field,
exclude=None):
"""... | |
self.rodlist[index+1]
self.coins = self.coins - pricelist[index]
print("""
Thank you for your payment!
Your rod has been upgraded to {0}.
Your current coin balance is: ${1}.
""".format(namelist[index],self.coins))
#message that he receives if he does not have enough money
else:
print("""
... | |
# encoding: utf-8
import datetime
import copy
from nose.tools import assert_equal
from ckan.lib.dictization import model_dictize
from ckan import model
from ckan.lib import search
from ckan.tests import helpers, factories
class TestGroupListDictize:
def setup(self):
helpers.reset_db()
search.clear_all()
def... | |
k in range(2, 13):
for l in range(3, 13):
for m in range(4, 13):
if m == l + 1 and l == k + 1 and k == j + 1 and j == i + 1:
STRAIGHT_CHDHD.append({C[i], H[j], D[k], H[l], D[m]})
STRAIGHT_CHDHD.append({C[9], H[10], D[11], H[12], D[0]})
STRAIGHT_CHDDS = []
for i in range(13):
for j in range(1, 13):
for k in range... | |
<reponame>adematti/pypower
import os
import tempfile
import pytest
import numpy as np
from matplotlib import pyplot as plt
from cosmoprimo import Cosmology
from mockfactory import Catalog
from pypower import (CorrelationFunctionSmoothWindow, PowerSpectrumSmoothWindow, Projection,
BaseMatrix, CorrelationFunctionSmoo... | |
from collections import OrderedDict
from torch.nn import AvgPool2d, Linear, ModuleList
from cnn.MixedFilter import Block
from cnn.MixedFilter import MixedConvBNWithReLU as MixedConvWithReLU
from cnn.MixedFilter import MixedConvBN as MixedConv
from cnn.MixedLayer import MixedLayerNoBN as MixedLayer
from cnn.models imp... | |
<filename>test/test_selection_table.py
import pytest
import os
import ketos.data_handling.selection_table as st
import pandas as pd
import numpy as np
from io import StringIO
current_dir = os.path.dirname(os.path.realpath(__file__))
path_to_assets = os.path.join(os.path.dirname(current_dir),"assets")
path_to_tmp = os... | |
in the email template can be
passed using the kwargs
for action_type == 'group_membership', an instance of GroupMembershipRequest and
instance of Group are expected to
be passed into this function
"""
email_to = kwargs.get('group_owner', user)
context = {'request': request, 'user': user}
if action_type == 'gro... | |
<gh_stars>10-100
import queue
from .utils import TupleSortingOn0, to_percent
def is_job_bb(l):
t = l['orig']
if '.bb.' in t['tr_using_worker']:
return True
return False
def is_job_gce(l):
t = l['orig']
if 'gce' in t['tr_worker_instance']:
return True
return False
def is_job_image_same(l):
t = l['orig']
... | |
id='debt-asset',
children='N/A',
style={
'font-size': '1.25em',
'font-family': 'Courier New, Times, Helvetica',
'color': '#ffffff',
'margin-left': '1em',
'margin-top': '0',
'margin-bottom': '0'
}
),
html.Hr()
],
style={
'width':'48.5%',
'height':'500px',
'float': 'right',
'margin-right':'1%',
'margin-... | |
in results]) / 100.0
)
rollout.set_perf(reward, name="reward")
rollout.set_perf(
np.mean([res.eval_acc1es["ori-test@199"] for res in results]) / 100.0,
name="partial_test_acc",
)
rollout.set_perf(
np.mean(
[
res.eval_acc1es["ori-test@199"]
for res in query_res.query("cifar10").values()
]
)
/ 100.0,
name=... | |
= partition_round
def multiple_round(elms, percent, multiples, **kwargs):
"""
Partitions such that the partitioned datasets are multiples of given number.
:param elms: Total number of elements of buffer
:type elms: Integer
:param percent: Percentage of problem space to be processed by one device
:type percent:... | |
'M2a=', self.M2a
else:
####################################################
# Here only for 3d's where spin-orbit is neglected #
####################################################
self.Q3d=True
self.bi=[] # band index
self.sz=[] # sz
for i in range(self.Nband):
self.sz.append(1);
self.bi.append(i);
for i ... | |
This value will typically be smaller than the aperture time used for measurements.
Note: For smaller ranges, the value is scaled up to account for noise. The factor used to scale the value is derived from the module capabilities. This property is not supported by all devices. Refer to Supported Properties by Device t... | |
- ``trprint2(R)`` displays the SO(2) rotation matrix in a compact
single-line format and returns the string::
[LABEL:] θ UNIT
- ``trprint2(T)`` displays the SE(2) homogoneous transform in a compact
single-line format and returns the string::
[LABEL:] [t=X, Y;] θ UNIT
.. runblock:: pycon
>>> from spatialmath... | |
<gh_stars>0
import numpy as np
import pickle
def xavier_init(size, gain=1.0):
"""
Xavier initialization of network weights.
"""
low = -gain * np.sqrt(6.0 / np.sum(size))
high = gain * np.sqrt(6.0 / np.sum(size))
return np.random.uniform(low=low, high=high, size=size)
class Layer:
"""
Abstract layer class.
... | |
<reponame>biosignalsnotebooks/biosignalsnotebooks
"""
List of functions intended to load data (electrophysiological signals) inside the different file
formats generated by OpenSignals.
The existent formats are .h5, .txt and .edf
Available Functions
-------------------
[Public]
load
Universal function for reading .... | |
noqa: E501
query_params = []
if 'inline_settings' in params:
query_params.append(('inlineSettings', params['inline_settings'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api... | |
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.remove_dvportgroup portgroup=pg1 dvs=dvs1
'''
log.trace('Removing portgroup\'{0}\' in dvs \'{1}\' '
''.format(portgroup, dvs))
proxy_type = get_proxy_type()
if proxy_type == 'esxdata... | |
self.rect = pygame.Rect(self.position, self.scale)
self.velocity = Vector(0,0)
self.image = pygame.Surface((10,10)).convert()
self.image.fill((0,0,255))
def update(self, milliseconds):
#time = (milliseconds / 1000.0)
#self.velocity.y = 0
#self.velocity.x = 0
#if main_game.keyboard.is_down(K_w):
# self.veloc... | |
"""
Input/output routines for tracpy.
Contains:
setupROMSfiles
readgrid
readfields
savetracks
loadtracks
loadtransport
save_ll2grid
"""
from __future__ import absolute_import
import netCDF4 as netCDF
import glob
import numpy as np
from scipy.spatial import Delaunay
import matplotlib.tri as mtri
import octant
i... | |
non-pubmed evidence
# TODO: do we need to look at bpe.getEvidence()
return refs
@staticmethod
def _get_db_refs(bpe):
db_refs = {}
if _is_protein(bpe) or _is_rna(bpe):
hgnc_id = BiopaxProcessor._get_hgnc_id(bpe)
uniprot_id = BiopaxProcessor._get_uniprot_id(bpe)
# Handle missing HGNC/UP ids
if hgnc_id and not ... | |
"
"isn't constant: \n{}\n"
).format("\n".join(non_cqt_strs))]
data['non_cqts'] = non_cqts
did_header = did_atleast_one_header = True
# Temporal peak ##########################################################
if unimodal:
# check that temporal peak is at t==0 ################################
pop_if_no_header(re... | |
<filename>data_files/sme/morph_dict/table_filler.py
import configparser
import os
import time
import shutil
import gzip
import mysql.connector
from prep.scrape_sami import get_pos, sme_to_conllu
"""
Create MySQL tables storing North Sami morphological dictionaries
"""
def collect_conllu(freqFile):
"""
Find the in... | |
<filename>pychess/perspectives/fics/SeekChallenge.py<gh_stars>0
# -*- coding: UTF-8 -*-
import sys
from operator import attrgetter
from itertools import groupby
from gi.repository import Gtk
from pychess.Utils.const import (
WHITE,
BLACK,
RANDOMCHESS,
FISCHERRANDOMCHESS,
LOSERSCHESS,
UNSUPPORTED,
VARIANTS_SHU... | |
# Copyright 2019-2020 kubeflow.org.
#
# 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 writin... | |
import inspect
import os
import sys
import warnings
from collections import OrderedDict
from typing import Callable, Union, Iterable
import requests
import numpy as np
from numpy.random.mtrand import RandomState
from matrx.agents.agent_brain import AgentBrain
from matrx.agents.capabilities.capability import SenseCapa... | |
= csigma(Lmax,eta)
for L in range(Lmax+1):
Csig_exp[ie,pair,L] = cmath.exp(complex(0.,csigma_v[ie,pair,L]-csigma_v[ie,pair,0]))
# Csig_exp[ie,pair,L] = cmath.exp(complex(0.,csigma_v[ie,pair,L]))
# Csig_exp[ie,pair,L] = 1.
else:
eta_val[ie,pair] = 0.0
Csig_exp[ie,pair,:] = 1.0
if debug:
L = 3 # for printing
EE... | |
<reponame>jake-is-ESD-protected/scipy<filename>scipy/sparse/linalg/_eigen/tests/test_svds.py
import re
import copy
import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_array_equal
import pytest
from scipy.linalg import hilbert, svd
from scipy.sparse import csc_matrix, isspmatrix
from sci... | |
and the Caribbean and control or vassalize Mexico in 1900 AD
if iGameTurn == getTurnForYear(1900):
if isAreaFreeOfCivs(utils.getPlotList(tNCAmericaTL, tNCAmericaBR), lCivGroups[0]) and isControlledOrVassalized(iAmerica, Areas.getCoreArea(iAztecs, True)):
win(iAmerica, 0)
else:
lose(iAmerica, 0)
#... | |
"""EnableKeyRotation请求参数结构体
"""
def __init__(self):
r"""
:param KeyId: CMK唯一标识符
:type KeyId: str
"""
self.KeyId = None
def _deserialize(self, params):
self.KeyId = params.get("KeyId")
memeber_set = set(params.keys())
for name, value in vars(self).items():
if name in memeber_set:
memeber_set.remove(name... | |
1
self.kp_det_1 = KpDetModule(
False,
self.cls_out_channels,
self.feat_channels,
self.point_feat_channels,
self.num_reppts,
self.num_keypts,
self.gradient_mul,
self.transform_method,
self.moment_mul)
# stage 2
self.kp_det_2 = KpDetModule(
True,
self.cls_out_channels,
self.feat_channels,
self.point_feat_... | |
<reponame>monkeydg/POG-bot<filename>bot/classes/players.py
# @CHECK 2.0 features OK
"""Contains player classes
"""
# Others
# Custom modules
import modules.config as cfg
from modules.asynchttp import api_request_and_retry as http_request, ApiNotReachable
from modules.tools import UnexpectedError
from lib.tasks import... | |
# -*- coding: utf-8 -*-
"""Optimal Interpolation of spatial data.
Interpolate spatial data using a modeled (analytical) covariance function.
Example:
python ointerp.py ~/data/ers1/floating/filt_scat_det/joined_pts_ad.h5_ross
-d 3 3 0.25 -r 15 -k 0.125 -e .2 -v t_year lon lat h_res None
-x -152 0 -t 1995.0... | |
'''
Created on Jan. 23, 2021
@author: cefect
executing a CanFlood workflow froma python console
'''
#===============================================================================
# imports----------
#===============================================================================
import inspect, logging, os, datet... | |
from flask import request, url_for, send_from_directory
from flask import jsonify, abort, send_file
from flask_api import FlaskAPI, status, exceptions
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
from PyPDF2 import PdfFileReader
import os
import fitz
import textract
import nltk
import json
imp... | |
a dictionary.
>>> type(seq([('a', 1)]).dict())
dict
>>> seq([('a', 1), ('b', 2)]).dict()
{'a': 1, 'b': 2}
:param default: Can be a callable zero argument function. When not None, the returned
dictionary is a collections.defaultdict with default as value for missing keys. If the
value is not callable, then a z... | |
import struct
from typing import cast, Any, BinaryIO, Dict, List, Optional, Tuple, Union
from .exif_log import get_logger
from .utils import Ratio, s2n, FILE_TYPE_JPEG
from .tags import DEFAULT_STOP_TAG, FIELD_TYPES, SUBIFD_TAGS, IFD_TAG_MAP, makernote
logger = get_logger()
class IfdTag:
"""
Eases dealing with tag... | |
+ name
remove.addJavascriptEvent('onclick', 'multiField.removeSelectedOption(this, "%s");' % self.sortBy)
return new
def _create(self, id, name=None, parent=None, **kwargs):
SelectField._create(self, id, name, parent, **kwargs)
self.sortBy = "innerHTML"
self.userInput.id = id + "MultiField"
self.userInput.name... | |
"50B695": "Micropoint Biotechnologies,Inc.",
"50B7C3": "Samsung Electronics CO., LTD",
"50B888": "wi2be Tecnologia S/A",
"50B8A2": "ImTech Technologies LLC,",
"50C006": "<NAME>",
"50C271": "SECURETECH INC",
"50C58D": "Juniper Networks",
"50C7BF": "TP-LINK TECHNOLOGIES CO.,LTD.",
"50C971": "GN Netcom A/S... | |
<reponame>TTOFFLINE-LEAK/ttoffline
from BattleBase import *
import random
from direct.directnotify import DirectNotifyGlobal
from otp.otpbase import OTPLocalizer
from toontown.toonbase import TTLocalizer
notify = DirectNotifyGlobal.directNotify.newCategory('SuitBattleGlobals')
debugAttackSequence = {}
def pickFromFreq... | |
import caffe
from caffe import layers as L
from caffe import params as P
def fc_relu_drop(bottom, num_output=1024, dropout_ratio=0.5):
fc = L.InnerProduct(bottom, num_output=num_output,
param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)],
weight_filler=dict(type='xavier', std=1),
bias_filler=dict... | |
<filename>src/include/falconn/ffht/gen.py
import csv
import os
import sys
import subprocess
max_log_n = 30
def is_distinct(l):
return len(set(l)) == len(l)
def float_avx_0(register, aux_registers, ident=''):
if not is_distinct(aux_registers):
raise Exception('auxiliary registers must be distinct')
if register ... | |
% summary_stats(tile_summary).replace("\n", "<br/>\n ") + \
" </div>\n" + \
" </td>\n"
html += " <td style=\"vertical-align: top\">\n" + \
" <a target=\"_blank\" href=\"%s\">S%03d Top Tiles<br/>\n" % (top_img, slide_num) + \
" <img src=\"%s\" />\n" % (top_thumb) + \
" </a>\n" + \
" </td>\n"
html += " <td styl... | |
),
d,
)
self.assert_sql_count(testing.db, go, 1)
def test_lazy_fallback_doesnt_affect_eager(self):
nodes = self.tables.nodes
class Node(fixtures.ComparableEntity):
def append(self, node):
self.children.append(node)
mapper(
Node,
nodes,
properties={
"children": relationship(
Node, lazy="joined", join_d... | |
<filename>cloudrunner/util/tlszmq.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 CloudRunner.IO
# 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 ma... | |
<filename>suapp/targets/localweb/__init__.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections
import hashlib
import http.cookies
import http.server
import json
from threading import Thread
import time
import traceback
import os.path
import random
import string
import sys
import urllib.pars... | |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | |
and wish I were renewed;",
"Whilst, like a willing patient, I will drink",
"Potions of eisel 'gainst my strong infection;",
"No bitterness that I will bitter think,",
"Nor double penance, to correct correction.",
"Pity me then, dear friend, and I assure ye,",
"Even that your pity is enough to cure me."),
... | |
(i.e. add geometry interesect)
"""
p = {RETURN_IDS_ONLY:TRUE,
RETURN_GEOMETRY: FALSE,
OUT_FIELDS: ''}
# add kwargs if specified
for k,v in kwargs.iteritems():
if k not in p.keys():
p[k] = v
return sorted(self.query(where=where, add_params=p)[OBJECT_IDS])[:max_recs]
def getCount(self, where='1=1', **kwargs)... | |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... | |
<filename>alf/utils/process_coordinator.py
# Copyright (c) 2020 Horizon Robotics and ALF Contributors. 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.apac... | |
#!/usr/bin/env python3
"""Disassemble a Game Boy ROM into RGBDS compatible assembly code"""
__author__ = '<NAME>'
__version__ = '1.3'
__copyright__ = 'Copyright 2018 by <NAME>'
__license__ = 'MIT'
import argparse
import glob
import hashlib
import os
import png
from shutil import copyfile
from instruction_set import... | |
for ref_type in new_ref_infos:
sqa_ref_class = self.sqa_classes[ref_type(obj_type, ref_type)]
for new_ref_uuid, ref_info in new_ref_infos[ref_type]:
new_ref_value = {'is_weakref': False}
try:
new_ref_value['attr'] = ref_info['attr']
except KeyError:
pass # TODO add support and complain with should_have_attr
ne... | |
<reponame>zanachka/autoproxy
import redis
import psycopg2
import sys
import os
import time
import json
import re
from functools import wraps
from copy import deepcopy
from datetime import datetime, timedelta
import traceback
from psycopg2.extras import DictCursor
from psycopg2 import sql
from scrapy_autoproxy.proxy_o... | |
<filename>SAI/test/saithrift/tests/sail3.py
# Copyright 2013-present Barefoot Networks, 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
#
#... | |
= tar.getmembers()
self.assertIn('stdout', names)
self.assertEqual(names[-1], 'stdout')
self.assertEqual(members[-1].size, 0)
file = tar.extractfile(members[-1])
self.assertEqual(file.read(), '')
self.assertEqual(resp.headers['x-nexe-retcode'], '0')
self.assertEqual(resp.headers['x-nexe-status'], 'nexe is invali... | |
key """
self.hide_selection()
self.change_column(len(keys))
def select_up(self, keys):
""" Manage select up key """
self.open_selection()
self.change_line(-1)
def select_down(self, keys):
""" Manage select down key """
self.open_selection()
self.change_line(1)
def select_left(self, keys):
""" Ma... | |
the parameters of the constructor to invoke. If the
default constructor is preferred,args must be an empty array or null.
culture: Culture-specific information that governs the coercion of args to the formal
types declared for the typeName constructor. If culture is null,the
System.Globalization.Cult... | |
m.x913 + m.x920 + m.x1778 == 0)
m.c2473 = Constraint(expr= - m.x578 + m.x620 + m.x627 - m.x676 + m.x718 + m.x725 - m.x774 + m.x816 + m.x823 - m.x872
+ m.x914 + m.x921 + m.x1779 == 0)
m.c2474 = Constraint(expr= - m.x579 + m.x621 + m.x628 - m.x677 + m.x719 + m.x726 - m.x775 + m.x817 + m.x824 - m.x873
+ m.x915 + m.x92... | |
<gh_stars>0
import argparse
import time
import datetime
import os
import numpy as np
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import ReduceLROnPlateau
from tensorboardX import SummaryWriter
from network.rtpose_vgg import get_model, use_vgg
from network impo... | |
<filename>mirge/libs/generate_featureFiles.py
#Build a class of a read cluster including memeber reads and the clustered seq.
#Define it's attributes and methods
import os
import sys
from pathlib import Path
import pickle
from Bio.Seq import Seq
from Bio import SeqIO
import Bio
from Bio.Alphabet import generic_dna
fro... | |
This function is a modification of nuscenes.geometry_utils.view_points function
This is a helper class that maps 3d points to a 2d plane. It can be used to implement both perspective and
orthographic projections. It first applies the dot product between the points and the view. By convention,
the view should be suc... | |
"""Stack Plugin for EasyEngine."""
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from ee.cli.plugins.site_functions import *
from ee.core.variables import EEVariables
from ee.core.aptget import EEAptGet
from ee.core.download import EEDownload
from ee.core.shellex... | |
very different from float64 or complex128
@dtypes(torch.float64, torch.complex128)
def test_eigvals_numpy(self, device, dtype):
def run_test(shape, *, symmetric=False):
from torch.testing._internal.common_utils import random_symmetric_matrix
if not dtype.is_complex and symmetric:
# for symmetric real-valued inpu... | |
from __future__ import absolute_import, print_function, unicode_literals
divisions_districts = {
'Barisal': ['Pirojpur',
'Barishal',
'Bhola',
'Barguna',
'Patuakhali',
'Jhalokathi'],
'Chittagong': ['Khagrachari',
'Noakhali',
'Rangamati',
'Bandarban',
'Feni',
'Lakshmipur',
'Chandpur',
'Comilla',
'Chittag... | |
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=... | |
to receive from the customer.
#: The value usually matches the cart or order gross total.
amount_planned: "TypedMoney"
payment_method_info: "PaymentMethodInfo"
#: A list of financial transactions of different TransactionTypes
#: with different TransactionStates.
transactions: typing.List["Transaction"]
custom: t... | |
+ callfrom + ':On Summit'
if read_user_param(callfrom,'Active'):
send_long_message_with_ack(aprs_beacon,callfrom,mesg,read_user_param(callfrom,'Retry'))
elif state == APRCH:# Approaching Summit
print >>sys.stderr, 'APRS: Message ' + callfrom + ':Approaching'
if read_user_param(callfrom,'Active'):
send_long_messag... | |
set this flag before pushing to the stack?
self.memory_map.Write(self.sp - 2, self.cc | Flags.UNUSED)
self.sp -= 3
# Set PC to the NMI vector
self.pc = address
return True
def irq(self):
# Read the IRQ vector
lowaddr = self.memory_map.Read(0xfffa)
highaddr = self.memory_map.Read(0xfffb)
if (lowaddr != None)... | |
# noqa: E501
raise ApiValueError("Missing the required parameter `application_load_balancer_id` when calling `datacenters_applicationloadbalancers_flowlogs_put`") # noqa: E501
# verify the required parameter 'flow_log_id' is set
if self.api_client.client_side_validation and ('flow_log_id' not in local_var_params or ... | |
maps
n['conv4_weighted'] = L.Concat(name='conv4_weighted', bottom=['conv4_weighted_' + str(i) for i in range(384)])
# Sum across width
add_slice_layer(n, 'conv4_weighted', ['conv4_weighted_slice_' + str(i) for i in range(13)], dict(
axis=3, slice_point=range(1, 13)
))
n['conv4_weighted_a'] = L.Eltwise(name='conv4... | |
################################################################################
"""
`electricpy` Package - `conversions` Module.
>>> from electricpy import conversions
Filled with simple conversion functions to help manage unit conversions and the
like, this module is very helpful to electrical engineers.
Built to ... | |
<filename>JSSP/data.py<gh_stars>10-100
import re
from abc import ABC
from pathlib import Path
import numpy as np
import pandas as pd
class Task:
"""
Task ADT.
:type job_id: int
:param job_id: job ID of this Task
:type task_id: int
:param task_id: task ID of this Task
:type sequence: int
:param sequence: s... | |
#
# Copyright 2017 Mycroft AI 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 applicable law or agreed to in writing... | |
# -*- coding: cp936 -*-
# Copyright {2015} <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 l... | |
0.3333, "depth": 12}
if obj[10]<=0:
return 'True'
elif obj[10]>0:
return 'False'
else: return 'False'
elif obj[6]<=1:
return 'False'
else: return 'False'
elif obj[4]>1:
return 'False'
else: ret... | |
<reponame>nor3th/client-python
# coding: utf-8
class StixSightingRelationship:
def __init__(self, opencti):
self.opencti = opencti
self.properties = """
id
entity_type
parent_types
spec_version
created_at
updated_at
standard_id
description
first_seen
last_seen
attribute_count
x_opencti_negative
create... | |
if len(gab_lines) == 0:
return 'Asked file has fixed parameters'
gab_lines = gab_lines[:len(gab_lines)//2]
pnames = [re.split('0',
re.split('=\s+',
line)[0][3:])[0]
for line in gab_lines]
for p in [1, 3, 5][:len(pnames)]:
pnames.insert(p, pnames[p-1]+'_err')
pvals = [[float(re.split('\s+\\n',
re.split('\s\+-\... | |
<filename>ndm/ndm.py<gh_stars>1-10
#!/usr/bin/env python3
import os
import sys
from random import seed, shuffle
import multiprocessing
from statistics import mean, stdev
from time import sleep
sys.path.extend(['..'])
import tensorflow as tf
import dataset
import model_cnn_w2w as cnn_w2w
import model_rnn_w2w as rnn_... | |
<filename>python/mxnet/gluon/data/dataset.py
# 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, V... | |
the server if the server's status prior to
# downloading the file was disabled.
if httpClientstate is False:
cmd = ('esxcli network firewall ruleset set --enabled=False'
' --ruleset-id=httpClient')
process = subprocess.run(shlex.split(cmd))
return True
# Acquires Intel JSON files of CPU architecture PMU Event... | |
named tests_profile.*.prof
in this directory will be removed. If you intend to run multiple instances
of the test runner in parallel, be sure to tell them to use different
directories, so they won't step on each other's toes.
""")
######################################################################
# Setup
setup = ... | |
400 + 40 > mouse[1] > 400) and (board[1][3] == 0):
if move == 0:
pygame.draw.circle(gameDisplay, BLACK, (270, 420), circle_radius)
else:
pygame.draw.circle(gameDisplay, WHITE, (270, 420), circle_radius)
piece_placed(1, 3, move, board)
elif click[0] == 1 and (250 + 40 > mouse[0] > 250 and 350 + 40 > mouse[1]... | |
get_d_b(self):
return self.get("d{0}".format(self.data['b']), Type.int_32)
def get_d_a(self):
return self.get("d{0}".format(self.data['a']), Type.int_32)
def fetch_operands(self):
return self.get_d_a(), self.get_d_b(), self.get_n()
def compute_result(self, *args):
d_a = args[0]
d_b = args[1]
n = args[2]
sc... | |
params:
body_params = params['body']
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/app/rest/buildTypes/{btLocator}/steps/{stepId}', 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=... | |
t_(rec(t))
# and compute its hidden states
emb_event_t = self.Emb_event[
self.one_seq[-1]['type_event'], :
]
#
time_rep_t = self.hard_relu(
self.one_seq[-1]['time_since_last_event'] - self.Threshold_time
)
time_rep_t = numpy.concatenate(
(
time_rep_t,
self.one_seq[-1][
'time_since_last_event'
][None]
), ... | |
ctx.send("Looks like thats not a valid match id")
return
description = ("Game ended in {0} \n"
"More info at [DotaBuff](https://www.dotabuff.com/matches/{1}), "
"[OpenDota](https://www.opendota.com/matches/{1}), or "
"[STRATZ](https://www.stratz.com/match/{1})"
.format(get_pretty_duration(game... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.