input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
missing Roughness argument")
elif OpenChannel is not None and openchannel is not None:
raise TypeError("fric_rect received both OpenChannel and openchannel")
elif OpenChannel is None and openchannel is None:
raise TypeError("fric_rect missing OpenChannel argument")
else:
if PipeRough is not None:
warnings.warn("... | |
0)
xtt = QLabel()
xtt.setPixmap(pix)
rejilla.addWidget(xtt, 2, 0)
xtt = QLabel()
xtt.setPixmap(pix)
rejilla.addWidget(xtt, 0, 2)
xtt = QLabel()
xtt.setPixmap(pix)
rejilla.addWidget(xtt, 2, 2)
xtt = QLabel()
xtt.setPixmap(pix)
rejilla.addWidget(xtt, 0, 4)
xtt = QLabel()
xtt.setPixmap(pix)
r... | |
import bson
import copy
import unicodecsv as csv
import datetime
import dateutil
import os
import pymongo
import pytz
from backports import tempfile
from .. import config
from .. import util
from ..web import base
from ..web.errors import APIReportException, APIReportParamsException
from ..web.request import AccessT... | |
An instance of `tf.keras.optimizers.*` used to train the model.
Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp',
SGD'), or callable. Defaults to Adagrad optimizer.
activation_fn: Activation function applied to each layer. If `None`, will
use `tf.nn.relu`.
dropout: When not `None`, the probability... | |
from __future__ import print_function
import json
import os, sys, os.path
import pandas
import matplotlib as mpl
mpl.use('pgf')
pgf_with_pdflatex = {
"pgf.texsystem": "pdflatex",
"pgf.preamble": [
r"\usepackage[utf8x]{inputenc}",
r"\usepackage[T1]{fontenc}",
# r"\usepackage{cmbright}",
],
"font.family": "serif",... | |
#!/usr/bin/env python
# coding: utf-8
import hmac
import json
import logging
import os
import threading
import time
import traceback
import unittest
import urllib
import environment
import tablet
import utils
from net import gorpc
from vtdb import keyrange
from vtdb import keyrange_constants
from vtdb import keyspac... | |
< tol:
return V_over_F, xs, zs, l, g, iteration, err, err0
raise UnconvergedError('End of SS without convergence')
def SS_VF_simultaneous(guess, fixed_val, zs, liquid_phase, gas_phase,
iter_var='T', fixed_var='P', V_over_F=1,
maxiter=200, xtol=1E-10, comp_guess=None,
damping=0.8, tol_eq=1e-12, update_frequency=3)... | |
list(np.array(files)[np.argsort(dates)])
return sorted_files
# def load_traj(local_path, wmo):
# return trajData, trajFile
def load_argo(local_path, wmo, grid=False, verbose=True):
'''
Function to load in all data from a single float, using BRtraj, meta,
and Sprof files.
Args:
local_path: local path of flo... | |
"""Tests for the OAuth applications web API,."""
from django.contrib.auth.models import User
from djblets.db.query import get_object_or_none
from djblets.testing.decorators import add_fixtures
from djblets.webapi.errors import DOES_NOT_EXIST
from djblets.webapi.testing.decorators import webapi_test_template
from revi... | |
(
self.domain['id'], self.user['id'], self.role['id'])
self.put(path=path)
auth_data = self.build_authentication_request(
username=self.user['name'],
user_domain_id=self.domain['id'],
password=<PASSWORD>['password'],
domain_name=self.domain['name'])
r = self.post('/auth/tokens', body=auth_data)
self.assertVal... | |
1: "Sync",
2: "ISDN-Sync",
3: "ISDN-Async-v120",
4: "ISDN-Async-v110",
5: "Virtual",
6: "PIAFS",
7: "HDLC-Clear-Channel",
8: "X25",
9: "X75",
10: "G.3 Fax",
11: "SDSL - Symmetric DSL",
14: "IDSL - ISDN Digital Subscriber Line",
15: "Ethernet",
16: "xDSL - Digital Subscriber Line of unknown type",
17: "Cab... | |
<gh_stars>1-10
# encoding: UTF-8
'''
vn.stub的gateway接入
'''
from vnpy.trader.vtGateway import VtGateway
from vnpy.trader.main.vtObject import VtLogData, VtTickData
from vnpy.trader.vtGateway import *
from vnpy.trader.language.vtConstant import *
from selenium import webdriver
from selenium.webdriver.sup... | |
<filename>python/tvm/auto_tensorize/search/parameter.py<gh_stars>10-100
import numpy as np
import time
import heapq
from .measure import *
from .record import Entry
from ..utils import *
import queue
import logging
import json
import sys
import os
import math
class ParamGenerator(object):
def get(self, *args, **kwar... | |
<reponame>nn3un/reportlab-mirror
#Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history https://hg.reportlab.com/hg-public/reportlab/log/tip/docs/userguide/ch3_pdffeatures.py
from tools.docco.rl_doc_utils import *
heading1("Exposing PDF Special Capabilities")
disc("""PDF provides a nu... | |
<reponame>SimonRosen173/MultiAgentPathFinding
import time
import pickle
from typing import List, Tuple, Optional, Set, Dict, Callable
import os
import shutil
import argparse
from numba import njit, jit
import numpy as np
import pandas as pd
from functools import partial
import wandb
import ruck
from ruck.external.de... | |
11:
hole.add((x, y, z))
for x in range(7, 11):
for z in range(self.depth):
if 12 < x + y + z < 17:
hole.add((x, y, z))
for y in range(self.height):
for x in range(self.width):
for z in range(self.depth):
coord = (x, y, z)
if 5 < x + y + z < 18 and coord not in hole:
yield coord
def customize_piece_data(sel... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# правила оформления кода в проекте
# 1) цифры в конце пинов и графических компонентов означают отношение к форме с заданным номером:
# 2) названия графических компонентов, которые соотосятся с пинами, образованы от названия пина
# 3) тип графического компонента указан в начал... | |
D.kh * S.DH, D.ow * S.SW + D.kw * S.DW, D.c])
* cast(U, K[D.kh, D.kw, D.f, D.c]))
@linalg_structured_op
def conv_2d_cnhw_cfhw(
I=TensorDef(TV.T1, S.C, S.N, S.OH * S.SH + S.KH * S.DH,
S.OW * S.SW + S.KW * S.DW),
K=TensorDef(TV.T2, S.C, S.F, S.KH, S.KW),
O=TensorDef(U, S.N, S.F, S.OH, S.OW, output=True),
strides=... | |
<reponame>paulmetzger/Device-Hopping-Paper
#!/usr/bin/env python3
from typing import Dict, List, Set, Tuple
import argparse
import copy
import math
import os
import re
import subprocess
import sys
import traceback
from device import Device
import buffer_spec
import reduction
STANDARD_TYPES = ['char', 'size_t', 'int... | |
# -*- coding: utf-8 -*-
from ogs5py import OGS
model = OGS(
task_root='decal_root',
task_id='decal',
output_dir='out',
)
model.msh.read_file('decal.msh')
model.gli.read_file('decal.gli')
model.pcs.add_block(
main_key='PROCESS',
PCS_TYPE='GROUNDWATER_FLOW',
NUM_TYPE='NEW',
RELOAD=[1, 1000],
)
model.pcs.add_block... | |
<filename>common/hgraph/new_smatch.py
#!/usr/bin/env python2
from hgraph import Hgraph
from collections import defaultdict
import itertools
import math
import sys
import random
import copy
from lib import pyparsing
import timeit
from optparse import OptionParser, OptionGroup
"""
An implementation of the SMATCH metric... | |
*(string) --*
The identifier of the streaming session.
- **UserId** *(string) --*
The identifier of the user for whom the session was created.
- **StackName** *(string) --*
The name of the stack for the streaming session.
- **FleetName** *(string) --*
The name of the fleet for the streaming session.
- **Sta... | |
<filename>LowLevelApi/NGPF/Python/1Main/IxNetL2L3RawTrafficItemLL.py
#!/usr/local/python2.7.6/bin/python2.7
# Description
#
# This script will use Python and IxNetwork low level APIs to
# create two NGPF IPv4 topolopgies with back-to-back ports.
# Then it will add TCP header to the Traffic Item and modify
# the tcp s... | |
<reponame>hutuxian/FleetX
#!/usr/bin/python
# Copyright (c) 2019 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/... | |
# Copyright Contributors to the Rez project
#
# 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 i... | |
<gh_stars>0
#!/usr/bin/env python
"""Script to run the GBRV tests for binary and ternary compunds."""
import sys
import os
import argparse
import hashlib
from monty.termcolor import cprint
from monty.functools import prof_main
from monty.io import FileLock
from pseudo_dojo.core.pseudos import DojoTable, OfficialDojoTa... | |
<filename>custom/spiders/tianyancha.py
# -*- coding: utf-8 -*-
import json
import re
import time
from urllib.parse import unquote
import jsonpath
import redis
import scrapy
import logging
from custom import settings
from custom.work_utils.redis_bloomfilter import BloomFilter
logger = logging.getLogger(__name__)
cl... | |
<filename>SRC/model.py
from torch import nn
from utils import *
import torch.nn.functional as F
from math import sqrt
from itertools import product as product
import torchvision
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class SSD600(nn.Module):
"""
The SSD600 network - containing the ba... | |
<reponame>GeralRCotrina/Comision4
from django.db import models
from django.utils.translation import ugettext as _
from datetime import datetime
def get_date_now():
return datetime.now().strftime("%Y-%m-%d")
def get_hour_now():
return datetime.now().strftime("%H:%M:%S")
def get_hour_rep():
return datetime.now()... | |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2021 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... | |
# SPDX-License-Identifier: Apache-2.0
"""
subarulink - A Python Package for interacting with Subaru Starlink Remote Services API.
controller.py - provides managed connection to Subaru API
For more details about this api, please refer to the documentation at
https://github.com/G-Two/subarulink
"""
import asyncio
from ... | |
<reponame>pieterlukasse/data_pipeline-1
import copy
import json
import logging
import math
import csv
from mrtarget.Settings import Config, file_or_resource
from mrtarget.constants import Const
from mrtarget.common.DataStructure import JSONSerializable, PipelineEncoder
from mrtarget.common.IO import check_to_open, UR... | |
is not missing and v is not None}
header_params = {
"accept": "application/json",
"content-type": "application/json",
"opc-request-id": kwargs.get("opc_request_id", missing)
}
header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None}
retry_strategy = self.base_clie... | |
event_study_comment,
'role_id': role_id,
'event_purge': event_purge,
'event_node': event_node,
'global_param': global_param,
'max_sessions': max_sessions,
'event_message': event_message,
'event_link': event_link,
'settings': settings,
'event_upload_fail': event_upload_fail,
'email': email,
'event_thin_study_... | |
# (c) <NAME>, 2010-2022. MIT License. Based on own private work over the years.
from .designs_factorial import full_factorial
from .models import lm, predict, summary
from .plotting import contour_plot, pareto_plot, plot_model
from .structures import c, expand_grid, gather, supplement
def case_3B():
"""
See video ... | |
is passed, then it is necessary to identify if these constitute a series of
:py:attr:`consecutive` trajectories or a series of :py:attr:`identical` starting points with different
random seeds, in which case the `dtype` should be either :py:attr:`consecutive` or :py:attr:`identical`.
:param bootstrap_params: The para... | |
<reponame>Levi0223/FaceBoxes
from __future__ import print_function
import os
from numpy.core.fromnumeric import shape
import torch
from torch._C import dtype
import torch.optim as optim
import torch.backends.cudnn as cudnn
import argparse
import torch.utils.data as data
from data import AnnotationTransform, VO... | |
<filename>supyr_struct/blocks/while_block.py
'''
A module that implements WhileBlock and PWhileBlock, subclasses of ArrayBlock.
WhileBlocks are used where an array is needed which does not have a size
stored anywhere and must be parsed until some function says to stop.
'''
from supyr_struct.blocks.block import Block
fr... | |
from __future__ import print_function, division
import hashlib
import numpy as np
from astropy.table import Table, Column
from ..util.integrate import integrate_linlog_subset
from ..util.interpolate import (interp1d_fast, interp1d_fast_loglog,
interp1d_fast_linlog)
from ..util.functions import (extrap1d_log10, Free... | |
"""
Generate hourly temperature and precipitation data for use in the snow model
The daily gridded fields (e.g. from VCSN) are downscaled using the same methods given in "Simulations of seasonal snow for the South Island, New Zealand"
Clark et al, 2009
"""
from __future__ import division
import os
#os.environ['PROJ_LI... | |
<filename>bin/mircx_transmission.py<gh_stars>1-10
#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
import mircx_pipeline as mrx
import argparse, glob, os, sys
import datetime as dattime
from datetime import datetime
import numpy as np
from astropy.io import fits as pyfits
import matplotlib.pyplot as plt
import o... | |
<filename>lib/grizzled/grizzled/config.py
'''
Introduction
============
Based on the standard Python ``ConfigParser`` module, this module provides an
enhanced configuration parser capabilities. ``Configuration`` is a drop-in
replacement for ``ConfigParser``.
A configuration file is broken into sections, and each sect... | |
<gh_stars>1-10
"""Test hook that periodically makes the primary of a replica set step down."""
from __future__ import absolute_import
import collections
import os.path
import random
import threading
import time
import bson
import pymongo.errors
from buildscripts.resmokelib import errors
from buildscripts.resmokelib ... | |
if actual_state == task_states.DELETING:
raise exception.UnexpectedDeletingTaskStateError(
actual=actual_state, expected=expected)
else:
raise exception.UnexpectedTaskStateError(
actual=actual_state, expected=expected)
if "expected_vm_state" in values:
expected = values.pop("expected_vm_state")
if not isinstanc... | |
<reponame>devsunset/vcts
# -*- coding: utf-8 -*-
##################################################
#
# trade.py
#
##################################################
##################################################
# import
import datetime
from pandas import DataFrame
from tabulate import tabulate
impo... | |
<filename>deeptrain/util/_default_configs.py
# -*- coding: utf-8 -*-
"""**! DO NOT MODIFY !**
Used internally by classes to validate input arguments.
Effective configurations are in configs.py. Can serve as user reference.
"""
import numpy as np
from .fonts import fontsdir
from .algorithms import builtin_or_npscalar
... | |
<reponame>larshesel/mzbench<filename>lib/mzbench_api_client.py
from __future__ import print_function
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
import json
import os
import sys
import re
import requests
import multipart
import string
class MZBenchAPIException(Exceptio... | |
# 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.
# --------------------------------------------------------------------... | |
= iprange.gateway
networkcmd.netmask = iprange.netmask
networkcmdresponse = self.__apiClient.createNetwork(networkcmd)
if networkcmdresponse.id:
networkId = networkcmdresponse.id
self.__tcRunLogger.\
debug("Creating Network Name : %s Id : %s Successful"
% (str(network.name), str(networkId)))
self.__addToCleanUp... | |
numpy
# img_scalar = data.GetPointData().GetScalars()
# dims = data.GetDimensions()
# n_comp = img_scalar.GetNumberOfComponents()
# temp = utils.vtk2numpy(img_scalar)
# numpy_data = temp.reshape(dims[1],dims[0],n_comp)
# numpy_data = numpy_data.transpose(0,1,2)
# numpy_data = np.flipud(numpy_data)
elif "ImageD... | |
import collections
import errno
import logging
import os
import re
import shutil
import uuid
import time
import traceback
import sys
import pandas as pd
import numpy as np
from openpyxl import load_workbook
from xlrd.biffh import XLRDError
from sklearn import preprocessing
from skbio.stats.composition import ilr, clr
... | |
** 2 * kT
- 2 * Lc * Lp * St * d
- 4.5 * Lc * d * kT
+ Lp * St * d ** 2
+ 3 * d ** 2 * kT
)
/ (Lc ** 2 * (Lp * St + kT))
)
a = (
St
* (2 * Lc * Lp * St + 2.25 * Lc * kT - 2 * Lp * St * d - 3 * d * kT)
/ (Lc * (Lp * St + kT))
)
total_dy_da, total_dy_db, total_dy_dc = invwlc_root_derivatives(a, b, c, 2)
#... | |
"""Module for computing basic quantities from a spectral graph model: the forward model
Makes the calculation for a single frequency only. This variation separates the global
coupling alpha (in laplacian) and the local coupling alpha = 1. """
import numpy as np
def network_transfer_function(brain, parameters, w, us... | |
def IsToolboxItem(self,serializedObject,host=None):
"""
IsToolboxItem(self: IToolboxService,serializedObject: object,host: IDesignerHost) -> bool
Gets a value indicating whether the specified object is a serialized toolbox
item,using the specified designer host.
serializedObject: The object to... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
#-*-coding:utf-8-*-
import tensorflow as tf
import tensorflow.contrib.slim as slim
import time
import numpy as np
import cv2
from train_config import config as cfg
from lib.dataset.dataietr import DataIter
from lib.core.model.net.shufflenet.shufflenetv2plus import ShufflenetV2Plus
from lib.core.model.net.shufflene... | |
<filename>nuage_neutron/vsdclient/resources/dhcpoptions.py
# Copyright 2016 NOKIA
#
# 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 req... | |
'''
Pull out HI properties (and/or others) from a set of point sources.
Create a distance map as a function of distance from the nearest source.
'''
import astropy.coordinates as coord
from astropy.table import Table, Column
import astropy.units as u
import astropy.constants as const
import numpy as np
from galaxies... | |
# -*- coding: utf-8 -*-
###
# (C) Copyright [2020] Hewlett Packard Enterprise Development LP
#
# 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
#
#... | |
'''
ops interface, borrowed from TextNAS
'''
import torch
import torch.nn.functional as F
from torch import nn
def get_length(mask):
length = torch.sum(mask, 1)
length = length.long()
return length
INF = 1E10
class Mask(nn.Module):
def forward(self, seq, mask):
# seq: (N, C, L)
# mask: (N, L)
seq_mask = torc... | |
tf.concat([in_tensor_flattened, scores], axis = -1)
bbox_scores = tf.reshape(bbox_scores, new_shape)
# print(' new shape is : ', new_shape.eval())
print(' in_tensor_flattened : ', in_tensor_flattened.shape)
print(' Scores shape : ', scores.shape) # [(num_batches x num_class x num_rois ), 3]
print(' boxes_scores (r... | |
<gh_stars>0
## @ GenCfgData.py
#
# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
import os
import re
import sys
import struct
import marshal
from functools import reduce
from datetime import date
# Generated file copyright hea... | |
item from Octopus server
# if item_name
# 1. get all items for an item_type by call Octopus API /api/{space_id}/item_type with 'get' operation
# 2. find the matching item for the item_name
# 3. save the single item into a local file (warning for overwrite)
# if item_id,
# get a single item from Octopus server for... | |
<reponame>Terralien-jp/paiza_python
#母音を変数に
vowel = 'aeiouAEIOU'
#標準入力
name = input()
#cname変数に母音じゃないものをjoinしていって出力
#'間に挿入する文字列'.join([連結したい文字列のリスト])
cname = ''.join(s for s in name if s not in vowel)
print(cname)
#複数行の入出力
input_line = int(input())
for i in range(input_line):
n = input()
print(n)
# 繰り返し出力
input_li... | |
<reponame>efomc/Tournament_game-russian_version
from itertools import combinations
from math import log10
from random import gauss
from typing import Dict, List, Tuple
from tournament_game.character import Character
from tournament_game.interactive import (
print_strike_description,
print_strike_result_descr... | |
from __future__ import absolute_import, unicode_literals
import codecs
import datetime
import os
import re
import subprocess
import sys
import tempfile
import shlex
from distutils.version import LooseVersion
from invoke import task
import six
from six import moves
from wheel import archive
RE_CHANGELOG_FILE_HEADER =... | |
<reponame>ashtam55/IG_wendor_crawler<filename>venv/lib/python3.7/site-packages/firebase_admin/_user_mgt.py<gh_stars>0
# Copyright 2017 Google 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... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 3 12:20:34 2020
@author: Patrick
"""
#Make sure current working directory is the folder before DiscordBot
import os
cwd = os.getcwd()
import numpy as np
import duden
import discord
from dotenv import load_dotenv
import nest_asyncio
import asyncio
nest_async... | |
# coding=utf-8
import time
from selenium.webdriver.common.by import By
from helpers import xroad, auditchecker
from view_models import clients_table_vm, popups, messages, log_constants
from view_models.log_constants import ADD_WSDL_FAILED
from view_models.messages import WSDL_ERROR_ADDRESS_EXISTS, WSDL_ERROR_DUPLICATE_... | |
SkipTo(';'), Halt()
])
self.check_skip_ok(te, ti, ';')
#-def
def test_SkipTo_ok_5(self):
te, ti = self.create_and_run_tag_engine("abc;", [
SkipTo(';'), Halt()
])
self.check_skip_ok(te, ti, ';')
#-def
def test_SkipTo_eof(self):
te, ti = self.create_and_run_tag_engine("", [
SkipTo(';'), Halt()
])
self.... | |
"""
Ketra Controller module for interacting with a Ketra N4 module for LED Lighting
Basic operations for enumerating and controlling the loads are supported.
Author: <NAME>
Based on pyvantage which was written by Greg but was based on
pylutron written by <NAME>
To use with home assistant and its virtual python envir... | |
<gh_stars>0
#!/usr/bin/python
#-*- coding: utf-8 -*-
import cPickle as pickle, time, string
from SPARQLWrapper import SPARQLWrapper, JSON
import rdflib as r, pygraphviz as gv
import pylab as pl
# variaveis principais:
# classes (kk), props,
# vizinhanca_ (de classes)
T=time.time()
U=r.URIRef
def fazQuery(query):
NOW... | |
<filename>lib/tool_shed/galaxy_install/tool_dependencies/recipe/tag_handler.py
import logging
import os
import tempfile
from galaxy.tools.deps.resolvers import NullDependency
from galaxy.util import listify, url_get
from tool_shed.galaxy_install.tool_dependencies.env_manager import EnvManager
from tool_shed.galaxy_ins... | |
== 0)
m.c1461 = Constraint(expr= - 0.46*m.x2637 + m.x2677 == 0)
m.c1462 = Constraint(expr= - 0.46*m.x2638 + m.x2678 == 0)
m.c1463 = Constraint(expr= - 0.46*m.x2639 + m.x2679 == 0)
m.c1464 = Constraint(expr= - 0.46*m.x2640 + m.x2680 == 0)
m.c1465 = Constraint(expr= - 0.46*m.x2641 + m.x2681 == 0)
m.c1466 = Constrai... | |
import tensorflow as tf
from util import masks, math_fns
def get_equal_pair_loss(pairwise_label_scores, pairwise_predicted_scores,
params=None):
"""
Paiwise learning-to-rank ranknet loss
Check paper https://www.microsoft.com/en-us/research/publication/
learning-to-rank-using-gradient-descent/
for more informati... | |
922741, 922781, 922807, 922813, 922853,
922861, 922897, 922907, 922931, 922973, 922993, 923017, 923023,
923029, 923047, 923051, 923053, 923107, 923123, 923129, 923137,
923141, 923147, 923171, 923177, 923179, 923183, 923201, 923203,
923227, 923233, 923239, 923249, 923309, 923311, 923333, 923341,
923347, 923369, 923... | |
no destinations to edit or delete.")
continue
# Edit the exclusions
elif edit_input == 3:
if entry.num_exclusions() > 0:
sub_option_edit_exclusions(entry)
else:
print("There are no exclusions to edit or delete.")
continue
# Delete all destinations
elif edit_input == 4:
del entry.outputs
# Delete all exclusi... | |
<filename>sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhub/extensions/checkpointstoretable/_tablestoragecs.py<gh_stars>1000+
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT ... | |
= [mesh_verts[i] for i in face.vertices]
self.uv = [uv_layer[i].uv for i in face.loop_indices]
self.no = face.normal.copy()
self.area = face.area
self.edge_keys = face.edge_keys
def main_consts():
from math import radians
global ROTMAT_2D_POS_90D
global ROTMAT_2D_POS_45D
global RotMatStepRotation
ROTMAT_2... | |
<filename>xData/suite.py
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
__metaclass__ = type
import string
import abc
import inspect
from . import ancestry as ancestryMod... | |
<filename>tests/test_encoding.py<gh_stars>1-10
"""Tests encoding
"""
import numpy as np
import pandas as pd
#import matplotlib.pyplot as plt
from dsutils.encoding import null_encode
from dsutils.encoding import label_encode
from dsutils.encoding import one_hot_encode
from dsutils.encoding import target_encode
from d... | |
print 'IVone119 check'
for item in SabxarUpa.properties['words']:
if 'stem' in item.properties.keys():
if item.objs2text() in ['maNdUka']:
self.candidateList = [IVone119]
self.parent.candidateList.extend(self.candidateList)
self.candidateList = []
def execute(self, SabxarUpa, replText='apawyam'):
print 'IVo... | |
<filename>src/pretix/control/views/item.py<gh_stars>1-10
from itertools import product
from django.contrib import messages
from django.core.urlresolvers import resolve, reverse
from django.db import transaction
from django.forms.models import inlineformset_factory
from django.http import Http404, HttpResponseForbidden... | |
<reponame>m3d/osgar_archive_2020
"""
Detect SubT Artifact in Camera Image
"""
from datetime import timedelta
import os
import tempfile
from io import StringIO
import cv2
import numpy as np
from osgar.node import Node
from osgar.bus import BusShutdownException
EXTINGUISHER = 'TYPE_EXTINGUISHER'
BACKPACK = 'TYPE_BAC... | |
state, then you can run `git commit --amend` \
to update the last commit. Yes, you can use `-a` if you want to avoid the \
`git add` suggested in the previous paragraph. You can also use `--author` \
to change the author information.
"""
return title, body
class RemoveDeepState(State):
"""Remove Deep state.
Ances... | |
import json
import glob
import pickle as pkl
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
from sklearn import svm, tree
from sklearn.metrics import precision_recall_fscore_support
from sklearn.preprocessing import normalize, scale
from scipy.cluster.vq import whiten
from sklearn.manifold import TS... | |
<filename>evaluation/eval_utils_v1.py
"""
Evaluation-related codes are modified from CASS
"""
import copy
import json
import logging
import math
import os
from ctypes import *
from pprint import pprint
import cv2
import matplotlib.pyplot as plt
import numpy as np
import scipy.misc
import skimage.color
from tqdm impor... | |
<filename>pdb2pqr-1.9.0/propka30/Source/protonator.py
#!/usr/bin/python
#
# * This library is free software; you can redistribute it and/or
# * modify it under the terms of the GNU Lesser General Public
# * License as published by the Free Software Foundation; either
# * version 2.1 of the License, or (at your option) ... | |
to treat a point pair as an inlier.
:param centric: (False) tries to attach as many images as possible to
each matching. It is quicker since it does not have to process
too many match computations.
:param hist_match: (False) apply histogram matching to foreground
image with merge image as template
:param mergefun... | |
" + self.config["storage_name"]
def fix_config(self, options):
"""
Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.
:param options: the options to fix
:type options: dict
:return: the (potentially) fixed options
:rtype: dict
"""
options = super(Evaluate, self).fix_confi... | |
:param src: source
:param dst: destination
:param acl_type: access list type. it can be extended, standard, webtype, or nothing.
:return: None
Comments:
# create access list: access-list 100 permit ip any any
>>> config_access_list('100', 'permit', protocol='ip', src='any', dst='any')
"""
cmd = '\naccess-list... | |
<reponame>tomwright01/iowa_oct_analysis
import numpy as np
import pandas as pd
import logging
import os
import fnmatch
import re
import xml.etree.ElementTree
import skimage.transform
from . import readIowaData
# from . import readBioptigenOct
from . import readCirrusOct
from . import translate_array as translate
logg... | |
<reponame>konradkonrad/raiden
import copy
import random
from raiden.routing import get_best_routes
from raiden.tests.utils import factories
from raiden.tests.utils.transfer import make_receive_transfer_mediated
from raiden.transfer import node, token_network, views
from raiden.transfer.mediated_transfer.state_change i... | |
import binascii
from math import ceil, sqrt, floor
from skimage.measure import compare_psnr
import numpy as np
import cv2
import os
import math
from scipy.optimize import curve_fit
IMG_EXTENSIONS = ['.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.bin', '.tiff'
]
RAW_EXTENSIONS = [... | |
'pfsense': ['pfsense'],
'pharmaceutical': ['pharmaceutical'],
'pharmaceutical_company': ['pharmaceutical+company'],
'pharmacology': ['pharmacology'],
'phd': ['phd'],
'phenomenology': ['phenomenology'],
'philips_medical': ['philips+medical'],
'philologist': ['philologist'],
'philology': ['philology'],
'philosop... | |
int or imgaug.random.RNG or numpy.random.Generator or numpy.random.bit_generator.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
See :func:`imgaug.augmenters.meta.Augmenter.__init__`.
Examples
--------
>>> import imgaug.augmenters as iaa
>>> aug = iaa.CoarsePepper(0.05, size_percen... | |
<reponame>econcarol/ISLR
# ISLR Ch 6 by <NAME>
import itertools
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
from sklearn.preprocessing import PolynomialFeatures, scale
from sklearn.model_selection import train_test_split, KFold, cross_val_score
from sklearn.linea... | |
are None, they will be set
to :attr:`embed_dim` such that query, key, and value have the same
number of features.
Examples::
>>> multihead_attn = nn.MultiheadAttention(embed_dim, num_heads)
>>> attn_output, attn_output_weights = multihead_attn(query, key, value)"""
argument_parser.add_argument(
"--embed_dim", hel... | |
<reponame>UCL/moztrap<gh_stars>0
"""
Tests for queryset-filtering.
"""
from django.http import QueryDict
from mock import Mock
from django.template.response import TemplateResponse
from django.test import RequestFactory
from django.utils.datastructures import MultiValueDict
from tests import case
class FiltersTes... | |
tmp4855)
tmp4911 = (tmp4912 if depth7 else tmp4915)
tmp4910 = (tmp4911 if depth6 else tmp4915)
tmp4921 = (tmp4913 if k1 else tmp4865)
tmp4920 = (tmp4921 if depth7 else tmp4915)
tmp4919 = (tmp4920 if depth6 else tmp4915)
tmp4918 = (tmp4910 if depth5 else tmp4919)
tmp4917 = (tmp4910 if depth4 else tmp4918)
tmp490... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.