input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>nltk/compat.py
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Compatibility
#
# Copyright (C) 2001-2015 NLTK Project
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import absolute_import, print_function
import os
import sys
import types
from functools import wraps... | |
+ 1)
]
nodal_forces_y = aux_nodal_forces[1 :: self.number_dof] - nodal_shaft_weight
elm_forces_y = np.zeros_like(elm_weight)
elm_forces_y[:, 0] = nodal_forces_y[:-1]
elm_forces_y[-1, 1] = -nodal_forces_y[-1]
elm_forces_y += elm_weight
# locate and collect bearing and disk forces
aux_df = aux_rotor.df.loc[
(a... | |
A SymbolicConstant specifying the type of solver. Possible values are DIRECT and
ITERATIVE. The default value is DIRECT.
matrixStorage
A SymbolicConstant specifying the type of matrix storage. Possible values are SYMMETRIC,
UNSYMMETRIC, and SOLVER_DEFAULT. The default value is SOLVER_DEFAULT.
amplitude
A Symbolic... | |
# initial concentration
if call_libsbml(sbml.isSetInitialAmount):
self.distribution_init_concentration = self.model.distribution_init_concentrations.create()
annots.extend(['distribution_init_concentration.id',
'distribution_init_concentration.name',
'distribution_init_concentration.distribution',
'distribution_i... | |
from manim import *
class cir(Scene):
def construct(self):
circle = Circle(radius = 1, color = BLUE, fill_opacity = 0.5)
tex= Text("now we have to discuss circle")
tex.to_corner(UP+LEFT)
self.play(Write(tex))
self.wait(2)
self.add(circle)
self.wait(2)
self.remove(circle)
self.wait(2)
# p1= circle.point_at_... | |
# -*- coding: utf-8 -*-
"""Handling of bv_maker configuration (bv_maker.cfg)."""
from __future__ import absolute_import, division
from __future__ import print_function, unicode_literals
import glob
from optparse import OptionParser
import os
import shlex
from socket import gethostname # for use in eval()'d expressio... | |
from __future__ import unicode_literals
import uuid
from django.contrib import auth
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.db.models.functions import Concat
from django.utils import six
import django_filters
from django_filters.filterset import FilterSetM... | |
<gh_stars>1-10
""" Script to change versioning of files (eg. manifest.yml) for executors
[encoders, crafters, indexers, rankers, evaluators, classifiers etc.].
It also adds the required jina version.
Commits the change in the branch and raises a PR for the executor.
Then attempts to automatically merge the PRs
"""
impo... | |
<filename>Models/model_convPN.py
# Importation of libraries
import math
import torch
import numpy as np
from Models.model_utils import *
import pdb
##############################################
## SLP POOLING BLOCK ##
##############################################
class SLP_Pooling(torch.autograd.Function):
@static... | |
<reponame>quarkme84/rootplots
# -*- coding: utf-8 -*-
"""
Note:
The classes defined in this module do **NOT** provide drawing capabilities, so there is **NO** draw() nor paint()
method. Use other libraries like matplotlib to plot the data. But for your convenience, this package provides a
module for easy plotting ... | |
for (
entity_token_start,
entity_token_end,
), special_token_id in token_span_with_special_token_ids:
first_ids = (
first_ids[:entity_token_end] + [special_token_id] + first_ids[entity_token_end:]
)
first_ids = (
first_ids[:entity_token_start]
+ [special_token_id]
+ first_ids[entity_token_start:]
)
elif sel... | |
<filename>_v5_proc_cv2dnn_ssd.py<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# COPYRIGHT (C) 2014-2020 <NAME>.
# This software is released under the MIT License.
# https://github.com/konsan1101
# Thank you for keeping the rules.
import sys
import os
import time
import datetime
import codecs
import glob... | |
the *scad2d*s:
next_indent: str = indent + " "
scad2d: Scad2D
for scad2d in scad2ds:
scad2d.scad_lines_append(scad_lines, next_indent)
# Output the closing '}':
scad_lines.append(f"{indent}}}")
# Module2d.use_module_get():
def use_module_get(self) -> "UseModule2D":
"""Return the UseModule associated with Mod... | |
import json
import math
import random
import webcolors
from alive_progress import alive_bar
import cairo
def do_nothing():
"""Do nothing. A dummy function to use in place of alive_bar."""
pass
class CairoPainter:
"""
A class to interface with the Cairo library to draw the map for a given save file.
"""
def ... | |
<reponame>KinanZ/open_clip
import os
import time
import json
import numpy as np
import torch
import torch.nn as nn
from sklearn import decomposition
from torch.cuda.amp import autocast
import torch.distributed as dist
import sys
sys.path.append('/misc/student/alzouabk/Thesis/self_supervised_pretraining/open_clip_the... | |
(40, 60)
else:
self.print_roll(roll, "Something unusual!")
return self.roll_room_unusual_shape_and_size()
self.print_roll(roll, "A {w}x{h} {kind}".format(w=w, h=h, kind=kind))
return aagen.geometry.rectangle_list(w, h)
def roll_room_unusual_shape_and_size(self):
# First we roll the area:
area = self.roll_r... | |
<reponame>meteogrid/OWSLib
# -*- coding: iso-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 <NAME>
# Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com>
#
# Authors : <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# Contact email: <EMAIL>
# ===================... | |
"""
Question
--------
How do the core metabolisms of Alphaproteobacteria and Betaproteobacteria compare?
Which neofunctionalised enzymes cause the core metabolism of Alphaproteobacteria or Betaproteobacteria to have increased redundancy? How much do they contribute?
Method
------
- get clades
- get core metabolisms
- ... | |
7 for destEndPointIpv4
ovrly = ixNet.add(destEndPointIpv4Mv, 'overlay')
ixNet.setMultiAttribute(ovrly,
'-count', '1',
'-index', '7',
'-indexStep', '0',
'-valueStep', '2.0.0.14',
'-value', '2.0.0.14')
ixNet.commit()
# Adding overlay 8 for destEndPointIpv4
ovrly = ixNet.add(destEndPointIpv4Mv, 'overlay'... | |
<reponame>CMUSTRUDEL/flask-browser
"""
Foo
"""
from flask import render_template, flash, redirect, url_for, abort
from flask import request
from werkzeug.urls import url_parse
from flask_paginate import Pagination, get_page_parameter, get_page_args
from flask_login import current_user, login_required
from app import ap... | |
# imports csv library
import csv
# RICS .CSV
ricsFileName = 'Oboz'
ricsFile = open(ricsFileName + '.csv')
ricsReader = csv.reader(ricsFile)
ricsData = list(ricsReader)
# AMAZON .CSV
amzFileName = 'Amazon'
amzFile = open(amzFileName + '.csv')
amzReader = csv.reader(amzFile)
amzData = list(amzReader)
# ... | |
Initialize $\mathbf{w} = \mathbf{0}$
# * Repeat $T$ times:
# * for each $(x,y) \in \mathcal{D}$ (in random order):
# * $\tilde{y} = \text{argmax}_{y'\in \mathcal{Y}} \mathbf{Score}_{\textbf{w}, \phi}(x,y') + \mathbf{cost}(y,y')$
# * $\mathbf{w} = \mathbf{w} + \eta(\phi(x,y) - \phi(x,\tilde{y}))$
#
# This is very intui... | |
<filename>refman/refman.py
# RefMan - A Simple python-based reference manager.
# Author: <NAME> (<EMAIL>)
import argparse
import dataclasses
import hashlib
import json
import logging
import os
from pathlib import Path
import re
import shutil
import subprocess
from typing import Iterable, List, Tuple
from arxiv2bib imp... | |
<gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T
#
# Copyright (c) 2016+ <NAME> + <NAME>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# Supporting Flat, xxyxyz.org... | |
<gh_stars>0
import sys
import time
from options.train_options import TrainOptions
from my_seg_depth.my_data import dataloader
from util.visualizer import Visualizer
from tensorboardX import SummaryWriter
import my_seg_depth.networks as networks
from torch.nn import init
import torch
#from .model import Seg_Depth
#from ... | |
= sorted(
{
'function': [root+'/'+root+'/'+root+'/'+root],
'type':TypeError,
'msg':mmsg('F'),
'raised': [False]
}.items()
)
assert re.compile(r'\d+/'+emsg('F')).match(exname)
erec['function'] = [
exobj.decode_call(call) for call in erec['function']
]
assert sorted(erec.items()) == ref
###
# Test property ... | |
<filename>src/blueprints/data_server.py
import functools
import math
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for, jsonify, send_from_directory, current_app
)
from werkzeug.utils import secure_filename, escape
#from modules.data.database.db import get_db, query_db
f... | |
#!/usr/bin/env python3
#
# Copyright (C) 2017 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AN... | |
from geometric_primitives import brick
from geometric_primitives import bricks
import dataset_common
def car_demo():
bricks_ = bricks.Bricks(150)
list_brick_ = []
brick_ = brick.Brick()
brick_.set_position([0, 0, 3])
brick_.set_direction(1)
list_brick_.append(brick_)
'''
for i in range(5):
brick_ = brick... | |
# Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, check out LICENSE.md
import functools
import re
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
fr... | |
<gh_stars>0
#!/usr/bin/env python3
# Copyright 2018 <NAME>
# (github.com/santigl)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this l... | |
a tuple of length 2 with the
rms of the noise in the horizontal and vertical plane, respectively
and an optional key: 'cutoff' which must be a float defining in how
many sigma the distribution must be truncated (default: 1). This
noise will be added to the reference orbit (gcod + bba) simulating
errors in the bpms... | |
<reponame>NVlabs/torchtrainers<filename>torchtrainers/trainer.py
#
# Copyright (c) 2013-2019 <NAME>. All rights reserved.
# This file is part of torchtrainers (see unknown).
# See the LICENSE file for licensing terms (BSD-style).
#
"""Training-related part of the Keras engine.
"""
import os
import os.path
import sys
i... | |
shared.system,
pseudos = get_pseudos('qmcpack',shared),
)
set_loc(loc+'vmc_inputs jastrows')
jkw = extract_keywords(inputs,jastrow_factor_keys,optional=True)
jkw.system = shared.system
j2kw = jkw.copy()
j2kw.set(J1=1,J2=1,J3=0)
j3kw = jkw.copy()
j3kw.set(J1=1,J2=1,J3=1)
task.J2_inputs = j2kw
task.J3_inputs ... | |
is not active yet. Down - actively trying to bring up a protocol session, but negotiation is didn't successfully complete (yet). Up - session came up successfully.
- Sources (number): Number of Sources
- StackedLayers (list(str[None | /api/v1/sessions/1/ixnetwork/topology/.../*])): List of secondary (many to one) chi... | |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import csv
import datetime
import django
import logging
import os
import pysftp
import re
import shutil
import sys
import time
import uuid
from django.db import connections
from django.conf import settings
from djimix.core.utils import ... | |
"""Tests for traitlets.config.configurable"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
from unittest import TestCase
from pytest import mark
from traitlets.config.application import Application
from traitlets.config.configurable import (
Co... | |
group by x.a;
''', explainResponse=["SELECT A FROM NATIVE.T", "SELECT V1 FROM NATIVE.G"])
self.compareWithNativeExtended('''
SELECT GROUP_CONCAT(A ORDER BY C), GROUP_CONCAT(A ORDER BY C) FROM {v}.t;
''', explainResponse="SELECT GROUP_CONCAT(A ORDER BY C), GROUP_CONCAT(A ORDER BY C) FROM NATIVE.T")
self.compareWith... | |
# Copyright (c) 2003-2019 by <NAME>
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions, a... | |
import json
from collections import OrderedDict
from logging import debug
from flask import request, render_template, Markup, Response, abort
from coocstats import CountStats
from charts import chart_types
from hocqueries import hocqueries
from examples import example_terms, example_pairs
from common import uniq, m... | |
<gh_stars>1-10
from webpie import WebPieApp, WebPieHandler, Response, app_synchronized
import couchbase
from ConfigParser import ConfigParser
from threading import RLock
import os, time, json, urllib2, zlib, yaml, urllib, sys
from cStringIO import StringIO
from striped.client import CouchBaseConfig, CouchBaseBackend
f... | |
<filename>src/api/datamanage/pro/datamodel/dmm/calculation_atom_manager.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.... | |
parent module contains this
submodule _or_ `None`.
"""
return self._submodule_basename_to_node.get(submodule_basename)
def remove_global_attr_if_found(self, attr_name):
"""
Record the global attribute (e.g., class, variable) with the passed
name if previously recorded as defined by the pure-Python module
cor... | |
<filename>sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root fo... | |
getReturnResult([DIALECT.IONIC], [DIALECT.AEOLIC])
elif (cleanForm[-1:] == "a"):
return getReturnResult([DIALECT.AEOLIC], [DIALECT.IONIC])
elif (case == "gen"):
if (cleanForm[-2:] == "hs"):
return getReturnResult([DIALECT.IONIC], [DIALECT.AEOLIC])
elif (cleanForm[-2:] == "as"):
return getReturnResult([DIALECT.AE... | |
<reponame>bjornbytes/OpenXR-SDK-Source
#!/usr/bin/env python3
# Copyright (c) 2019 Collabora, Ltd.
#
# SPDX-License-Identifier: Apache-2.0
#
# Author(s): <NAME> <<EMAIL>>
#
# Purpose: This script helps drive a per-section PDF diff.
import re
from itertools import chain, zip_longest
from pathlib import Path
from pprint... | |
a Keras sequential model.
Since this SSE handles preprocessing the number of features will be inferenced from the training data.
However, when using 3D or 4D data the input_shape needs to be specified in the first layer.
Note that this SSE does not support the keras input_dim argument. Please always use input_shap... | |
chunked_keys = [keys[start: start + chunk_size] for start in range(0, len(keys), chunk_size) ]
for chunk in chunked_keys:
items = self.read_items_from_redis(chunk)
self.delete_keys(chunk)
# transform them into lines
items = [json.dumps(items[x]).decode('utf-8') + '\n' for x in items]
f.writelines(items)
log.info... | |
<filename>pairwise_fusion_kd_new_data/log/train_single_seq/2021-07-05_15-37-16/data/Dataset_com.py
from data.obj_util import *
from torch.utils.data import Dataset
import numpy as np
import os
import warnings
import torch
import torch.multiprocessing
from multiprocessing import Manager
from data.config_com import Confi... | |
+ 268965040 * uk_72
+ 822048080 * uk_73
+ 71976560 * uk_74
+ 238706473 * uk_75
+ 729567671 * uk_76
+ 63879197 * uk_77
+ 2229805417 * uk_78
+ 195236419 * uk_79
+ 19 * uk_8
+ 17094433 * uk_80
+ 250047 * uk_81
+ 265923 * uk_82
+ 75411 * uk_83
+ 317520 * uk_84
+ 281799 * uk_85
+ 861273 * uk_86
+ 75411 * uk_... | |
<filename>project/analysis/models.py
import json
import datetime
import hashlib
import logging
import os
import uuid
import io
import requests
import zipfile
import itertools
import pandas as pd
import math
import numpy
from scipy import stats, ndimage
from collections import defaultdict
from django.db import models
f... | |
if replace_control_characters is None:
replace_control_characters = False
replace_control_characters = _execute.make_bool(replace_control_characters, "replace_control_characters")
if Tsplits is None:
Tsplits = _dtypes.int64
Tsplits = _execute.make_type(Tsplits, "Tsplits")
input = _ops.convert_to_tensor(input, _dt... | |
""" Functions that help with SKA simulations
"""
__all__ = ['plot_visibility', 'plot_visibility_pol', 'find_times_above_elevation_limit', 'plot_uvcoverage',
'plot_azel', 'plot_gaintable', 'plot_pointingtable', 'find_pb_width_null',
'create_simulation_components', 'plot_pa']
import logging
import astropy.constants... | |
= self.Z_VAL[self.i+1]
self.r = self.gp_sin_ratio
self.zeq = float(((self.z1*(log10(self.r2)-log10(self.r))+self.z2*(log10(self.r)-log10(self.r1)))/(log10(self.r2)-log10(self.r1))))
self.energy_count = 11
self.sin_gp_perform_func2()
else:
pass
elif self.gp_sin_energy == "0.500":
for self.i in range(0,... | |
representation, padded to 8 characters. """
# return '{0:0{1}X}'.format( struct.unpack('<I', struct.pack( '<f', floatValue ))[0], 8 )
def toInt( input ): # Converts a 1, 2, or 4 bytes object or bytearray to an integer.
try:
byteLength = len( input )
if ( byteLength == 1 ): return struct.unpack( '>B', inp... | |
<filename>src/Components/misc/obs_aod/ABC/abc_c6_aux.py
"""
This module contains auxiliary functions used by the MODIS Collection 6 Neural Net Retrieval.
<NAME>, 2016.
"""
import os, sys
from matplotlib.pyplot import cm, imshow, plot, figure
from matplotlib.pyplot import xlabel, ylabel, title, grid, savefig, legen... | |
# -*- coding: utf-8 -*-
#
# Author: <NAME> <<EMAIL>>
#
# Array utilities
from sklearn.utils import validation as skval
import numpy as np
import pandas as pd
from ..compat import DTYPE
from ._array import C_intgrt_vec
__all__ = [
'as_series',
'c',
'check_endog',
'check_exog',
'diff',
'diff_inv',
'is_iterable... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
JPEG codestream-parser (All-JPEG Codestream/File Format Parser Tools)
See LICENCE.txt for copyright and licensing conditions.
"""
from __future__ import print_function, division
import sys
from jp2utils import ordb, ordw, ordl, ordq, ieee_float_to_float, ieee_double_t... | |
is `Available`, the CIDR block is available.
"""
pulumi.set(__self__, "create_time", create_time)
pulumi.set(__self__, "id", id)
pulumi.set(__self__, "is_default", is_default)
pulumi.set(__self__, "nat_gateway_id", nat_gateway_id)
pulumi.set(__self__, "nat_ip_cidr", nat_ip_cidr)
pulumi.set(__self__, "nat_ip_cidr... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google 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 or agr... | |
from winney import Winney, Address, retry
from typing import Dict, List
from .errors import RequestError, ParamError
from .entities import (Entity, ServiceEntity, ServiceListEntity,
InstanceEntity, HostEntity, InstanceListEntity,
ServerEntity, LeaderEntity, MetricsEntity,
LoginResponse, RoleListResponse, Permission... | |
<filename>cs15211/CourseScheduleIII.py
__source__ = 'https://leetcode.com/problems/course-schedule-iii/'
# Time: O(nlog(n))
# Space: O(n)
#
# Description: Leetcode # 630. Course Schedule III
#
# There are n different online courses numbered from 1 to n.
# Each course has some duration(course length) t and closed on dth... | |
'fifo_cpu' : 0b010,
'fast_serial' : 0b100},
value = 'uart')})
elif PRODUCT_IDS[self.owner.device.idProduct] in ['FT4232H']:
self.registers['port_cfg'] = hwio.register.Register(description = 'Port configuration',
address = bitstring.Bits('0x00'),
length = 16,
bitfields = {'port_d_driver' : hwio.register.Bitfield... | |
<gh_stars>0
import ddh1 as ddh
import ddh1.taxonomy as taxonomy
import requests
import copy
import datetime
import time
import json
import os
import yaml
import re
import copy
# NB: disussion of new API format is here: http://jira.worldbank.org/jira/browse/DDH2-170
def search(fields=[], filter={}, obj_type='dataset... | |
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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/L... | |
<filename>sushi.py
#!/usr/bin/env python2
import logging
import sys
import operator
import argparse
import os
import bisect
import collections
from itertools import takewhile, izip, chain
import time
import numpy as np
import chapters
from common import SushiError, get_extension, format_time, ensure_static_collection... | |
<filename>tests/unit_test/api/api_processor_test.py
import asyncio
import datetime
import os
from urllib.parse import urljoin
import jwt
import responses
from fastapi import HTTPException
from fastapi_sso.sso.base import OpenID
from mongoengine import connect
from mongoengine.errors import ValidationError, DoesNotExis... | |
<filename>webfront/tests/tests_3_endpoints_using_searcher.py
import time
from tqdm import tqdm
from interpro import settings
from rest_framework import status
from webfront.tests.InterproRESTTestCase import InterproRESTTestCase
from webfront.searcher.elastic_controller import ElasticsearchController
from webfront.tes... | |
<reponame>tschwinge/borg
# -*- encoding: utf-8 *-*
import os
import io
import re
import sys
from collections import OrderedDict
from datetime import datetime
from glob import glob
from distutils.command.build import build
from distutils.core import Command
import textwrap
import setup_lz4
import setup_zstd
import se... | |
<filename>TrainingExtensions/torch/test/python/test_quantizer.py
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2017-2019, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and bina... | |
<filename>lib/modeling/rel_heads.py<gh_stars>10-100
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.autograd import Variable
from core.config import cfg
import nn as mynn
import utils.net as net_utils
import numpy as np
import modeling.geo_feat as geo_feat
cl... | |
#!/usr/bin/env python3
#
# This script checks for updates to zcashd's dependencies.
#
# The SOURCE_ROOT constant specifies the location of the zcashd codebase to
# check, and the GITHUB_API_* constants specify a personal access token for the
# GitHub API, which need not have any special privileges.
#
# All dependencies... | |
<reponame>adunmore/triage
import pandas
from triage.component.audition.selection_rules import (
best_current_value,
best_average_value,
most_frequent_best_dist,
best_average_two_metrics,
best_avg_var_penalized,
best_avg_recency_weight,
lowest_metric_variance,
)
def test_best_current_value_greater_is_better():... | |
Radiometric relation between scene radiance L and the light Irradiance E reaching the pixel sensor
:param L: Scene Radiance
:param N: Lens Aperture
:param alfa: Off-Axis Angle
:return: Irradiance reaching the pixel sensor
"""
E = L*self.lens_aperture_attenuation(N)*self.natural_vignetting(alfa)
return E
@stati... | |
+= tf.einsum("kd,ibk->ibd", cur_y, perms[i])
tables.append(lookup_table)
projs.append(proj_W)
if perms is None:
cat_lookup = tf.concat(cat_lookup, 0)
y = embedding_lookup(cat_lookup, x)
else:
y = cat_lookup
ret_params = [tables, projs]
y *= emb_scale
return y, ret_params
def mask_adaptive_logsoftmax(
hidd... | |
"""
Evaluates the baseline method requested. Evaluation output is returned as a Results object. For Katz
neighbourhood=`in` and neighbourhood=`out` will return the same results corresponding to neighbourhood=`in`.
Execution time is contained in the results object. If the train/test split object used to initialize th... | |
= cnbtc_tuple[0]
amount = cnbtc_tuple[2]
remain = amount
price = cnbtc_tuple[3]
if amount==0:
cnbtcTradeQue2.put((0.0,0.0))
cnbtcTradeQue1.task_done()
continue
buy = True
if cnbtc_tuple[1] == "sell":
buy = False
times = 10
while True:
if buy:
order = cnbtc.buy(volume = amount,price=price+slippage)
else:
... | |
<gh_stars>0
'''
Created on Feb 27, 2015
@author: root
'''
import time
from paxes_nova.virt.ibmpowervm.ivm import blockdev
from paxes_nova.virt.ibmpowervm.ivm import command
from paxes_nova.virt.ibmpowervm.ivm.blockdev import ISCSIDiskAdapter
from paxes_nova.virt.ibmpowervm.common.volume_utils \
import PowerVCNovaVir... | |
will be final result)
msg = ''
# Foreach word in the last entry of H
for w in H[-1]:
# Add word in hex to $msg string variable
msg += hex(w)[2:].zfill(8)
return msg
@staticmethod
def sha512(message, message_format=0):
# Set inital message
inital_message = ppp.from_str(message)
# Convert message if neccessary... | |
<reponame>jacoblb64/pico_rgb_keypad_hid
# SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries
# SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`iothub_device`
=====================
Connectivity to Azure IoT Hub
* Author(s): <NAME>, <NAME>
"""
import json
imp... | |
line
fn_line = _get_line_sample_func(C_vv, theta + pi / 2.0)
ax.plot(*fn_line(mu=mu_l)[0], linestyle="--", color=line.get_color())
try:
v1.zt
z_var = "zt"
except AttributeError:
z_var = "zm"
try:
t_units = "s" if "seconds" in v1.time.units else v1.time.units
ax.set_title(
"""Covariance length-scale for\n{... | |
scope for all raw_dbs and datasets
scope=self.generate_scope(acl_type, self.all_scope_ctx),
)
}
)
for acl_type in acl_default_types
]
# root level like cdf:root
elif root_account: # no parameters
# all (no limits)
group_name_full_qualified = f"{BootstrapCore.GROUP_NAME_PREFIX}{root_account}"
# all default A... | |
<reponame>AgazW/Seq-Pip
from PyQt4 import QtGui,QtCore
from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT
import sys
from os import listdir
from os.path import isfile, join
import mainwindow
import subprocess
import bowt
import tophat
from subprocess import Popen, PIPE
import cuff
import cuffquant
import cuffdiff
import cuf... | |
<reponame>semuconsulting/pyrtcm
"""
RTCM Protocol payload definitions
Created on 14 Feb 2022
Information sourced from RTCM STANDARD 10403.3 © 2016 RTCM
:author: semuadmin
"""
# pylint: disable=too-many-lines, line-too-long
# attribute names holding size of MSM repeating groups
NSAT = "NSat"
NSIG = "NSig"
NCELL = "... | |
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: SearchResult
"""
kwargs['_return_http_data_only'] = True
return self.execute_entity_type_collection_search_with_http_info(search_term, **kwargs) # noqa: E501
def execute_entity_type_collection_search_... | |
<filename>library_old/iworkflow_service_template.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# 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 Softwar... | |
"""
plugins.modules
===============
"""
import os
import shutil
import sys
import tempfile
from pathlib import Path
from typing import Any, Dict, List, Optional
from object_colors import Color
import pyaud
DOCS = Path("docs")
README = Path("README.rst")
colors = Color()
colors.populate_colors()
class LineSwitch:
... | |
row = db(db.fornitori.id == id_fornitore).select().first()
error = False
if row.citta is None:
response.flash="Il fornitore non ha la città in anagrafica\nAggiornare l'anagrafica per poter emettere il DDT"
error=True
luoghi = []
try:
if len(row.luogo_consegna_1) is not Null:
luoghi.app... | |
off to previous method using HTS labels:
remover = SilenceRemover(n_cmp = cfg.cmp_dim, silence_pattern = cfg.silence_pattern, label_type=cfg.label_type, remove_frame_features = cfg.add_frame_features, subphone_feats = cfg.subphone_feats)
remover.remove_silence(nn_cmp_file_list, in_label_align_file_list, nn_cmp_file_l... | |
dut: string
:param nvo_name: evpn instance name to be created
:type nvo_name: string
:param vtep_name: vtep name to be bound to evpn instance
:type vtep_name: string
:param config: it takes value as 'yes' or 'no' to configure or remove evpn instance respectively
:type config: string
:param : cli_type
:param : s... | |
deploy custom function which takes as input the logarithm of the total memory usage)
EXAMPLES::
>>> from .estimator import both_may_depth_2_complexity
>>> both_may_depth_2_complexity(n=100,k=50,w=10) # doctest: +SKIP
"""
solutions = max(0, log2(binom(n, w)) - (n - k))
time = inf
memory = 0
r = _optimize_m4r... | |
(self->argc > 0) ? self->args[0] : "");
this->args = strjoin(this->args, (self->argc > 0) ? "\\"" : "");
this->args = strjoin(this->args, (self->argc > 1) ? ", \\"" : "");
this->args = strjoin(this->args, (self->argc > 1) ? self->args[1] : "");
this->args = strjoin(this->args, (self->argc > 1) ? "\\"" : "");
thi... | |
<reponame>rokroskar/GPy
import numpy as np
import sympy as sp
from sympy.utilities.codegen import codegen
from sympy.core.cache import clear_cache
from scipy import weave
import re
import os
import sys
current_dir = os.path.dirname(os.path.abspath(__file__))
import tempfile
import pdb
import ast
from kernpart import Ke... | |
+ ["R_Li[" + str(i + 1) + "]" for i in range(8)]
pars_of_interest = pars_of_interest + [
"R_I",
"R_L",
"theta_md",
"theta_masks",
"sig",
"voc_effect_alpha",
"voc_effect_delta",
"voc_effect_omicron",
]
pars_of_interest = pars_of_interest + [
col for col in df_fit if "phi" in col and "simplex" not in col
]
... | |
' (date month)'),
("%y %b", dt.datetime.strftime(now, "%b %y") + ' (month year)'),
("%y %b", dt.datetime.strftime(now, "%y %b") + ' (year month)'),
("%b %d %Y", dt.datetime.strftime(now, "%b %d %Y") + ' (full date)'),
("%Y %b %d", dt.datetime.strftime(now, "%Y %b %d") + ' (full date)')]
return axis_list_menu
# ... | |
<reponame>ouyang-w-19/decogo
# MINLP written by GAMS Convert at 04/21/18 13:55:14
#
# Equation counts
# Total E G L N X C B
# 327 211 58 58 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 560 154 406 0 0 0 0 0
# FX 1 1 0 0 0 0 0 0
#
# Nonzero counts
# Total const ... | |
Ind. Co.,Ltd.",
"844F03": "Ablelink Electronics Ltd",
"845181": "Samsung Electronics Co.,Ltd",
"84569C": "Coho Data, Inc.,",
"845787": "DVR C&C Co., Ltd.",
"845C93": "Chabrier Services",
"845DD7": "Shenzhen Netcom Electronics Co.,Ltd",
"846223": "Shenzhen Coship Electronics Co., Ltd.",
"8462A6": "EuroCB... | |
# original code: https://github.com/dyhan0920/PyramidNet-PyTorch/blob/master/train.py
import argparse
import os
import shutil
import time
import cv2
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distr... | |
# Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved
from django.utils.translation import ugettext as _, ugettext_lazy
from iondb.rundb.models import (
Chip,
LibraryKey,
RunType,
KitInfo,
common_CV,
ApplicationGroup,
SampleGroupType_CV,
dnaBarcode,
ReferenceGenome,
ApplProduct,
PlannedExperimen... | |
only 1
if idx_ld == self._ord_caliper[-1] and idx == self.calipers[idx_ld].mru_index():
shape['fillcolor'] = CLR_CLPR_RECT_ACT
else:
shape['fillcolor'] = CLR_CLPR_RECT
def clear_measurements(self):
self._ord_caliper = []
for c in self.calipers:
c.clear_measurements()
def get_caliper_annotations(self, idx_ld)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.